adding a fallback for en_GB and en_US

v1.18.x
Julian Lam 10 years ago
parent 9d2c54e26a
commit 3b3c383d93

@ -47,33 +47,38 @@
// Load the appropriate timeago locale file, and correct NodeBB language codes to timeago codes, if necessary
var languageCode;
switch(config.userLang) {
case 'cs':
languageCode = 'cz';
break;
case 'fa_IR':
languageCode = 'fa';
break;
case 'pt_BR':
languageCode = 'pt-br';
break;
case 'nb':
languageCode = 'no';
break;
case 'zh_TW':
languageCode = 'zh-TW';
break;
case 'zh_CN':
languageCode = 'zh-CN';
break;
default:
languageCode = config.userLang;
break;
case 'en_GB':
case 'en_US':
languageCode = 'en';
break;
case 'cs':
languageCode = 'cz';
break;
case 'fa_IR':
languageCode = 'fa';
break;
case 'pt_BR':
languageCode = 'pt-br';
break;
case 'nb':
languageCode = 'no';
break;
case 'zh_TW':
languageCode = 'zh-TW';
break;
case 'zh_CN':
languageCode = 'zh-CN';
break;
default:
languageCode = config.userLang;
break;
}
$.getScript(RELATIVE_PATH + '/vendor/jquery/timeago/locales/jquery.timeago.' + languageCode + '.js').success(function() {

Loading…
Cancel
Save