Skip to content

Instantly share code, notes, and snippets.

@feedhenry-gists
Created June 10, 2011 11:39
Show Gist options
  • Save feedhenry-gists/1018668 to your computer and use it in GitHub Desktop.
Save feedhenry-gists/1018668 to your computer and use it in GitHub Desktop.
Multilingual Support Language Return Object
function buildAllLanguages(){ // Takes the language files & builds them into an object
var ret = new Object();
for (var i=0; i<languages.length; i++){
var clIndex = languages[i]; // Current language index: Language identifier string, e.g. "en_gb"
var clValue = this[clIndex]; // Current language value. Look for a global by the name clIndex, e.g. this["en_gb"]
ret[clIndex] = clValue; // Append this to our return object with the clIndex as the array key, e.g. ret[en_gb] = clValue;
}
return ret;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment