mirror of
https://github.com/ansible/awx.git
synced 2026-01-18 21:21:21 -03:30
Tweak logic used by UI to detect language
Chromium and WebKit based browsers have the window.navigator.languages attribute, which is an ordered array of preferred languages as configured in the browser’s settings. Although changing the language in Chrome results in an Accept-Language header being added to requests, window.navigator.language still returns the language specified by the OS. I’ve tested this with Firefox, Chrome, IE 11, and Edge. Connect #5360
This commit is contained in:
parent
8df1088c99
commit
be686e0acc
@ -19,7 +19,8 @@ export default
|
||||
.factory('I18NInit', ['$window', 'gettextCatalog',
|
||||
function ($window, gettextCatalog) {
|
||||
return function() {
|
||||
var langInfo = $window.navigator.language ||
|
||||
var langInfo = ($window.navigator.languages || [])[0] ||
|
||||
$window.navigator.language ||
|
||||
$window.navigator.userLanguage;
|
||||
var langUrl = langInfo.replace('-', '_');
|
||||
//gettextCatalog.debug = true;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user