Merge branch 'feature/bug-50956' into develop

This commit is contained in:
Julia Radzhabova 2021-07-17 18:04:41 +03:00
commit b3f4bf0cf8
5 changed files with 21 additions and 37 deletions

View file

@ -151,6 +151,8 @@ define([
onLaunch: function () {
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',
'Statistical', 'Last10'];
@ -164,9 +166,15 @@ define([
},
reloadTranslations: function (lang, suppressEvent) {
var me = this;
lang = (lang || 'en').split(/[\-_]/)[0].toLowerCase();
lang = (lang || 'en').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);
if (me.langJson[lang]) {
me.api.asc_setLocalization(me.langJson[lang]);

View file

@ -947,39 +947,12 @@ define([
dataHintOffset: 'big'
});
var formula_arr = [
{ value: 'en', displayValue: this.txtEn, exampleValue: this.txtExampleEn },
{ value: 'be', displayValue: this.txtBe, exampleValue: this.txtExampleBe },
{ value: 'bg', displayValue: this.txtBg, exampleValue: this.txtExampleEn },
{ value: 'ca', displayValue: this.txtCa, exampleValue: this.txtExampleCa },
{ 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: '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 }
];
var formula_arr = [];
SSE.Collections.formulasLangs.forEach(function(item){
var str = item.replace(/[\-_]/, '');
str = str.charAt(0).toUpperCase() + str.substring(1, str.length);
formula_arr.push({value: item, displayValue: me['txt' + str + 'lang'] || me['txt' + str], exampleValue: me['txtExample' + str] || me.txtExampleEn});
});
formula_arr.sort(function(a, b){
if (a.displayValue < b.displayValue) return -1;
if (a.displayValue > b.displayValue) return 1;
@ -1480,7 +1453,8 @@ define([
txtLv: 'Latvian',
txtLo: 'Lao',
txtNb: 'Norwegian',
txtPtlang: 'Portuguese',
txtPtlang: 'Portuguese (Portugal)',
txtPtbr: 'Portuguese (Brazil)',
txtRo: 'Romanian',
txtSk: 'Slovak',
txtSl: 'Slovenian',
@ -1497,6 +1471,7 @@ define([
txtExampleHu: 'SZUM; MIN; MAX; DARAB',
txtExampleNb: 'SUMMER; MIN; STØRST; ANTALL',
txtExamplePt: 'SOMA; MÍNIMO; MÁXIMO; CONTAR',
txtExamplePtbr: 'SOMA; MÍNIMO; MÁXIMO; CONT.NÚM',
txtExampleSv: 'SUMMA; MIN; MAX; ANTAL',
txtExampleTr: 'TOPLA; MİN; MAK; BAĞ_DEĞ_SAY'

View file

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