How to do ahead-of-time (AOT) translation in AngularJS like in Angular 2+?

5 views
Skip to first unread message

Miroslav Řehoř

unread,
Apr 19, 2018, 9:22:54 PM4/19/18
to Angular and AngularJS discussion

I have AngularJS version 1.5 and want to translate my web into several foreign languages. The translation will run on different domains and there will be no language change option (no countries flags etc.).


There are many examples for AngularJS - but only for something like ng2 JIT (just-in-time):https://technpol.wordpress.com/2013/11/02/adding-translation-using-angular-translate-to-an-angularjs-app/ or https://angular-gettext.rocketeer.be/dev-guide/compile/

Translations are done in browser at runtime.


But I want to something like ng2 AOT (ahead-of-time): https://angular.io/guide/aot-compiler#!#ahead-of-time-aot-vs-just-in-time-jit-

... compile translations at build time into html/js so no additional javascript library is needed to process translations.


Is there some utility to do that? Gulp task or something?


Thanks a lot!

Reply all
Reply to author
Forward
0 new messages