Skip to content

Instantly share code, notes, and snippets.

@loiane
Last active September 14, 2016 22:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loiane/3588ce18b0fc2d0d390daa8fefe67842 to your computer and use it in GitHub Desktop.
Save loiane/3588ce18b0fc2d0d390daa8fefe67842 to your computer and use it in GitHub Desktop.
sencha extjs 6 - load locale dynamically
function loadLocale(){
var query = Ext.Object.fromQueryString(location.search),
lang = query.lang ? query.lang.toLowerCase() : 'en';
if (lang === 'pt'){
lang = 'pt_BR';
}
var extJsFile = Ext.util.Format.format("resources/locale/ext-locale-{0}.js", lang);
if (lang !== 'en'){
Ext.Loader.loadScript({url: extJsFile});
}
}
loadLocale();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment