From 7f1ee08e5fcd33024cbc38bfc6c154699737fdbd Mon Sep 17 00:00:00 2001 From: Tom Morris Date: Thu, 3 Jul 2014 09:05:39 -0400 Subject: [PATCH] Handle unsupported navigator.language on IE --- main/webapp/modules/core/scripts/index.js | 3 +-- main/webapp/modules/core/scripts/preferences.js | 3 +-- main/webapp/modules/core/scripts/project.js | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/main/webapp/modules/core/scripts/index.js b/main/webapp/modules/core/scripts/index.js index 69880d0d9..b557cdea4 100644 --- a/main/webapp/modules/core/scripts/index.js +++ b/main/webapp/modules/core/scripts/index.js @@ -37,8 +37,7 @@ var Refine = { actionAreas: [] }; -var lang = navigator.language.split("-")[0] - || navigator.userLanguage.split("-")[0]; +var lang = (navigator.language|| navigator.userLanguage).split("-")[0]; var dictionary = ""; $.ajax({ url : "/command/core/load-language?", diff --git a/main/webapp/modules/core/scripts/preferences.js b/main/webapp/modules/core/scripts/preferences.js index 014dc46dd..20c963cbd 100644 --- a/main/webapp/modules/core/scripts/preferences.js +++ b/main/webapp/modules/core/scripts/preferences.js @@ -33,8 +33,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. var preferenceUIs = []; -var lang = navigator.language.split("-")[0] -|| navigator.userLanguage.split("-")[0]; +var lang = (navigator.language|| navigator.userLanguage).split("-")[0]; var dictionary = ""; $.ajax({ url : "/command/core/load-language?", diff --git a/main/webapp/modules/core/scripts/project.js b/main/webapp/modules/core/scripts/project.js index 657a39991..3f81b8778 100644 --- a/main/webapp/modules/core/scripts/project.js +++ b/main/webapp/modules/core/scripts/project.js @@ -34,8 +34,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. var theProject; var ui = {}; -var lang = navigator.language.split("-")[0] - || navigator.userLanguage.split("-")[0]; +var lang = (navigator.language|| navigator.userLanguage).split("-")[0]; var dictionary = ""; $.ajax({ url : "/command/core/load-language?",