Merge pull request #5368 from shanemcd/tweak-ui-language-lookup-logic

Tweak logic used by UI to detect language
This commit is contained in:
Shane McDonald 2017-02-14 16:59:22 -05:00 committed by GitHub
commit 31eda05231

View File

@ -19,8 +19,10 @@ export default
.factory('I18NInit', ['$window', 'gettextCatalog',
function ($window, gettextCatalog) {
return function() {
var langInfo = $window.navigator.language ||
$window.navigator.userLanguage;
var langInfo = ($window.navigator.languages || [])[0] ||
$window.navigator.language ||
$window.navigator.userLanguage ||
'';
var langUrl = langInfo.replace('-', '_');
//gettextCatalog.debug = true;
gettextCatalog.setCurrentLanguage(langInfo);