[SSE, SSE mobile] Translate default cell styles.

This commit is contained in:
Julia Radzhabova 2017-06-23 16:52:12 +03:00
parent 7397124998
commit d216378f8c
6 changed files with 152 additions and 14 deletions

View file

@ -102,6 +102,7 @@ define([
onLaunch: function() {
// $(document.body).css('position', 'absolute');
var me = this;
this._state = {isDisconnected: false, usersCount: 1, fastCoauth: true, lostEditingRights: false, licenseWarning: false};
@ -118,16 +119,32 @@ define([
if (value===null) value = window.devicePixelRatio > 1 ? '1' : '3';
// Initialize api
this.api = new Asc.spreadsheet_api({
'id-view' : 'editor_sdk',
'id-input' : 'ce-cell-content',
'translate': {
var styleNames = ['Normal', 'Neutral', 'Bad', 'Good', 'Input', 'Output', 'Calculation', 'Check Cell', 'Explanatory Text', 'Note', 'Linked Cell', 'Warning Text',
'Heading 1', 'Heading 2', 'Heading 3', 'Heading 4', 'Title', 'Total', 'Currency', 'Percent', 'Comma'],
translate = {
'Series': this.txtSeries,
'Diagram Title': this.txtDiagramTitle,
'X Axis': this.txtXAxis,
'Y Axis': this.txtYAxis,
'Your text here': this.txtArt
}
};
styleNames.forEach(function(item){
translate[item] = me['txtStyle_' + item.replace(/ /g, '_')] || item;
});
translate['Currency [0]'] = me.txtStyle_Currency + ' [0]';
translate['Comma [0]'] = me.txtStyle_Comma + ' [0]';
for (var i=1; i<7; i++) {
translate['Accent'+i] = me.txtAccent + i;
translate['20% - Accent'+i] = '20% - ' + me.txtAccent + i;
translate['40% - Accent'+i] = '40% - ' + me.txtAccent + i;
translate['60% - Accent'+i] = '60% - ' + me.txtAccent + i;
}
this.api = new Asc.spreadsheet_api({
'id-view' : 'editor_sdk',
'id-input' : 'ce-cell-content',
'translate': translate
});
this.api.asc_setFontRenderingMode(parseInt(value));
@ -166,7 +183,6 @@ define([
this.getApplication().getController('Viewport').setApi(this.api);
var me = this;
// Syncronize focus with api
$(document.body).on('focus', 'input, textarea:not(#ce-cell-content)', function(e) {
if (me.isAppDisabled === true) return;
@ -2094,7 +2110,29 @@ define([
errorSessionToken: 'The connection to the server has been interrupted. Please reload the page.',
errorAccessDeny: 'You are trying to perform an action you do not have rights for.<br>Please contact your Document Server administrator.',
titleServerVersion: 'Editor updated',
errorServerVersion: 'The editor version has been updated. The page will be reloaded to apply the changes.'
errorServerVersion: 'The editor version has been updated. The page will be reloaded to apply the changes.',
txtAccent: 'Accent',
txtStyle_Normal: 'Normal',
txtStyle_Heading_1: 'Heading 1',
txtStyle_Heading_2: 'Heading 2',
txtStyle_Heading_3: 'Heading 3',
txtStyle_Heading_4: 'Heading 4',
txtStyle_Title: 'Title',
txtStyle_Neutral: 'Neutral',
txtStyle_Bad: 'Bad',
txtStyle_Good: 'Good',
txtStyle_Input: 'Input',
txtStyle_Output: 'Output',
txtStyle_Calculation: 'Calculation',
txtStyle_Check_Cell: 'Check Cell',
txtStyle_Explanatory_Text: 'Explanatory Text',
txtStyle_Note: 'Note',
txtStyle_Linked_Cell: 'Linked Cell',
txtStyle_Warning_Text: 'Warning Text',
txtStyle_Total: 'Total',
txtStyle_Currency: 'Currency',
txtStyle_Percent: 'Percent',
txtStyle_Comma: 'Comma'
}
})(), SSE.Controllers.Main || {}))
});

View file

@ -364,6 +364,28 @@
"SSE.Controllers.Main.warnLicenseExp": "Your license has expired.<br>Please update your license and refresh the page.",
"SSE.Controllers.Main.warnNoLicense": "You are using an open source version of ONLYOFFICE. The version has limitations for concurrent connections to the document server (20 connections at a time).<br>If you need more please consider purchasing a commercial license.",
"SSE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
"SSE.Controllers.Main.txtAccent": "Accent",
"SSE.Controllers.Main.txtStyle_Normal": "Normal",
"SSE.Controllers.Main.txtStyle_Heading_1": "Heading 1",
"SSE.Controllers.Main.txtStyle_Heading_2": "Heading 2",
"SSE.Controllers.Main.txtStyle_Heading_3": "Heading 3",
"SSE.Controllers.Main.txtStyle_Heading_4": "Heading 4",
"SSE.Controllers.Main.txtStyle_Title": "Title",
"SSE.Controllers.Main.txtStyle_Neutral": "Neutral",
"SSE.Controllers.Main.txtStyle_Bad": "Bad",
"SSE.Controllers.Main.txtStyle_Good": "Good",
"SSE.Controllers.Main.txtStyle_Input": "Input",
"SSE.Controllers.Main.txtStyle_Output": "Output",
"SSE.Controllers.Main.txtStyle_Calculation": "Calculation",
"SSE.Controllers.Main.txtStyle_Check_Cell": "Check Cell",
"SSE.Controllers.Main.txtStyle_Explanatory_Text": "Explanatory Text",
"SSE.Controllers.Main.txtStyle_Note": "Note",
"SSE.Controllers.Main.txtStyle_Linked_Cell": "Linked Cell",
"SSE.Controllers.Main.txtStyle_Warning_Text": "Warning Text",
"SSE.Controllers.Main.txtStyle_Total": "Total",
"SSE.Controllers.Main.txtStyle_Currency": "Currency",
"SSE.Controllers.Main.txtStyle_Percent": "Percent",
"SSE.Controllers.Main.txtStyle_Comma": "Comma",
"SSE.Controllers.Print.strAllSheets": "All Sheets",
"SSE.Controllers.Print.textWarning": "Warning",
"SSE.Controllers.Print.warnCheckMargings": "Margins are incorrect",

View file

@ -357,6 +357,15 @@
"SSE.Controllers.Main.warnLicenseExp": "Истек срок действия лицензии.<br>Обновите лицензию, а затем обновите страницу.",
"SSE.Controllers.Main.warnNoLicense": "Вы используете open source версию ONLYOFFICE. Эта версия имеет ограничения по количеству одновременных подключений к серверу документов (20 подключений одновременно).<br>Если требуется больше, рассмотрите вопрос о покупке коммерческой лицензии.",
"SSE.Controllers.Main.warnProcessRightsChange": "Вам было отказано в праве на редактирование этого файла.",
"SSE.Controllers.Main.txtAccent": "Акцент",
"SSE.Controllers.Main.txtStyle_Normal": "Обычный",
"SSE.Controllers.Main.txtStyle_Heading_1": "Заголовок 1",
"SSE.Controllers.Main.txtStyle_Heading_2": "Заголовок 2",
"SSE.Controllers.Main.txtStyle_Heading_3": "Заголовок 3",
"SSE.Controllers.Main.txtStyle_Heading_4": "Заголовок 4",
"SSE.Controllers.Main.txtStyle_Currency": "Денежный",
"SSE.Controllers.Main.txtStyle_Percent": "Процентный",
"SSE.Controllers.Main.txtStyle_Comma": "Финансовый",
"SSE.Controllers.Print.strAllSheets": "Все листы",
"SSE.Controllers.Print.textWarning": "Предупреждение",
"SSE.Controllers.Print.warnCheckMargings": "Неправильные поля",

View file

@ -96,17 +96,33 @@ define([
// window["flat_desine"] = true;
me.api = new Asc.spreadsheet_api({
'id-view' : 'editor_sdk',
'id-input' : 'ce-cell-content'
,'mobile' : true,
'translate': {
var styleNames = ['Normal', 'Neutral', 'Bad', 'Good', 'Input', 'Output', 'Calculation', 'Check Cell', 'Explanatory Text', 'Note', 'Linked Cell', 'Warning Text',
'Heading 1', 'Heading 2', 'Heading 3', 'Heading 4', 'Title', 'Total', 'Currency', 'Percent', 'Comma'],
translate = {
'Series': me.txtSeries,
'Diagram Title': me.txtDiagramTitle,
'X Axis': me.txtXAxis,
'Y Axis': me.txtYAxis,
'Your text here': me.txtArt
}
};
styleNames.forEach(function(item){
translate[item] = me['txtStyle_' + item.replace(/ /g, '_')] || item;
});
translate['Currency [0]'] = me.txtStyle_Currency + ' [0]';
translate['Comma [0]'] = me.txtStyle_Comma + ' [0]';
for (var i=1; i<7; i++) {
translate['Accent'+i] = me.txtAccent + i;
translate['20% - Accent'+i] = '20% - ' + me.txtAccent + i;
translate['40% - Accent'+i] = '40% - ' + me.txtAccent + i;
translate['60% - Accent'+i] = '60% - ' + me.txtAccent + i;
}
me.api = new Asc.spreadsheet_api({
'id-view' : 'editor_sdk',
'id-input' : 'ce-cell-content'
,'mobile' : true,
'translate': translate
});
// Localization uiApp params
@ -1358,7 +1374,29 @@ define([
textClose: 'Close',
textDone: 'Done',
titleServerVersion: 'Editor updated',
errorServerVersion: 'The editor version has been updated. The page will be reloaded to apply the changes.'
errorServerVersion: 'The editor version has been updated. The page will be reloaded to apply the changes.',
txtAccent: 'Accent',
txtStyle_Normal: 'Normal',
txtStyle_Heading_1: 'Heading 1',
txtStyle_Heading_2: 'Heading 2',
txtStyle_Heading_3: 'Heading 3',
txtStyle_Heading_4: 'Heading 4',
txtStyle_Title: 'Title',
txtStyle_Neutral: 'Neutral',
txtStyle_Bad: 'Bad',
txtStyle_Good: 'Good',
txtStyle_Input: 'Input',
txtStyle_Output: 'Output',
txtStyle_Calculation: 'Calculation',
txtStyle_Check_Cell: 'Check Cell',
txtStyle_Explanatory_Text: 'Explanatory Text',
txtStyle_Note: 'Note',
txtStyle_Linked_Cell: 'Linked Cell',
txtStyle_Warning_Text: 'Warning Text',
txtStyle_Total: 'Total',
txtStyle_Currency: 'Currency',
txtStyle_Percent: 'Percent',
txtStyle_Comma: 'Comma'
}
})(), SSE.Controllers.Main || {}))
});

View file

@ -235,6 +235,28 @@
"SSE.Controllers.Main.warnLicenseExp": "Your license has expired.<br>Please update your license and refresh the page.",
"SSE.Controllers.Main.warnNoLicense": "You are using an open source version of ONLYOFFICE. The version has limitations for concurrent connections to the document server (20 connections at a time).<br>If you need more please consider purchasing a commercial license.",
"SSE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
"SSE.Controllers.Main.txtAccent": "Accent",
"SSE.Controllers.Main.txtStyle_Normal": "Normal",
"SSE.Controllers.Main.txtStyle_Heading_1": "Heading 1",
"SSE.Controllers.Main.txtStyle_Heading_2": "Heading 2",
"SSE.Controllers.Main.txtStyle_Heading_3": "Heading 3",
"SSE.Controllers.Main.txtStyle_Heading_4": "Heading 4",
"SSE.Controllers.Main.txtStyle_Title": "Title",
"SSE.Controllers.Main.txtStyle_Neutral": "Neutral",
"SSE.Controllers.Main.txtStyle_Bad": "Bad",
"SSE.Controllers.Main.txtStyle_Good": "Good",
"SSE.Controllers.Main.txtStyle_Input": "Input",
"SSE.Controllers.Main.txtStyle_Output": "Output",
"SSE.Controllers.Main.txtStyle_Calculation": "Calculation",
"SSE.Controllers.Main.txtStyle_Check_Cell": "Check Cell",
"SSE.Controllers.Main.txtStyle_Explanatory_Text": "Explanatory Text",
"SSE.Controllers.Main.txtStyle_Note": "Note",
"SSE.Controllers.Main.txtStyle_Linked_Cell": "Linked Cell",
"SSE.Controllers.Main.txtStyle_Warning_Text": "Warning Text",
"SSE.Controllers.Main.txtStyle_Total": "Total",
"SSE.Controllers.Main.txtStyle_Currency": "Currency",
"SSE.Controllers.Main.txtStyle_Percent": "Percent",
"SSE.Controllers.Main.txtStyle_Comma": "Comma",
"SSE.Controllers.Search.textNoTextFound": "Text not found",
"SSE.Controllers.Search.textReplaceAll": "Replace All",
"SSE.Controllers.Settings.notcriticalErrorTitle": "Warning",

View file

@ -235,6 +235,15 @@
"SSE.Controllers.Main.warnLicenseExp": "Истек срок действия лицензии.<br>Обновите лицензию, а затем обновите страницу.",
"SSE.Controllers.Main.warnNoLicense": "Вы используете open source версию ONLYOFFICE. Эта версия имеет ограничения по количеству одновременных подключений к серверу документов (20 подключений одновременно).<br>Если требуется больше, рассмотрите вопрос о покупке коммерческой лицензии.",
"SSE.Controllers.Main.warnProcessRightsChange": "Вам было отказано в праве на редактирование этого файла.",
"SSE.Controllers.Main.txtAccent": "Акцент",
"SSE.Controllers.Main.txtStyle_Normal": "Обычный",
"SSE.Controllers.Main.txtStyle_Heading_1": "Заголовок 1",
"SSE.Controllers.Main.txtStyle_Heading_2": "Заголовок 2",
"SSE.Controllers.Main.txtStyle_Heading_3": "Заголовок 3",
"SSE.Controllers.Main.txtStyle_Heading_4": "Заголовок 4",
"SSE.Controllers.Main.txtStyle_Currency": "Денежный",
"SSE.Controllers.Main.txtStyle_Percent": "Процентный",
"SSE.Controllers.Main.txtStyle_Comma": "Финансовый",
"SSE.Controllers.Search.textNoTextFound": "Текст не найден",
"SSE.Controllers.Search.textReplaceAll": "Заменить все",
"SSE.Controllers.Settings.notcriticalErrorTitle": "Внимание",