Commit 186b7b59 authored by Julia Radzhabova's avatar Julia Radzhabova

[DE] Translate default paragraph styles.

parent 9987201c
...@@ -106,6 +106,7 @@ define([ ...@@ -106,6 +106,7 @@ define([
this._state = {isDisconnected: false, usersCount: 1, fastCoauth: true, lostEditingRights: false, licenseWarning: false}; this._state = {isDisconnected: false, usersCount: 1, fastCoauth: true, lostEditingRights: false, licenseWarning: false};
this.languages = null; this.languages = null;
this.translationTable = [];
// Initialize viewport // Initialize viewport
if (!Common.Utils.isBrowserSupported()){ if (!Common.Utils.isBrowserSupported()){
...@@ -121,15 +122,26 @@ define([ ...@@ -121,15 +122,26 @@ define([
// Initialize api // Initialize api
window["flat_desine"] = true; window["flat_desine"] = true;
this.api = new Asc.asc_docs_api({
'id-view' : 'editor_sdk', var styleNames = ['Normal', 'No Spacing', 'Heading 1', 'Heading 2', 'Heading 3', 'Heading 4', 'Heading 5',
'translate': { 'Heading 6', 'Heading 7', 'Heading 8', 'Heading 9', 'Title', 'Subtitle',
'Quote', 'Intense Quote', 'List Paragraph'],
translate = {
'Series': this.txtSeries, 'Series': this.txtSeries,
'Diagram Title': this.txtDiagramTitle, 'Diagram Title': this.txtDiagramTitle,
'X Axis': this.txtXAxis, 'X Axis': this.txtXAxis,
'Y Axis': this.txtYAxis, 'Y Axis': this.txtYAxis,
'Your text here': this.txtArt 'Your text here': this.txtArt
} };
styleNames.forEach(function(item){
var translate_name = 'txtStyle_' + item.replace(/ /g, '_');
me.translationTable[item] = me[translate_name] || item;
translate[item] = me.translationTable[item];
});
this.api = new Asc.asc_docs_api({
'id-view' : 'editor_sdk',
'translate': translate
}); });
if (this.api){ if (this.api){
...@@ -2144,7 +2156,23 @@ define([ ...@@ -2144,7 +2156,23 @@ define([
titleServerVersion: 'Editor updated', 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.',
textChangesSaved: 'All changes saved', textChangesSaved: 'All changes saved',
errorBadImageUrl: 'Image url is incorrect' errorBadImageUrl: 'Image url is incorrect',
txtStyle_Normal: 'Normal',
txtStyle_No_Spacing: 'No Spacing',
txtStyle_Heading_1: 'Heading 1',
txtStyle_Heading_2: 'Heading 2',
txtStyle_Heading_3: 'Heading 3',
txtStyle_Heading_4: 'Heading 4',
txtStyle_Heading_5: 'Heading 5',
txtStyle_Heading_6: 'Heading 6',
txtStyle_Heading_7: 'Heading 7',
txtStyle_Heading_8: 'Heading 8',
txtStyle_Heading_9: 'Heading 9',
txtStyle_Title: 'Title',
txtStyle_Subtitle: 'Subtitle',
txtStyle_Quote: 'Quote',
txtStyle_Intense_Quote: 'Intense Quote',
txtStyle_List_Paragraph: 'List Paragraph'
} }
})(), DE.Controllers.Main || {})) })(), DE.Controllers.Main || {}))
}); });
...@@ -1902,9 +1902,10 @@ define([ ...@@ -1902,9 +1902,10 @@ define([
Common.NotificationCenter.trigger('edit:complete', me.toolbar); Common.NotificationCenter.trigger('edit:complete', me.toolbar);
}; };
var formats = []; var formats = [],
mainController = me.getApplication().getController('Main');
_.each(window.styles.get_MergedStyles(), function (style) { _.each(window.styles.get_MergedStyles(), function (style) {
formats.push({value: style, displayValue: style.get_Name()}) formats.push({value: style, displayValue: mainController.translationTable[style.get_Name()] || style.get_Name()})
}); });
win = new DE.Views.StyleTitleDialog({ win = new DE.Views.StyleTitleDialog({
...@@ -2620,11 +2621,12 @@ define([ ...@@ -2620,11 +2621,12 @@ define([
listStyles.menuPicker.store.reset([]); // remove all listStyles.menuPicker.store.reset([]); // remove all
var mainController = this.getApplication().getController('Main');
_.each(styles.get_MergedStyles(), function(style){ _.each(styles.get_MergedStyles(), function(style){
listStyles.menuPicker.store.add({ listStyles.menuPicker.store.add({
imageUrl: style.asc_getImage(), imageUrl: style.asc_getImage(),
title : style.get_Name(), title : style.get_Name(),
tip : style.get_Name(), tip : mainController.translationTable[style.get_Name()] || style.get_Name(),
id : Common.UI.getId() id : Common.UI.getId()
}); });
}); });
......
...@@ -1587,10 +1587,6 @@ define([ ...@@ -1587,10 +1587,6 @@ define([
onApiParagraphStyleChange: function(name) { onApiParagraphStyleChange: function(name) {
window.currentStyleName = name; window.currentStyleName = name;
var menuStyleUpdate = this.menuStyleUpdate;
if (menuStyleUpdate != undefined) {
menuStyleUpdate.setCaption(this.updateStyleText.replace('%1', window.currentStyleName));
}
}, },
_applyTableWrap: function(wrap, align){ _applyTableWrap: function(wrap, align){
...@@ -3173,6 +3169,9 @@ define([ ...@@ -3173,6 +3169,9 @@ define([
menuStyleSeparator.setVisible(me.mode.canEditStyles && !isInChart); menuStyleSeparator.setVisible(me.mode.canEditStyles && !isInChart);
menuStyle.setVisible(me.mode.canEditStyles && !isInChart); menuStyle.setVisible(me.mode.canEditStyles && !isInChart);
if (me.mode.canEditStyles && !isInChart) {
me.menuStyleUpdate.setCaption(me.updateStyleText.replace('%1', DE.getController('Main').translationTable[window.currentStyleName] || window.currentStyleName));
}
}, },
items: [ items: [
me.menuSpellPara, me.menuSpellPara,
......
...@@ -305,6 +305,22 @@ ...@@ -305,6 +305,22 @@
"DE.Controllers.Main.warnLicenseExp": "Your license has expired.<br>Please update your license and refresh the page.", "DE.Controllers.Main.warnLicenseExp": "Your license has expired.<br>Please update your license and refresh the page.",
"DE.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.", "DE.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.",
"DE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.", "DE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
"DE.Controllers.Main.txtStyle_Normal": "Normal",
"DE.Controllers.Main.txtStyle_No_Spacing": "No Spacing",
"DE.Controllers.Main.txtStyle_Heading_1": "Heading 1",
"DE.Controllers.Main.txtStyle_Heading_2": "Heading 2",
"DE.Controllers.Main.txtStyle_Heading_3": "Heading 3",
"DE.Controllers.Main.txtStyle_Heading_4": "Heading 4",
"DE.Controllers.Main.txtStyle_Heading_5": "Heading 5",
"DE.Controllers.Main.txtStyle_Heading_6": "Heading 6",
"DE.Controllers.Main.txtStyle_Heading_7": "Heading 7",
"DE.Controllers.Main.txtStyle_Heading_8": "Heading 8",
"DE.Controllers.Main.txtStyle_Heading_9": "Heading 9",
"DE.Controllers.Main.txtStyle_Title": "Title",
"DE.Controllers.Main.txtStyle_Subtitle": "Subtitle",
"DE.Controllers.Main.txtStyle_Quote": "Quote",
"DE.Controllers.Main.txtStyle_Intense_Quote": "Intense Quote",
"DE.Controllers.Main.txtStyle_List_Paragraph": "List Paragraph",
"DE.Controllers.Statusbar.textHasChanges": "New changes have been tracked", "DE.Controllers.Statusbar.textHasChanges": "New changes have been tracked",
"DE.Controllers.Statusbar.textTrackChanges": "The document is opened with the Track Changes mode enabled", "DE.Controllers.Statusbar.textTrackChanges": "The document is opened with the Track Changes mode enabled",
"DE.Controllers.Statusbar.zoomText": "Zoom {0}%", "DE.Controllers.Statusbar.zoomText": "Zoom {0}%",
......
...@@ -305,6 +305,22 @@ ...@@ -305,6 +305,22 @@
"DE.Controllers.Main.warnLicenseExp": "Истек срок действия лицензии.<br>Обновите лицензию, а затем обновите страницу.", "DE.Controllers.Main.warnLicenseExp": "Истек срок действия лицензии.<br>Обновите лицензию, а затем обновите страницу.",
"DE.Controllers.Main.warnNoLicense": "Вы используете open source версию ONLYOFFICE. Эта версия имеет ограничения по количеству одновременных подключений к серверу документов (20 подключений одновременно).<br>Если требуется больше, рассмотрите вопрос о покупке коммерческой лицензии.", "DE.Controllers.Main.warnNoLicense": "Вы используете open source версию ONLYOFFICE. Эта версия имеет ограничения по количеству одновременных подключений к серверу документов (20 подключений одновременно).<br>Если требуется больше, рассмотрите вопрос о покупке коммерческой лицензии.",
"DE.Controllers.Main.warnProcessRightsChange": "Вам было отказано в праве на редактирование этого файла.", "DE.Controllers.Main.warnProcessRightsChange": "Вам было отказано в праве на редактирование этого файла.",
"DE.Controllers.Main.txtStyle_Normal": "Обычный",
"DE.Controllers.Main.txtStyle_No_Spacing": "Без интервала",
"DE.Controllers.Main.txtStyle_Heading_1": "Заголовок 1",
"DE.Controllers.Main.txtStyle_Heading_2": "Заголовок 2",
"DE.Controllers.Main.txtStyle_Heading_3": "Заголовок 3",
"DE.Controllers.Main.txtStyle_Heading_4": "Заголовок 4",
"DE.Controllers.Main.txtStyle_Heading_5": "Заголовок 5",
"DE.Controllers.Main.txtStyle_Heading_6": "Заголовок 6",
"DE.Controllers.Main.txtStyle_Heading_7": "Заголовок 7",
"DE.Controllers.Main.txtStyle_Heading_8": "Заголовок 8",
"DE.Controllers.Main.txtStyle_Heading_9": "Заголовок 9",
"DE.Controllers.Main.txtStyle_Title": "Название",
"DE.Controllers.Main.txtStyle_Subtitle": "Подзаголовок",
"DE.Controllers.Main.txtStyle_Quote": "Цитата",
"DE.Controllers.Main.txtStyle_Intense_Quote": "Выделенная цитата",
"DE.Controllers.Main.txtStyle_List_Paragraph": "Абзац списка",
"DE.Controllers.Statusbar.textHasChanges": "Отслежены новые изменения", "DE.Controllers.Statusbar.textHasChanges": "Отслежены новые изменения",
"DE.Controllers.Statusbar.textTrackChanges": "Документ открыт при включенном режиме отслеживания изменений", "DE.Controllers.Statusbar.textTrackChanges": "Документ открыт при включенном режиме отслеживания изменений",
"DE.Controllers.Statusbar.zoomText": "Масштаб {0}%", "DE.Controllers.Statusbar.zoomText": "Масштаб {0}%",
......
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