add support for getting strings under clientSideStrings and update sample

This commit is contained in:
Matteo Pagliazzi
2013-11-12 22:23:47 +01:00
parent be2010b0a2
commit 22267805ee
2 changed files with 8 additions and 5 deletions
+6 -3
View File
@@ -95,9 +95,12 @@ var getTranslatedString = function(locale, string){
//if(!translations[locale]) throw new Error("Missing locale '" + locale + "'");
// TODO support nested dot-separated strings
if(translations[locale][string]) return translations[locale][string];
if(translations['en'][string]) return translations['en'][string];
return 'String not found.';
return (
translations[locale][string] ||
translations[locale]['clientSideStrings'][string] ||
translations['en'][string] ||
translations['en']['clientSideStrings'][string] ||
'String not found.')
}
var avalaibleLanguages = _.map(langCodes, function(langCode){