Hi!
Firstly, I want to thank you for your great project. I am using blur admin and we are thinking to migrate our project to ngx admin. As first step we need to add multilanguage support to your project. If you are intrested to add multilanguage support to your project, I can help you or I can fork your project, add multilanguage support then we can merge to your project.
Hi @skarahoda , I think the best way would be to just fork and do a PR adding the new feature.
I've doing some tests with ngx-translate as a way to add multilanguaje support to ngx-admin
Hey @skarahoda, I guess this may be a good idea, we just need to specify the requirements to this task so that we are on the same page before you start digging in. Could you please let us know you plan on this and the library you are going to use? Thanks.
now the nebular components have no translate support but you can 'fake' it:
Install ngx-tranlate. ngx-admin has no ng 5.0 support so you must install 8.0 from ngx-tranlate
npm install @ngx-translate/[email protected]. --save
npm install @ngx-translate/http-loader --save
create an i18n folder under assets and one file for your language as example en.json
{
"dashboard": {
"light": "Light"
}
}
@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
BrowserAnimationsModule,
HttpModule,
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient],
},
}),
AppRoutingModule,
NgbModule.forRoot(),
ThemeModule.forRoot(),
CoreModule.forRoot(),
],
bootstrap: [AppComponent],
providers: [
{ provide: APP_BASE_HREF, useValue: '/' }, TranslateService
],
})
constructor(private analytics: AnalyticsService, private translate: TranslateService) {
// init language
translate.addLangs(['en', 'de']);
translate.setDefaultLang('de'); // Fallback
}
<ngx-status-card title="{{ 'dashboard.light' | translate }}" type="primary" >I hope this helps and I hope of official support in nebular!
Hi @Newan,
It good implementation of translate. but I stuck in translation the menu. is there any solution to do that?
Thanks a lot @Newan i have used your guide in the following issue
Hi @Newan,
It good implementation of translate. but I stuck in translation the menu. is there any solution to do that?Thanks a lot @Newan i have used your guide in the following issue
For the menu item's translation. you can see that the menu items was store in pages-menu.ts
so you can use ngx translate to replace the wordings with lang change event.
Most helpful comment
now the nebular components have no translate support but you can 'fake' it:
Install ngx-tranlate. ngx-admin has no ng 5.0 support so you must install 8.0 from ngx-tranlate
npm install @ngx-translate/[email protected]. --save
npm install @ngx-translate/http-loader --save
create an i18n folder under assets and one file for your language as example en.json
<ngx-status-card title="{{ 'dashboard.light' | translate }}" type="primary" >I hope this helps and I hope of official support in nebular!