Commit 9987201c authored by Julia Radzhabova's avatar Julia Radzhabova

Set translations for chars and textarts using api config.

parent 2d8d3291
......@@ -122,7 +122,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){
......@@ -1055,19 +1062,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() {
......
......@@ -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
......@@ -647,17 +654,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);
}
},
......
......@@ -120,7 +120,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){
......@@ -813,19 +820,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) {
......
......@@ -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
......@@ -604,17 +611,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);
}
},
......
......@@ -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));
......@@ -848,19 +855,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));
......
......@@ -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));
......
......@@ -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 () {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment