From 13276e3f16830f88c38454188f90a660cda2bbd4 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 31 Jul 2019 13:19:00 +0300 Subject: [PATCH 1/2] [SSE] Bug 41549 --- apps/api/documents/api.js | 1 + apps/spreadsheeteditor/main/app/controller/Main.js | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index 4c0b2b05f..74667b038 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -65,6 +65,7 @@ saveAsUrl: 'folder for saving files' licenseUrl: , customerId: , + region: // can be 'en-us' or lang code user: { id: 'user id', diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 8686c02eb..b66135927 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -308,6 +308,7 @@ define([ this.appOptions.createUrl = this.editorConfig.createUrl; this.appOptions.lang = this.editorConfig.lang; this.appOptions.location = (typeof (this.editorConfig.location) == 'string') ? this.editorConfig.location.toLowerCase() : ''; + this.appOptions.region = (typeof (this.editorConfig.region) == 'string') ? this.editorConfig.region.toLowerCase() : this.editorConfig.region; this.appOptions.canAutosave = false; this.appOptions.canAnalytics = false; this.appOptions.sharingSettingsUrl = this.editorConfig.sharingSettingsUrl; @@ -333,7 +334,13 @@ define([ if (value!==null) this.api.asc_setLocale(parseInt(value)); else { - this.api.asc_setLocale((this.editorConfig.lang) ? parseInt(Common.util.LanguageInfo.getLocalLanguageCode(this.editorConfig.lang)) : 0x0409); + value = this.appOptions.region; + value = Common.util.LanguageInfo.getLanguages().hasOwnProperty(value) ? value : Common.util.LanguageInfo.getLocalLanguageCode(value); + if (value!==null) + value = parseInt(value); + else + value = (this.editorConfig.lang) ? parseInt(Common.util.LanguageInfo.getLocalLanguageCode(this.editorConfig.lang)) : 0x0409; + this.api.asc_setLocale(value); } value = Common.localStorage.getBool("sse-settings-r1c1"); From 25f996ecb7d9dc4055e7782200f83af56e995bf2 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Wed, 31 Jul 2019 14:55:02 +0300 Subject: [PATCH 2/2] [SSE mobile] Bug 41549 --- apps/spreadsheeteditor/mobile/app/controller/Main.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/spreadsheeteditor/mobile/app/controller/Main.js b/apps/spreadsheeteditor/mobile/app/controller/Main.js index 869842c5e..f4d822b31 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/Main.js +++ b/apps/spreadsheeteditor/mobile/app/controller/Main.js @@ -210,6 +210,7 @@ define([ me.appOptions.createUrl = me.editorConfig.createUrl; me.appOptions.lang = me.editorConfig.lang; me.appOptions.location = (typeof (me.editorConfig.location) == 'string') ? me.editorConfig.location.toLowerCase() : ''; + me.appOptions.region = (typeof (me.editorConfig.region) == 'string') ? this.editorConfig.region.toLowerCase() : this.editorConfig.region; me.appOptions.sharingSettingsUrl = me.editorConfig.sharingSettingsUrl; me.appOptions.fileChoiceUrl = me.editorConfig.fileChoiceUrl; me.appOptions.mergeFolderUrl = me.editorConfig.mergeFolderUrl; @@ -225,7 +226,13 @@ define([ if (value!==null) this.api.asc_setLocale(parseInt(value)); else { - this.api.asc_setLocale((this.editorConfig.lang) ? parseInt(Common.util.LanguageInfo.getLocalLanguageCode(this.editorConfig.lang)) : 0x0409); + value = me.appOptions.region; + value = Common.util.LanguageInfo.getLanguages().hasOwnProperty(value) ? value : Common.util.LanguageInfo.getLocalLanguageCode(value); + if (value!==null) + value = parseInt(value); + else + value = (this.editorConfig.lang) ? parseInt(Common.util.LanguageInfo.getLocalLanguageCode(me.editorConfig.lang)) : 0x0409; + this.api.asc_setLocale(value); } if (me.appOptions.location == 'us' || me.appOptions.location == 'ca')