Created
August 30, 2011 15:26
-
-
Save knowuh/1181161 to your computer and use it in GitHub Desktop.
this[View.prototype.i18n.defaultLocale][key] is undefined
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
/** | |
*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