Angular 2 + ng-xi18n + AOT does not work

0

I am developing the functionality of language change through buttons defined with <a/> tags, so that the user can change the language by clicking on the button corresponding to the language in which they want to see the web.

To develop it, I took the Angular 2 QuickStart project as a reference , added the compilation < a href="https://angular.io/docs/ts/latest/cookbook/aot-compiler.html"> AOT and JIT , then I added the internationalization utility ng-xi18n ( JIT version and finally, I added the Gulp module to automatically generate the files of other languages.

When I compile my project with JIT and execute it, my language change functionality works perfectly.

The problem I have when I compile my project with AOT and execute it. My language change utility no longer works.

Where can the problem be?

Here is the link to my project: link

To compile and execute it with JIT I use the npm run start command.

To compile and execute it with AOT I use the npm run start:aot command.

To be able to do the double compilation my project has two files index.html and main.js.

    
asked by Paulillo16 23.02.2017 в 18:32
source

1 answer

0

In the documentation link in the section Internationalize with the AOT compiler basically says that you must pre-build the application for each available language, although it does not specify how to use the html depending on the user's language preferences.

    
answered by 27.02.2017 в 21:02