ng2-translate

ng2-translate not working in lazy-loaded module

ぃ、小莉子 提交于 2019-11-29 10:45:53
I'm using ng2-translate for language handling in an Angular 2 RC5 app I'm creating. The app has two feature modules, one lazy loaded and one eager loaded. TranslateModule is made available through a shared module. The problem is that the translate pipe works fine in the eager-loaded module but not the lazy-loaded one. To verify it has to do with the loading method I converted both to eager-loading and everything worked fine. A plunk that demonstrates the issue can be found here: Plunker The significant code is below as well. The initial page is the eager-loaded one, hence why the strings look

Angular2 and webpack - i18n plugin vs ng2-translate

我们两清 提交于 2019-11-28 19:23:50
问题 I want to build a web-application with angular2 and bundle this with webpack. What is the best way for providing multiple languages: i18n-plugin: https://github.com/webpack/i18n-webpack-plugin or ng2-translate: https://github.com/ocombe/ng2-translate 回答1: I got it working with webpack using the cookbook. The xliff file has to be converted to ts like so: export const TRANSLATION_SV = `<?xml version="1.0" encoding="UTF-8" ?> <xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">

ng2-translate not working in lazy-loaded module

£可爱£侵袭症+ 提交于 2019-11-28 04:22:16
问题 I'm using ng2-translate for language handling in an Angular 2 RC5 app I'm creating. The app has two feature modules, one lazy loaded and one eager loaded. TranslateModule is made available through a shared module. The problem is that the translate pipe works fine in the eager-loaded module but not the lazy-loaded one. To verify it has to do with the loading method I converted both to eager-loading and everything worked fine. A plunk that demonstrates the issue can be found here: Plunker The