Skip to content

Instantly share code, notes, and snippets.

@knowuh
Created August 30, 2011 15:26
Show Gist options
  • Save knowuh/1181161 to your computer and use it in GitHub Desktop.
Save knowuh/1181161 to your computer and use it in GitHub Desktop.
this[View.prototype.i18n.defaultLocale][key] is undefined
/**
*view_i18n.js
*this[View.prototype.i18n.defaultLocale][key] is undefined
*Line 56
*
* key is the key used to lookup the value in i18n_XX.js file
* locale is which locale to use. will be appended in i18n_[locale].js
* if local does not exist, use defaultLocale
* if key is not found, use defaultLocale's values
*/
View.prototype.i18n.getString = function(key,locale) {
// if specified locale does not exist, use default locale
if (View.prototype.i18n.supportedLocales.indexOf(locale) == -1) {
locale = View.prototype.i18n.defaultLocale;
}
if (this[locale][key] !== undefined) {
return this[locale][key].value;
} else {
return this[View.prototype.i18n.defaultLocale][key].value; // <== line 56 in source.
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment