[SSE] Fix Bug 50956

This commit is contained in:
Julia Radzhabova 2021-07-17 17:42:57 +03:00
parent 54a3676902
commit 230b553b26
5 changed files with 21 additions and 44 deletions

View file

@ -121,10 +121,7 @@ define([
if (this.formulasGroups && this.api) { if (this.formulasGroups && this.api) {
Common.Utils.InternalSettings.set("sse-settings-func-last", Common.localStorage.getItem("sse-settings-func-last")); Common.Utils.InternalSettings.set("sse-settings-func-last", Common.localStorage.getItem("sse-settings-func-last"));
var deflang = (this.appOptions.lang || 'en').toLowerCase(); this.reloadTranslations(Common.localStorage.getItem("sse-settings-func-locale") || this.appOptions.lang, true);
if (deflang=='pt-br' || deflang=='pt_br')
deflang = 'br';
this.reloadTranslations(Common.localStorage.getItem("sse-settings-func-locale") || deflang, true);
var me = this; var me = this;
@ -154,6 +151,8 @@ define([
onLaunch: function () { onLaunch: function () {
this.formulasGroups = this.getApplication().getCollection('FormulaGroups'); this.formulasGroups = this.getApplication().getCollection('FormulaGroups');
SSE.Collections.formulasLangs = ['en', 'be', 'bg', 'ca', 'zh', 'cs', 'da', 'nl', 'fi', 'fr', 'de', 'el', 'hu', 'id', 'it', 'ja',
'ko', 'lv', 'lo', 'nb', 'pl', 'pt-br', 'pt', 'ro', 'ru', 'sk', 'sl', 'sv', 'es', 'tr', 'uk', 'vi'];
var descriptions = ['Financial', 'Logical', 'TextAndData', 'DateAndTime', 'LookupAndReference', 'Mathematic', 'Cube', 'Database', 'Engineering', 'Information', var descriptions = ['Financial', 'Logical', 'TextAndData', 'DateAndTime', 'LookupAndReference', 'Mathematic', 'Cube', 'Database', 'Engineering', 'Information',
'Statistical', 'Last10']; 'Statistical', 'Last10'];
@ -167,9 +166,15 @@ define([
}, },
reloadTranslations: function (lang, suppressEvent) { reloadTranslations: function (lang, suppressEvent) {
var me = this; lang = (lang || 'en').toLowerCase();
lang = (lang || 'en').split(/[\-_]/)[0].toLowerCase(); var index = _.indexOf(SSE.Collections.formulasLangs, lang);
if (index<0) {
lang = lang.split(/[\-_]/)[0];
index = _.indexOf(SSE.Collections.formulasLangs, lang);
}
lang = (index>=0) ? SSE.Collections.formulasLangs[index] : 'en';
var me = this;
Common.Utils.InternalSettings.set("sse-settings-func-locale", lang); Common.Utils.InternalSettings.set("sse-settings-func-locale", lang);
if (me.langJson[lang]) { if (me.langJson[lang]) {
me.api.asc_setLocalization(me.langJson[lang]); me.api.asc_setLocalization(me.langJson[lang]);

View file

@ -875,40 +875,12 @@ define([
] ]
}); });
var formula_arr = [ var formula_arr = [];
{ value: 'en', displayValue: this.txtEn, exampleValue: this.txtExampleEn }, SSE.Collections.formulasLangs.forEach(function(item){
{ value: 'be', displayValue: this.txtBe, exampleValue: this.txtExampleBe }, var str = item.replace(/[\-_]/, '');
{ value: 'bg', displayValue: this.txtBg, exampleValue: this.txtExampleEn }, str = str.charAt(0).toUpperCase() + str.substring(1, str.length);
{ value: 'ca', displayValue: this.txtCa, exampleValue: this.txtExampleCa }, formula_arr.push({value: item, displayValue: me['txt' + str + 'lang'] || me['txt' + str], exampleValue: me['txtExample' + str] || me.txtExampleEn});
{ value: 'zh', displayValue: this.txtZh, exampleValue: this.txtExampleEn }, });
{ value: 'cs', displayValue: this.txtCs, exampleValue: this.txtExampleCs },
{ value: 'da', displayValue: this.txtDa, exampleValue: this.txtExampleDa },
{ value: 'nl', displayValue: this.txtNl, exampleValue: this.txtExampleNl },
{ value: 'fi', displayValue: this.txtFi, exampleValue: this.txtExampleFi },
{ value: 'fr', displayValue: this.txtFr, exampleValue: this.txtExampleFr },
{ value: 'de', displayValue: this.txtDe, exampleValue: this.txtExampleDe },
{ value: 'el', displayValue: this.txtEl, exampleValue: this.txtExampleEn },
{ value: 'hu', displayValue: this.txtHu, exampleValue: this.txtExampleHu },
{ value: 'id', displayValue: this.txtId, exampleValue: this.txtExampleEn },
{ value: 'it', displayValue: this.txtIt, exampleValue: this.txtExampleIt },
{ value: 'ja', displayValue: this.txtJa, exampleValue: this.txtExampleEn },
{ value: 'ko', displayValue: this.txtKo, exampleValue: this.txtExampleEn },
{ value: 'lv', displayValue: this.txtLv, exampleValue: this.txtExampleEn },
{ value: 'lo', displayValue: this.txtLo, exampleValue: this.txtExampleEn },
{ value: 'nb', displayValue: this.txtNb, exampleValue: this.txtExampleNb },
{ value: 'pl', displayValue: this.txtPl, exampleValue: this.txtExamplePl },
{ value: 'br', displayValue: this.txtBrlang, exampleValue: this.txtExampleBr },
{ value: 'pt', displayValue: this.txtPtlang, exampleValue: this.txtExamplePt },
{ value: 'ro', displayValue: this.txtRo, exampleValue: this.txtExampleEn },
{ value: 'ru', displayValue: this.txtRu, exampleValue: this.txtExampleRu },
{ value: 'sk', displayValue: this.txtSk, exampleValue: this.txtExampleEn },
{ value: 'sl', displayValue: this.txtSl, exampleValue: this.txtExampleEn },
{ value: 'sv', displayValue: this.txtSv, exampleValue: this.txtExampleSv },
{ value: 'es', displayValue: this.txtEs, exampleValue: this.txtExampleEs },
{ value: 'tr', displayValue: this.txtTr, exampleValue: this.txtExampleTr },
{ value: 'uk', displayValue: this.txtUk, exampleValue: this.txtExampleEn },
{ value: 'vi', displayValue: this.txtVi, exampleValue: this.txtExampleEn }
];
formula_arr.sort(function(a, b){ formula_arr.sort(function(a, b){
if (a.displayValue < b.displayValue) return -1; if (a.displayValue < b.displayValue) return -1;
if (a.displayValue > b.displayValue) return 1; if (a.displayValue > b.displayValue) return 1;
@ -1042,7 +1014,7 @@ define([
el : $markup.findById('#fms-cmb-theme'), el : $markup.findById('#fms-cmb-theme'),
style : 'width: 160px;', style : 'width: 160px;',
editable : false, editable : false,
cls : 'input-group-nr', cls : 'input-group-nr'
}); });
$markup.find('.btn.primary').each(function(index, el){ $markup.find('.btn.primary').each(function(index, el){
@ -1389,7 +1361,7 @@ define([
txtLo: 'Lao', txtLo: 'Lao',
txtNb: 'Norwegian', txtNb: 'Norwegian',
txtPtlang: 'Portuguese (Portugal)', txtPtlang: 'Portuguese (Portugal)',
txtBrlang: 'Portuguese (Brazil)', txtPtbr: 'Portuguese (Brazil)',
txtRo: 'Romanian', txtRo: 'Romanian',
txtSk: 'Slovak', txtSk: 'Slovak',
txtSl: 'Slovenian', txtSl: 'Slovenian',
@ -1406,7 +1378,7 @@ define([
txtExampleHu: 'SZUM; MIN; MAX; DARAB', txtExampleHu: 'SZUM; MIN; MAX; DARAB',
txtExampleNb: 'SUMMER; MIN; STØRST; ANTALL', txtExampleNb: 'SUMMER; MIN; STØRST; ANTALL',
txtExamplePt: 'SOMA; MÍNIMO; MÁXIMO; CONTAR', txtExamplePt: 'SOMA; MÍNIMO; MÁXIMO; CONTAR',
txtExampleBr: 'SOMA; MÍNIMO; MÁXIMO; CONT.NÚM', txtExamplePtbr: 'SOMA; MÍNIMO; MÁXIMO; CONT.NÚM',
txtExampleSv: 'SUMMA; MIN; MAX; ANTAL', txtExampleSv: 'SUMMA; MIN; MAX; ANTAL',
txtExampleTr: 'TOPLA; MİN; MAK; BAĞ_DEĞ_SAY' txtExampleTr: 'TOPLA; MİN; MAK; BAĞ_DEĞ_SAY'

View file

@ -2062,7 +2062,7 @@
"SSE.Views.FileMenuPanels.MainSettingsGeneral.txtNl": "Dutch", "SSE.Views.FileMenuPanels.MainSettingsGeneral.txtNl": "Dutch",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.txtPl": "Polish", "SSE.Views.FileMenuPanels.MainSettingsGeneral.txtPl": "Polish",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.txtPt": "Point", "SSE.Views.FileMenuPanels.MainSettingsGeneral.txtPt": "Point",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.txtBrlang": "Portuguese (Brazil)", "SSE.Views.FileMenuPanels.MainSettingsGeneral.txtPtbr": "Portuguese (Brazil)",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.txtPtlang": "Portuguese (Portugal)", "SSE.Views.FileMenuPanels.MainSettingsGeneral.txtPtlang": "Portuguese (Portugal)",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.txtRo": "Romanian", "SSE.Views.FileMenuPanels.MainSettingsGeneral.txtRo": "Romanian",
"SSE.Views.FileMenuPanels.MainSettingsGeneral.txtRu": "Russian", "SSE.Views.FileMenuPanels.MainSettingsGeneral.txtRu": "Russian",