Last active
September 14, 2016 22:17
-
-
Save loiane/3588ce18b0fc2d0d390daa8fefe67842 to your computer and use it in GitHub Desktop.
sencha extjs 6 - load locale dynamically
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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