Set translations for chars and textarts using api config.

This commit is contained in:
Julia Radzhabova 2017-06-23 16:43:21 +03:00
parent b455ba0a12
commit 443620cdb3
7 changed files with 48 additions and 87 deletions

View file

@ -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() {

View file

@ -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);
}
},

View file

@ -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) {

View file

@ -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);
}
},

View file

@ -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));

View file

@ -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));

View file

@ -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 () {