javascript - How do I gracefully load a specific localization file dynamically in AngularJS? -


currently, have system has language codes such en, de, jp , on. need provide localisation 8 languages, works if manually add in script file here:

<script src='/js/locale/angular-locale_de.js'></script>.

but need able load dynamically in header. tried using jquery hack using ("head").append() on chrome throws error says async request deprecated.

you don't have invent wheel, there's module -angular dynamic localization- , it's pretty straight forward: https://github.com/lgalfaso/angular-dynamic-locale

and if looking translation, there u go http://angular-translate.github.io/


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -