-
-
Notifications
You must be signed in to change notification settings - Fork 402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I18n #64
Comments
@tomalaforge Great question, I don't really have experience with angular i18n so let me do some reading first before answering your question. |
@tomalaforge Hi, for shared UI components (containing static texts that need to be translated), we can store the translations for these Shared components in a JSON file under scope We can initialize Transloco in a separate module with |
@nartc I haven't thought of passing all config files thought forRoot(). I was looking on inline loader but that's not working for static UI components. But do you have an example of your forRoot() app, you 're overwriting the TRANSLOCO_LOADER token? |
@tomalaforge I don't have an example but it should be just a Maybe some pseudo code // TranslocoModule
export class TranslocoModule {
static forRoot(config) {
return {
ngModule: TranslocoModule,
providers: [
{ provide: TRANSLOCO_LOADER, useValue: config.loader }
]
}
}
} // app1.module.ts
@NgModule({
imports: [
TranslocoModule.forRoot({ loader: something_for_app_1 })
]
})
export class App1Module {} // app2.module.ts
@NgModule({
imports: [
TranslocoModule.forRoot({ loader: something_for_app_2 })
]
})
export class App2Module {} |
Thanks very much. Sound promising. I'll try it. |
Hello,
Very nice project.
I have one question: how will you put i18n in that type of architecture ? Like transloco for instance ?
One json file per ui component or one global one ? But if you have multiple app sharing the same component, you'll have to duplicate keys.
Thanks
The text was updated successfully, but these errors were encountered: