From 443620cdb3ea1ffe05f6e479e13d6c494e1bb1e0 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 23 Jun 2017 16:43:21 +0300 Subject: [PATCH] Set translations for chars and textarts using api config. --- .../main/app/controller/Main.js | 22 +++++++------------ .../mobile/app/controller/Main.js | 20 +++++++---------- .../main/app/controller/Main.js | 22 +++++++------------ .../mobile/app/controller/Main.js | 20 +++++++---------- .../main/app/controller/Main.js | 22 +++++++------------ .../mobile/app/controller/Main.js | 22 +++++++------------ .../mobile/app/controller/add/AddChart.js | 7 ------ 7 files changed, 48 insertions(+), 87 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index bf86936e0..9d3dd504c 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -123,7 +123,14 @@ define([ window["flat_desine"] = true; this.api = new Asc.asc_docs_api({ - 'id-view' : 'editor_sdk' + 'id-view' : 'editor_sdk', + 'translate': { + 'Series': this.txtSeries, + 'Diagram Title': this.txtDiagramTitle, + 'X Axis': this.txtXAxis, + 'Y Axis': this.txtYAxis, + 'Your text here': this.txtArt + } }); if (this.api){ @@ -1046,19 +1053,6 @@ define([ this.api.asc_registerCallback('asc_onSendThemeColors', _.bind(this.onSendThemeColors, this)); this.api.asc_registerCallback('asc_onDownloadUrl', _.bind(this.onDownloadUrl, this)); - - if (this.api) { - var translateChart = new Asc.asc_CChartTranslate(); - translateChart.asc_setTitle(this.txtDiagramTitle); - translateChart.asc_setXAxis(this.txtXAxis); - translateChart.asc_setYAxis(this.txtYAxis); - translateChart.asc_setSeries(this.txtSeries); - this.api.asc_setChartTranslate(translateChart); - - var translateArt = new Asc.asc_TextArtTranslate(); - translateArt.asc_setDefaultText(this.txtArt); - this.api.asc_setTextArtTranslate(translateArt); - } }, applyModeEditorElements: function() { diff --git a/apps/documenteditor/mobile/app/controller/Main.js b/apps/documenteditor/mobile/app/controller/Main.js index ae16b78ad..08471f948 100644 --- a/apps/documenteditor/mobile/app/controller/Main.js +++ b/apps/documenteditor/mobile/app/controller/Main.js @@ -103,7 +103,14 @@ define([ me.api = new Asc.asc_docs_api({ 'id-view' : 'editor_sdk', - 'mobile' : true + 'mobile' : true, + 'translate': { + 'Series': me.txtSeries, + 'Diagram Title': me.txtDiagramTitle, + 'X Axis': me.txtXAxis, + 'Y Axis': me.txtYAxis, + 'Your text here': me.txtArt + } }); // Localization uiApp params @@ -644,17 +651,6 @@ define([ if (me.api) { me.api.asc_registerCallback('asc_onSendThemeColors', _.bind(me.onSendThemeColors, me)); me.api.asc_registerCallback('asc_onDownloadUrl', _.bind(me.onDownloadUrl, me)); - - var translateChart = new Asc.asc_CChartTranslate(); - translateChart.asc_setTitle(me.txtDiagramTitle); - translateChart.asc_setXAxis(me.txtXAxis); - translateChart.asc_setYAxis(me.txtYAxis); - translateChart.asc_setSeries(me.txtSeries); - me.api.asc_setChartTranslate(translateChart); - - var translateArt = new Asc.asc_TextArtTranslate(); - translateArt.asc_setDefaultText(me.txtArt); - me.api.asc_setTextArtTranslate(translateArt); } }, diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index b06fa82db..79ccfb04b 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -121,7 +121,14 @@ define([ window["flat_desine"] = true; this.api = new Asc.asc_docs_api({ - 'id-view' : 'editor_sdk' + 'id-view' : 'editor_sdk', + 'translate': { + 'Series': this.txtSeries, + 'Diagram Title': this.txtDiagramTitle, + 'X Axis': this.txtXAxis, + 'Y Axis': this.txtYAxis, + 'Your text here': this.txtArt + } }); if (this.api){ @@ -804,19 +811,6 @@ define([ this.api.asc_registerCallback('asc_onSendThemeColors', _.bind(this.onSendThemeColors, this)); this.api.asc_registerCallback('asc_onDownloadUrl', _.bind(this.onDownloadUrl, this)); - - if (this.api) { - var translateChart = new Asc.asc_CChartTranslate(); - translateChart.asc_setTitle(this.txtDiagramTitle); - translateChart.asc_setXAxis(this.txtXAxis); - translateChart.asc_setYAxis(this.txtYAxis); - translateChart.asc_setSeries(this.txtSeries); - this.api.asc_setChartTranslate(translateChart); - - var translateArt = new Asc.asc_TextArtTranslate(); - translateArt.asc_setDefaultText(this.txtArt); - this.api.asc_setTextArtTranslate(translateArt); - } }, applyModeEditorElements: function(prevmode) { diff --git a/apps/presentationeditor/mobile/app/controller/Main.js b/apps/presentationeditor/mobile/app/controller/Main.js index a864c65d9..e1cea021e 100644 --- a/apps/presentationeditor/mobile/app/controller/Main.js +++ b/apps/presentationeditor/mobile/app/controller/Main.js @@ -98,7 +98,14 @@ define([ me.api = new Asc.asc_docs_api({ 'id-view' : 'editor_sdk', - 'mobile' : true + 'mobile' : true, + 'translate': { + 'Series': me.txtSeries, + 'Diagram Title': me.txtDiagramTitle, + 'X Axis': me.txtXAxis, + 'Y Axis': me.txtYAxis, + 'Your text here': me.txtArt + } }); // Localization uiApp params @@ -603,17 +610,6 @@ define([ if (me.api) { me.api.asc_registerCallback('asc_onSendThemeColors', _.bind(me.onSendThemeColors, me)); me.api.asc_registerCallback('asc_onDownloadUrl', _.bind(me.onDownloadUrl, me)); - - var translateChart = new Asc.asc_CChartTranslate(); - translateChart.asc_setTitle(me.txtDiagramTitle); - translateChart.asc_setXAxis(me.txtXAxis); - translateChart.asc_setYAxis(me.txtYAxis); - translateChart.asc_setSeries(me.txtSeries); - me.api.asc_setChartTranslate(translateChart); - - var translateArt = new Asc.asc_TextArtTranslate(); - translateArt.asc_setDefaultText(me.txtArt); - me.api.asc_setTextArtTranslate(translateArt); } }, diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 70127dc20..6b6c88846 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -120,7 +120,14 @@ define([ // Initialize api this.api = new Asc.spreadsheet_api({ 'id-view' : 'editor_sdk', - 'id-input' : 'ce-cell-content' + 'id-input' : 'ce-cell-content', + 'translate': { + 'Series': this.txtSeries, + 'Diagram Title': this.txtDiagramTitle, + 'X Axis': this.txtXAxis, + 'Y Axis': this.txtYAxis, + 'Your text here': this.txtArt + } }); this.api.asc_setFontRenderingMode(parseInt(value)); @@ -851,19 +858,6 @@ define([ },this)); } - if (this.api) { - var translateChart = new Asc.asc_CChartTranslate(); - translateChart.asc_setTitle(this.txtDiagramTitle); - translateChart.asc_setXAxis(this.txtXAxis); - translateChart.asc_setYAxis(this.txtYAxis); - translateChart.asc_setSeries(this.txtSeries); - this.api.asc_setChartTranslate(translateChart); - - var translateArt = new Asc.asc_TextArtTranslate(); - translateArt.asc_setDefaultText(this.txtArt); - this.api.asc_setTextArtTranslate(translateArt); - } - if (!this.appOptions.isEditMailMerge && !this.appOptions.isEditDiagram) { this.api.asc_registerCallback('asc_onSendThemeColors', _.bind(this.onSendThemeColors, this)); this.api.asc_registerCallback('asc_onDownloadUrl', _.bind(this.onDownloadUrl, this)); diff --git a/apps/spreadsheeteditor/mobile/app/controller/Main.js b/apps/spreadsheeteditor/mobile/app/controller/Main.js index baaea94bd..466f3f1b4 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/Main.js +++ b/apps/spreadsheeteditor/mobile/app/controller/Main.js @@ -99,7 +99,14 @@ define([ me.api = new Asc.spreadsheet_api({ 'id-view' : 'editor_sdk', 'id-input' : 'ce-cell-content' - ,'mobile' : true + ,'mobile' : true, + 'translate': { + 'Series': me.txtSeries, + 'Diagram Title': me.txtDiagramTitle, + 'X Axis': me.txtXAxis, + 'Y Axis': me.txtYAxis, + 'Your text here': me.txtArt + } }); // Localization uiApp params @@ -618,19 +625,6 @@ define([ } }); - if (me.api) { - var translateChart = new Asc.asc_CChartTranslate(); - translateChart.asc_setTitle(me.txtDiagramTitle); - translateChart.asc_setXAxis(me.txtXAxis); - translateChart.asc_setYAxis(me.txtYAxis); - translateChart.asc_setSeries(me.txtSeries); - me.api.asc_setChartTranslate(translateChart); - - var translateArt = new Asc.asc_TextArtTranslate(); - translateArt.asc_setDefaultText(me.txtArt); - me.api.asc_setTextArtTranslate(translateArt); - } - if (!me.appOptions.isEditMailMerge && !me.appOptions.isEditDiagram) { me.api.asc_registerCallback('asc_onSendThemeColors', _.bind(me.onSendThemeColors, me)); me.api.asc_registerCallback('asc_onDownloadUrl', _.bind(me.onDownloadUrl, me)); diff --git a/apps/spreadsheeteditor/mobile/app/controller/add/AddChart.js b/apps/spreadsheeteditor/mobile/app/controller/add/AddChart.js index 69d11718b..b4d8a38a9 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/add/AddChart.js +++ b/apps/spreadsheeteditor/mobile/app/controller/add/AddChart.js @@ -67,13 +67,6 @@ define([ setApi: function (api) { this.api = api; - - var translateChart = new Asc.asc_CChartTranslate(); - translateChart.asc_setTitle (this.txtDiagramTitle); - translateChart.asc_setXAxis (this.txtXAxis); - translateChart.asc_setYAxis (this.txtYAxis); - translateChart.asc_setSeries(this.txtSeries); - this.api.asc_setChartTranslate(translateChart); }, onLaunch: function () {