ngx-translate

i18n of lazy-loaded components in JHipster app

房东的猫 提交于 2019-12-01 08:07:31
问题 My App is based on JHipster and so the language services are provided by way of JhiLanguageService in the ng-jhipster library which uses a JhiConfigService to configure ngx-translate without my needing to import and configure the TranslateModule in my app.module . So when I add TranslateModule.forRoot(...) to imports of AppModule, everything breaks and I just see "translation not found..." messages everywhere. I don't know how to make my lazy-loaded pages use the same translation service

Angular 5 internationalization

大城市里の小女人 提交于 2019-11-28 04:39:10
I'm building an application using the latest Angular5 and what I need is for a user to be able to switch languages. I've never had to implement this in an Angular2+ (actually I'm using Angular5). I need to set translations in two places: Component's template html - change labels to the specified language In code in the component.ts file - I may need to translate some strings that are built dynamically under particular conditions in the code I was looking at ngx-translation and it looks to do everything I need, as in it allows you to change language without rebuilding your code, see here .