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
Post a Comment