diff --git a/apps/spreadsheeteditor/mobile/locale/en.json b/apps/spreadsheeteditor/mobile/locale/en.json
index 643e332286..c89f7a83e1 100644
--- a/apps/spreadsheeteditor/mobile/locale/en.json
+++ b/apps/spreadsheeteditor/mobile/locale/en.json
@@ -714,7 +714,60 @@
"txtSemicolon": "Semicolon",
"txtSpace": "Space",
"txtTab": "Tab",
- "warnDownloadAs": "If you continue saving in this format all features except the text will be lost.
Are you sure you want to continue?"
+ "warnDownloadAs": "If you continue saving in this format all features except the text will be lost.
Are you sure you want to continue?",
+ "txtEn": "English",
+ "txtDe": "Deutsch",
+ "txtRu": "Russian",
+ "txtPl": "Polish",
+ "txtEs": "Spanish",
+ "txtFr": "French",
+ "txtIt": "Italian",
+ "txtBe": "Belarusian",
+ "txtBg": "Bulgarian",
+ "txtCa": "Catalan",
+ "txtZh": "Chinese",
+ "txtCs": "Czech",
+ "txtDa": "Danish",
+ "txtNl": "Dutch",
+ "txtFi": "Finnish",
+ "txtEl": "Greek",
+ "txtHu": "Hungarian",
+ "txtId": "Indonesian",
+ "txtJa": "Japanese",
+ "txtKo": "Korean",
+ "txtLv": "Latvian",
+ "txtLo": "Lao",
+ "txtNb": "Norwegian",
+ "txtPtlang": "Portuguese (Portugal)",
+ "txtPtbr": "Portuguese (Brazil)",
+ "txtRo": "Romanian",
+ "txtSk": "Slovak",
+ "txtSl": "Slovenian",
+ "txtSv": "Swedish",
+ "txtTr": "Turkish",
+ "txtUk": "Ukrainian",
+ "txtVi": "Vietnamese",
+ "txtExampleEn": "SUM; MIN; MAX; COUNT",
+ "txtExampleDe": "SUMME; MIN; MAX; ANZAHL",
+ "txtExampleRu": "СУММ; МИН; МАКС; СЧЁТ",
+ "txtExamplePl": "SUMA; MIN; MAX; ILE.LICZB",
+ "txtExampleEs": "SUMA; MIN; MAX; CALCULAR",
+ "txtExampleFr": "SOMME; MIN; MAX; NB",
+ "txtExampleIt": "SOMMA; MIN; MAX; CONTA.NUMERI",
+ "strFuncLocale": "Formula Language",
+ "strFuncLocaleEx": "Example: SUM; MIN; MAX; COUNT",
+ "txtExampleBe": "СУММ; МИН; МАКС; СЧЁТ",
+ "txtExampleCa": "SUMA; MIN; MAX; COMPT",
+ "txtExampleCs": "SUMA; MIN; MAX; POČET",
+ "txtExampleDa": "SUM; MIN; MAKS; TÆL",
+ "txtExampleNl": "SOM; MIN; MAX; AANTAL",
+ "txtExampleFi": "SUMMA; MIN; MAKS; LASKE",
+ "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"
}
}
}
\ No newline at end of file
diff --git a/apps/spreadsheeteditor/mobile/src/controller/Main.jsx b/apps/spreadsheeteditor/mobile/src/controller/Main.jsx
index f7fd8cf158..eacaaae511 100644
--- a/apps/spreadsheeteditor/mobile/src/controller/Main.jsx
+++ b/apps/spreadsheeteditor/mobile/src/controller/Main.jsx
@@ -517,17 +517,19 @@ class MainController extends Component {
}
});
- this.api.asc_registerCallback('asc_onNeedUpdateExternalReferenceOnOpen', this.onNeedUpdateExternalReference);
+ this.api.asc_registerCallback('asc_onNeedUpdateExternalReferenceOnOpen', this.onNeedUpdateExternalReference.bind(this));
const storeAppOptions = this.props.storeAppOptions;
this.api.asc_setFilteringMode && this.api.asc_setFilteringMode(storeAppOptions.canModifyFilter);
}
onNeedUpdateExternalReference() {
+ const { t } = this.props;
+
f7.dialog.create({
title: t('Controller.Main.notcriticalErrorTitle'),
text: t('Controller.Main.textWarnUpdateExternalData'),
- button: [
+ buttons: [
{
text: t('Controller.Main.textUpdate'),
onClick: () => {
diff --git a/apps/spreadsheeteditor/mobile/src/controller/settings/ApplicationSettings.jsx b/apps/spreadsheeteditor/mobile/src/controller/settings/ApplicationSettings.jsx
index 049a1142e3..8db569867f 100644
--- a/apps/spreadsheeteditor/mobile/src/controller/settings/ApplicationSettings.jsx
+++ b/apps/spreadsheeteditor/mobile/src/controller/settings/ApplicationSettings.jsx
@@ -2,6 +2,7 @@ import React, { Component } from "react";
import { ApplicationSettings } from "../../view/settings/ApplicationSettings";
import {observer, inject} from "mobx-react";
import { LocalStorage } from '../../../../../common/mobile/utils/LocalStorage.mjs';
+import { withTranslation } from 'react-i18next';
import {FunctionGroups} from '../../controller/add/AddFunction';
class ApplicationSettingsController extends Component {
@@ -11,9 +12,36 @@ class ApplicationSettingsController extends Component {
this.onChangeDisplayComments = this.onChangeDisplayComments.bind(this);
this.onRegSettings = this.onRegSettings.bind(this);
this.initRegSettings = this.initRegSettings.bind(this);
+ this.initFormulaLangsCollection = this.initFormulaLangsCollection.bind(this);
+
this.props.storeApplicationSettings.initRegData();
this.initRegSettings();
this.props.storeApplicationSettings.changeUnitMeasurement(Common.Utils.Metric.getCurrentMetric());
+ this.props.storeApplicationSettings.setFormulaLangsCollection(this.initFormulaLangsCollection());
+ }
+
+ initFormulaLangsCollection() {
+ const { t } = this.props;
+ const _t = t("View.Settings", { returnObjects: true });
+ const storeApplicationSettings = this.props.storeApplicationSettings;
+ const formulaLangs = storeApplicationSettings.formulaLangs;
+ const formulaLangsCollection = formulaLangs.map(lang => {
+ let str = lang.replace(/[\-_]/, '');
+ str = str.charAt(0).toUpperCase() + str.substring(1, str.length);
+
+ return {
+ value: lang,
+ displayValue: _t[`txt${str}lang`] ? t(`View.Settings.txt${str}lang`) : t(`View.Settings.txt${str}`), exampleValue: _t[`txtExample${str}`] ? t(`View.Settings.txtExample${str}`) : t('View.Settings.txtExampleEn')
+ }
+ });
+
+ formulaLangsCollection.sort(function(a, b){
+ if (a.displayValue < b.displayValue) return -1;
+ if (a.displayValue > b.displayValue) return 1;
+ return 0;
+ });
+
+ return formulaLangsCollection;
}
initRegSettings() {
@@ -111,4 +139,4 @@ class ApplicationSettingsController extends Component {
}
-export default inject("storeApplicationSettings", "storeAppOptions")(observer(ApplicationSettingsController));
\ No newline at end of file
+export default inject("storeApplicationSettings", "storeAppOptions")(observer(withTranslation()(ApplicationSettingsController)));
\ No newline at end of file
diff --git a/apps/spreadsheeteditor/mobile/src/store/applicationSettings.js b/apps/spreadsheeteditor/mobile/src/store/applicationSettings.js
index 2725581669..61945b0867 100644
--- a/apps/spreadsheeteditor/mobile/src/store/applicationSettings.js
+++ b/apps/spreadsheeteditor/mobile/src/store/applicationSettings.js
@@ -26,7 +26,9 @@ export class storeApplicationSettings {
changeRefStyle: action,
changeFormulaLang: action,
directionMode: observable,
- changeDirectionMode: action
+ changeDirectionMode: action,
+ formulaLangsColection: observable,
+ setFormulaLangsCollection: action
});
}
@@ -34,30 +36,22 @@ export class storeApplicationSettings {
unitMeasurement = Common.Utils.Metric.getCurrentMetric();
macrosMode = 0;
macrosRequest = 0;
- formulaLang = LocalStorage.getItem('sse-settings-func-lang') || this.getFormulaLanguages()[0].value;
+ formulaLang = LocalStorage.getItem('sse-settings-func-lang') || 'en';
regCode = undefined;
regExample = '';
regData = [];
isRefStyle = false;
isComments = true;
isResolvedComments = true;
+ formulaLangs = ['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'];
+ formulaLangsColection = [];
changeDirectionMode(value) {
this.directionMode = value;
}
- getFormulaLanguages() {
- const dataLang = [
- { value: 'en', displayValue: 'English', exampleValue: ' SUM; MIN; MAX; COUNT' },
- { value: 'de', displayValue: 'Deutsch', exampleValue: ' SUMME; MIN; MAX; ANZAHL' },
- { value: 'es', displayValue: 'Spanish', exampleValue: ' SUMA; MIN; MAX; CALCULAR' },
- { value: 'fr', displayValue: 'French', exampleValue: ' SOMME; MIN; MAX; NB' },
- { value: 'it', displayValue: 'Italian', exampleValue: ' SOMMA; MIN; MAX; CONTA.NUMERI' },
- { value: 'ru', displayValue: 'Russian', exampleValue: ' СУММ; МИН; МАКС; СЧЁТ' },
- { value: 'pl', displayValue: 'Polish', exampleValue: ' SUMA; MIN; MAX; ILE.LICZB' }
- ]
-
- return dataLang;
+ setFormulaLangsCollection(arr) {
+ this.formulaLangsColection = arr;
}
getRegDataCodes() {
diff --git a/apps/spreadsheeteditor/mobile/src/view/settings/ApplicationSettings.jsx b/apps/spreadsheeteditor/mobile/src/view/settings/ApplicationSettings.jsx
index bb20c58977..58e1ef23a7 100644
--- a/apps/spreadsheeteditor/mobile/src/view/settings/ApplicationSettings.jsx
+++ b/apps/spreadsheeteditor/mobile/src/view/settings/ApplicationSettings.jsx
@@ -13,8 +13,8 @@ const PageApplicationSettings = props => {
const regData = storeApplicationSettings.regData;
const regCode = storeApplicationSettings.regCode;
const regExample = storeApplicationSettings.regExample;
- const dataLang = storeApplicationSettings.getFormulaLanguages();
- const defineFormulaLang = () => dataLang.find(obj => obj.value === formulaLang);
+ const formulaLangsColection = storeApplicationSettings.formulaLangsColection;
+ const defineFormulaLang = () => formulaLangsColection.find(obj => obj.value === formulaLang);
const currentFormulaLang = defineFormulaLang();
const defineRegSetting = () => regData.find(obj => regCode === obj.code);
const currentRegSetting = defineRegSetting();
@@ -178,14 +178,14 @@ const PageFormulaLanguage = props => {
const { t } = useTranslation();
const _t = t("View.Settings", { returnObjects: true });
const storeApplicationSettings = props.storeApplicationSettings;
+ const formulaLangsColection = storeApplicationSettings.formulaLangsColection;
const formulaLang = storeApplicationSettings.formulaLang;
- const dataLang = storeApplicationSettings.getFormulaLanguages();
return (
- {dataLang.map((elem, index) => {
+ {formulaLangsColection.map((elem, index) => {
return (
{