diff --git a/src/components/CommonUtil.vue b/src/components/CommonUtil.vue index 9f41a73fc51ef45ef5af9b4b63ae024e21afc2c2..f3df148becb5aca7dea3226591a31981665f42d7 100644 --- a/src/components/CommonUtil.vue +++ b/src/components/CommonUtil.vue @@ -83,6 +83,15 @@ setHeaderTitle: function (headerTitle) { document.getElementById("appHeader").innerHTML = headerTitle; + }, + getSystemLocale: function() { + return "nb"; + // TODO: Enable this when more languages are supported + /* + return typeof navigator.language != 'undefined' ? + navigator.language.trim().substring(0, 2) + : null; + */ } } </script> \ No newline at end of file diff --git a/src/components/Observation.vue b/src/components/Observation.vue index faeeb35eb8ec88f43e03c377bdd8be03d711e790..b2799e7fcb4b6b7d8a576629b6ecb4ba49679032 100644 --- a/src/components/Observation.vue +++ b/src/components/Observation.vue @@ -478,7 +478,7 @@ let cropName = jsonDetailCrop.latinName; if (organismLocaleSet) { - let strLocale = This.getSystemLocale(); + let strLocale = CommonUtil.getSystemLocale(); organismLocaleSet.forEach(function (localObj) { @@ -518,7 +518,7 @@ let organismLocaleSet = jsonDetailPest.organismLocaleSet; if (organismLocaleSet) { - let strLocale = This.getSystemLocale(); + let strLocale = CommonUtil.getSystemLocale(); organismLocaleSet.forEach(localObj => { if (localObj.organismLocalePK.locale === strLocale) { if (localObj.localName) { @@ -663,16 +663,6 @@ updateQuntificationData(schemaData) { this.observation.observationData = schemaData; }, - getSystemLocale() { - var localePrefer = null; - var localePrefer2 = null; - if (typeof navigator.language != 'undefined') { - localePrefer = navigator.language; - localePrefer2 = localePrefer.trim().substring(0, 2); - } - - return localePrefer2; - }, }, filters: {