Support for languages with "_" separator (en_US).
This commit is contained in:
parent
5cf94b8ca9
commit
b7675946f8
|
@ -100,7 +100,7 @@ Common.Locale = new(function() {
|
|||
var langParam = _getUrlParameterByName('lang');
|
||||
var xhrObj = _createXMLHTTPObject();
|
||||
if (xhrObj && langParam) {
|
||||
var lang = langParam.split("-")[0];
|
||||
var lang = langParam.split(/[\-\_]/)[0];
|
||||
xhrObj.open('GET', 'locale/' + lang + '.json', false);
|
||||
xhrObj.send('');
|
||||
l10n = eval("(" + xhrObj.responseText + ")");
|
||||
|
|
|
@ -233,7 +233,7 @@
|
|||
}
|
||||
|
||||
var params = getUrlParams(),
|
||||
lang = (params["lang"] || 'en').split("-")[0],
|
||||
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
|
||||
customer = params["customer"] ? ('<div class="loader-page-text-customer">' + encodeUrlParam(params["customer"]) + '</div>') : '',
|
||||
margin = (customer !== '') ? 50 : 20,
|
||||
loading = 'Loading...',
|
||||
|
|
|
@ -225,7 +225,7 @@
|
|||
}
|
||||
|
||||
var params = getUrlParams(),
|
||||
lang = (params["lang"] || 'en').split("-")[0],
|
||||
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
|
||||
customer = params["customer"] ? ('<div class="loader-page-text-customer">' + encodeUrlParam(params["customer"]) + '</div>') : '',
|
||||
margin = (customer !== '') ? 50 : 20,
|
||||
loading = 'Loading...',
|
||||
|
|
|
@ -1075,7 +1075,7 @@ define([
|
|||
var me = this;
|
||||
var store = this.viewHelpPicker.store;
|
||||
if (lang) {
|
||||
lang = lang.split("-")[0];
|
||||
lang = lang.split(/[\-\_]/)[0];
|
||||
var config = {
|
||||
dataType: 'json',
|
||||
error: function () {
|
||||
|
|
|
@ -219,7 +219,7 @@
|
|||
}
|
||||
|
||||
var params = getUrlParams(),
|
||||
lang = (params["lang"] || 'en').split("-")[0],
|
||||
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
|
||||
customer = params["customer"] ? ('<div class="loader-page-text-customer">' + encodeUrlParam(params["customer"]) + '</div>') : '',
|
||||
margin = (customer !== '') ? 50 : 20,
|
||||
loading = 'Loading...',
|
||||
|
|
|
@ -218,7 +218,7 @@
|
|||
}
|
||||
|
||||
var params = getUrlParams(),
|
||||
lang = (params["lang"] || 'en').split("-")[0],
|
||||
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
|
||||
customer = params["customer"] ? ('<div class="loader-page-text-customer">' + encodeUrlParam(params["customer"]) + '</div>') : '',
|
||||
margin = (customer !== '') ? 50 : 20,
|
||||
loading = 'Loading...',
|
||||
|
|
|
@ -206,7 +206,7 @@
|
|||
}
|
||||
|
||||
var params = getUrlParams(),
|
||||
lang = (params["lang"] || 'en').split("-")[0],
|
||||
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
|
||||
customer = params["customer"] ? ('<div class="loader-page-text-customer">' + encodeUrlParam(params["customer"]) + '</div>') : '',
|
||||
margin = (customer !== '') ? 50 : 20,
|
||||
loading = 'Loading...',
|
||||
|
|
|
@ -205,7 +205,7 @@
|
|||
}
|
||||
|
||||
var params = getUrlParams(),
|
||||
lang = (params["lang"] || 'en').split("-")[0],
|
||||
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
|
||||
customer = params["customer"] ? ('<div class="loader-page-text-customer">' + encodeUrlParam(params["customer"]) + '</div>') : '',
|
||||
margin = (customer !== '') ? 50 : 20,
|
||||
loading = 'Loading...',
|
||||
|
|
|
@ -232,7 +232,7 @@
|
|||
}
|
||||
|
||||
var params = getUrlParams(),
|
||||
lang = (params["lang"] || 'en').split("-")[0],
|
||||
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
|
||||
customer = params["customer"] ? ('<div class="loader-page-text-customer">' + encodeUrlParam(params["customer"]) + '</div>') : '',
|
||||
margin = (customer !== '') ? 50 : 20,
|
||||
loading = 'Loading...',
|
||||
|
|
|
@ -225,7 +225,7 @@
|
|||
}
|
||||
|
||||
var params = getUrlParams(),
|
||||
lang = (params["lang"] || 'en').split("-")[0],
|
||||
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
|
||||
customer = params["customer"] ? ('<div class="loader-page-text-customer">' + encodeUrlParam(params["customer"]) + '</div>') : '',
|
||||
margin = (customer !== '') ? 50 : 20,
|
||||
loading = 'Loading...',
|
||||
|
|
|
@ -849,7 +849,7 @@ define([
|
|||
var me = this;
|
||||
var store = this.viewHelpPicker.store;
|
||||
if (lang) {
|
||||
lang = lang.split("-")[0];
|
||||
lang = lang.split(/[\-\_]/)[0];
|
||||
var config = {
|
||||
dataType: 'json',
|
||||
error: function () {
|
||||
|
|
|
@ -218,7 +218,7 @@
|
|||
}
|
||||
|
||||
var params = getUrlParams(),
|
||||
lang = (params["lang"] || 'en').split("-")[0],
|
||||
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
|
||||
customer = params["customer"] ? ('<div class="loader-page-text-customer">' + encodeUrlParam(params["customer"]) + '</div>') : '',
|
||||
margin = (customer !== '') ? 50 : 20,
|
||||
loading = 'Loading...',
|
||||
|
|
|
@ -218,7 +218,7 @@
|
|||
}
|
||||
|
||||
var params = getUrlParams(),
|
||||
lang = (params["lang"] || 'en').split("-")[0],
|
||||
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
|
||||
customer = params["customer"] ? ('<div class="loader-page-text-customer">' + encodeUrlParam(params["customer"]) + '</div>') : '',
|
||||
margin = (customer !== '') ? 50 : 20,
|
||||
loading = 'Loading...',
|
||||
|
|
|
@ -222,7 +222,7 @@
|
|||
}
|
||||
|
||||
var params = getUrlParams(),
|
||||
lang = (params["lang"] || 'en').split("-")[0],
|
||||
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
|
||||
customer = params["customer"] ? ('<div class="loader-page-text-customer">' + encodeUrlParam(params["customer"]) + '</div>') : '',
|
||||
margin = (customer !== '') ? 50 : 20,
|
||||
loading = 'Loading...',
|
||||
|
|
|
@ -218,7 +218,7 @@
|
|||
}
|
||||
|
||||
var params = getUrlParams(),
|
||||
lang = (params["lang"] || 'en').split("-")[0],
|
||||
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
|
||||
customer = params["customer"] ? ('<div class="loader-page-text-customer">' + encodeUrlParam(params["customer"]) + '</div>') : '',
|
||||
margin = (customer !== '') ? 50 : 20,
|
||||
loading = 'Loading...',
|
||||
|
|
|
@ -206,7 +206,7 @@
|
|||
}
|
||||
|
||||
var params = getUrlParams(),
|
||||
lang = (params["lang"] || 'en').split("-")[0],
|
||||
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
|
||||
customer = params["customer"] ? ('<div class="loader-page-text-customer">' + encodeUrlParam(params["customer"]) + '</div>') : '',
|
||||
margin = (customer !== '') ? 50 : 20,
|
||||
loading = 'Loading...',
|
||||
|
|
|
@ -205,7 +205,7 @@
|
|||
}
|
||||
|
||||
var params = getUrlParams(),
|
||||
lang = (params["lang"] || 'en').split("-")[0],
|
||||
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
|
||||
customer = params["customer"] ? ('<div class="loader-page-text-customer">' + encodeUrlParam(params["customer"]) + '</div>') : '',
|
||||
margin = (customer !== '') ? 50 : 20,
|
||||
loading = 'Loading...',
|
||||
|
|
|
@ -233,7 +233,7 @@
|
|||
}
|
||||
|
||||
var params = getUrlParams(),
|
||||
lang = (params["lang"] || 'en').split("-")[0],
|
||||
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
|
||||
customer = params["customer"] ? ('<div class="loader-page-text-customer">' + encodeUrlParam(params["customer"]) + '</div>') : '',
|
||||
margin = (customer !== '') ? 50 : 20,
|
||||
loading = 'Loading...',
|
||||
|
|
|
@ -225,7 +225,7 @@
|
|||
}
|
||||
|
||||
var params = getUrlParams(),
|
||||
lang = (params["lang"] || 'en').split("-")[0],
|
||||
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
|
||||
customer = params["customer"] ? ('<div class="loader-page-text-customer">' + encodeUrlParam(params["customer"]) + '</div>') : '',
|
||||
margin = (customer !== '') ? 50 : 20,
|
||||
loading = 'Loading...',
|
||||
|
|
|
@ -320,7 +320,7 @@ define([
|
|||
|
||||
value = Common.localStorage.getItem("sse-settings-func-locale");
|
||||
if (value===null) {
|
||||
var lang = ((this.editorConfig.lang) ? this.editorConfig.lang : 'en').split("-")[0].toLowerCase();
|
||||
var lang = ((this.editorConfig.lang) ? this.editorConfig.lang : 'en').split(/[\-\_]/)[0].toLowerCase();
|
||||
Common.Utils.InternalSettings.set("sse-settings-func-locale", lang);
|
||||
if (lang !== 'en')
|
||||
value = SSE.Views.FormulaLang.get(lang);
|
||||
|
|
|
@ -732,7 +732,7 @@ define([
|
|||
value = Common.Utils.InternalSettings.get("sse-settings-func-locale");
|
||||
item = this.cmbFuncLocale.store.findWhere({value: value});
|
||||
if (!item)
|
||||
item = this.cmbFuncLocale.store.findWhere({value: value.split("-")[0]});
|
||||
item = this.cmbFuncLocale.store.findWhere({value: value.split(/[\-\_]/)[0]});
|
||||
this.cmbFuncLocale.setValue(item ? item.get('value') : 'en');
|
||||
this.updateFuncExample(item ? item.get('exampleValue') : this.txtExampleEn);
|
||||
|
||||
|
@ -1304,7 +1304,7 @@ define([
|
|||
var me = this;
|
||||
var store = this.viewHelpPicker.store;
|
||||
if (lang) {
|
||||
lang = lang.split("-")[0];
|
||||
lang = lang.split(/[\-\_]/)[0];
|
||||
var config = {
|
||||
dataType: 'json',
|
||||
error: function () {
|
||||
|
|
|
@ -217,7 +217,7 @@
|
|||
}
|
||||
|
||||
var params = getUrlParams(),
|
||||
lang = (params["lang"] || 'en').split("-")[0],
|
||||
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
|
||||
customer = params["customer"] ? ('<div class="loader-page-text-customer">' + encodeUrlParam(params["customer"]) + '</div>') : '',
|
||||
margin = (customer !== '') ? 50 : 20,
|
||||
loading = 'Loading...',
|
||||
|
|
|
@ -217,7 +217,7 @@
|
|||
}
|
||||
|
||||
var params = getUrlParams(),
|
||||
lang = (params["lang"] || 'en').split("-")[0],
|
||||
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
|
||||
customer = params["customer"] ? ('<div class="loader-page-text-customer">' + encodeUrlParam(params["customer"]) + '</div>') : '',
|
||||
margin = (customer !== '') ? 50 : 20,
|
||||
loading = 'Loading...',
|
||||
|
|
|
@ -87,7 +87,7 @@ define([
|
|||
|
||||
_.defer(function () {
|
||||
var editorLang = SSE.getController("Main").editorConfig.lang;
|
||||
editorLang = (editorLang ? editorLang : 'en').split("-")[0].toLowerCase();
|
||||
editorLang = (editorLang ? editorLang : 'en').split(/[\-\_]/)[0].toLowerCase();
|
||||
|
||||
var localizationFunctions = function(data) {
|
||||
fc = data;
|
||||
|
@ -108,7 +108,7 @@ define([
|
|||
functions = {},
|
||||
editorLang = SSE.getController("Main").editorConfig.lang;
|
||||
|
||||
editorLang = (editorLang ? editorLang : 'en').split("-")[0].toLowerCase();
|
||||
editorLang = (editorLang ? editorLang : 'en').split(/[\-\_]/)[0].toLowerCase();
|
||||
|
||||
var localizationFunctionsDesc = function (data) {
|
||||
var jsonDesc = {},
|
||||
|
|
|
@ -207,7 +207,7 @@
|
|||
}
|
||||
|
||||
var params = getUrlParams(),
|
||||
lang = (params["lang"] || 'en').split("-")[0],
|
||||
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
|
||||
customer = params["customer"] ? ('<div class="loader-page-text-customer">' + encodeUrlParam(params["customer"]) + '</div>') : '',
|
||||
margin = (customer !== '') ? 50 : 20,
|
||||
loading = 'Loading...',
|
||||
|
|
|
@ -204,7 +204,7 @@
|
|||
}
|
||||
|
||||
var params = getUrlParams(),
|
||||
lang = (params["lang"] || 'en').split("-")[0],
|
||||
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
|
||||
customer = params["customer"] ? ('<div class="loader-page-text-customer">' + encodeUrlParam(params["customer"]) + '</div>') : '',
|
||||
margin = (customer !== '') ? 50 : 20,
|
||||
loading = 'Loading...',
|
||||
|
|
Loading…
Reference in a new issue