From 065bd6041cc1504824e7aa499ec27b6ad069ba85 Mon Sep 17 00:00:00 2001 From: Shane McDonald Date: Tue, 14 Feb 2017 16:54:32 -0500 Subject: [PATCH] Default to empty string for UI language detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When removing all “Languages” from Firefox, the UI breaks and you see an error in the console that says “langInfo is undefined”. This fixes that. --- awx/ui/client/src/i18n.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/awx/ui/client/src/i18n.js b/awx/ui/client/src/i18n.js index d024f01c7d..2b24a09822 100644 --- a/awx/ui/client/src/i18n.js +++ b/awx/ui/client/src/i18n.js @@ -21,7 +21,8 @@ export default return function() { var langInfo = ($window.navigator.languages || [])[0] || $window.navigator.language || - $window.navigator.userLanguage; + $window.navigator.userLanguage || + ''; var langUrl = langInfo.replace('-', '_'); //gettextCatalog.debug = true; gettextCatalog.setCurrentLanguage(langInfo);