From 6584fa1f24c4db87c79bc5a287f1a3664041c626 Mon Sep 17 00:00:00 2001 From: Alexander Yuzhin Date: Fri, 18 Nov 2016 14:56:48 +0300 Subject: [PATCH] [DE mobile] Localization EditContainer, EditHyperlink. --- .../app/controller/edit/EditContainer.js | 51 +++++++++---------- .../app/controller/edit/EditHyperlink.js | 8 +-- .../app/template/EditHyperlink.template | 20 ++++---- .../mobile/app/view/edit/EditHyperlink.js | 15 ++++-- apps/documenteditor/mobile/locale/en.json | 19 ++++++- 5 files changed, 67 insertions(+), 46 deletions(-) diff --git a/apps/documenteditor/mobile/app/controller/edit/EditContainer.js b/apps/documenteditor/mobile/app/controller/edit/EditContainer.js index 58203a048..acf0ac896 100644 --- a/apps/documenteditor/mobile/app/controller/edit/EditContainer.js +++ b/apps/documenteditor/mobile/app/controller/edit/EditContainer.js @@ -44,7 +44,7 @@ define([ ], function (core) { 'use strict'; - DE.Controllers.EditContainer = Backbone.Controller.extend((function() { + DE.Controllers.EditContainer = Backbone.Controller.extend(_.extend((function() { // Private var _settings = []; @@ -90,20 +90,6 @@ define([ } }, - _dummyEditController: function () { - var layout = - '
' + - '
' + - '

Implement settings!!!!

' + - '
' + - '
'; - - return { - caption: 'Dummy', - layout: layout - } - }, - _emptyEditController: function () { var layout = '
' + @@ -113,62 +99,63 @@ define([ '
'; return { - caption: 'Settings', + caption: this.textSettings, layout: layout } }, _layoutEditorsByStack: function () { - var editors = []; + var me = this, + editors = []; if (_settings.length < 0) { - editors.push(this._emptyEditController()); + editors.push(me._emptyEditController()); } else { if (_.contains(_settings, 'text')) { editors.push({ - caption: 'Text', + caption: me.textText, id: 'edit-text', layout: DE.getController('EditText').getView('EditText').rootLayout() }) } if (_.contains(_settings, 'paragraph')) { editors.push({ - caption: 'Paragraph', + caption: me.textParagraph, id: 'edit-paragraph', layout: DE.getController('EditParagraph').getView('EditParagraph').rootLayout() }) } if (_.contains(_settings, 'table')) { editors.push({ - caption: 'Table', + caption: me.textTable, id: 'edit-table', layout: DE.getController('EditTable').getView('EditTable').rootLayout() }) } if (_.contains(_settings, 'shape')) { editors.push({ - caption: 'Shape', + caption: me.textShape, id: 'edit-shape', layout: DE.getController('EditShape').getView('EditShape').rootLayout() }) } if (_.contains(_settings, 'image')) { editors.push({ - caption: 'Image', + caption: me.textImage, id: 'edit-image', layout: DE.getController('EditImage').getView('EditImage').rootLayout() }) } if (_.contains(_settings, 'chart')) { editors.push({ - caption: 'Chart', + caption: me.textChart, id: 'edit-chart', layout: DE.getController('EditChart').getView('EditChart').rootLayout() }) } if (_.contains(_settings, 'hyperlink')) { editors.push({ - caption: 'Hyperlink', + caption: me.textHyperlink, id: 'edit-link', layout: DE.getController('EditHyperlink').getView('EditHyperlink').rootLayout() }) @@ -363,7 +350,17 @@ define([ } _settings = _.uniq(_settings); - } + }, + + textSettings: 'Settings', + textText: 'Text', + textParagraph: 'Paragraph', + textTable: 'Table', + textShape: 'Shape', + textImage: 'Image', + textChart: 'Chart', + textHyperlink: 'Hyperlink' + } - })()); + })(), DE.Controllers.EditContainer || {})) }); \ No newline at end of file diff --git a/apps/documenteditor/mobile/app/controller/edit/EditHyperlink.js b/apps/documenteditor/mobile/app/controller/edit/EditHyperlink.js index 5540b315c..a29f0be70 100644 --- a/apps/documenteditor/mobile/app/controller/edit/EditHyperlink.js +++ b/apps/documenteditor/mobile/app/controller/edit/EditHyperlink.js @@ -47,7 +47,7 @@ define([ ], function (core) { 'use strict'; - DE.Controllers.EditHyperlink = Backbone.Controller.extend((function() { + DE.Controllers.EditHyperlink = Backbone.Controller.extend(_.extend((function() { // Private var _stack = [], _linkObject = undefined; @@ -169,8 +169,8 @@ define([ } }, - textEmptyImgUrl : 'You need to specify image URL.', - txtNotUrl : 'This field should be a URL in the format \"http://www.example.com\"' + textEmptyImgUrl: 'You need to specify image URL.', + txtNotUrl: 'This field should be a URL in the format \"http://www.example.com\"' }; - })()); + })(), DE.Controllers.EditHyperlink || {})) }); \ No newline at end of file diff --git a/apps/documenteditor/mobile/app/template/EditHyperlink.template b/apps/documenteditor/mobile/app/template/EditHyperlink.template index 82a4d75ea..34ef5b32f 100644 --- a/apps/documenteditor/mobile/app/template/EditHyperlink.template +++ b/apps/documenteditor/mobile/app/template/EditHyperlink.template @@ -5,9 +5,9 @@
  • @@ -15,9 +15,9 @@
  • @@ -25,9 +25,9 @@
  • @@ -36,15 +36,15 @@
    <% if (android) { %> - Edit Link - Remove Link + <%= scope.textEdit %> + <%= scope.textRemove %> <% } else { %> <% } %> diff --git a/apps/documenteditor/mobile/app/view/edit/EditHyperlink.js b/apps/documenteditor/mobile/app/view/edit/EditHyperlink.js index f6574b83b..2813d2b3b 100644 --- a/apps/documenteditor/mobile/app/view/edit/EditHyperlink.js +++ b/apps/documenteditor/mobile/app/view/edit/EditHyperlink.js @@ -49,7 +49,7 @@ define([ ], function (editTemplate, $, _, Backbone) { 'use strict'; - DE.Views.EditHyperlink = Backbone.View.extend((function() { + DE.Views.EditHyperlink = Backbone.View.extend(_.extend((function() { // private return { @@ -79,7 +79,8 @@ define([ render: function () { this.layout = $('
    ').append(this.template({ android : Common.SharedSettings.get('android'), - phone : Common.SharedSettings.get('phone') + phone : Common.SharedSettings.get('phone'), + scope : this })); return this; @@ -93,7 +94,13 @@ define([ } return ''; - } + }, + + textLink: 'Link', + textDisplay: 'Display', + textTip: 'Screen Tip', + textEdit: 'Edit Link', + textRemove: 'Remove Link' } - })()); + })(), DE.Views.EditHyperlink || {})) }); \ No newline at end of file diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json index d48bb6198..cee250d71 100644 --- a/apps/documenteditor/mobile/locale/en.json +++ b/apps/documenteditor/mobile/locale/en.json @@ -205,5 +205,22 @@ "DE.Views.EditChart.textFill": "Fill", "DE.Views.EditChart.textBorder": "Border", "DE.Views.EditChart.textSize": "Size", - "DE.Views.EditChart.textColor": "Color" + "DE.Views.EditChart.textColor": "Color", + + "DE.Controllers.EditContainer.textSettings": "Settings", + "DE.Controllers.EditContainer.textText": "Text", + "DE.Controllers.EditContainer.textParagraph": "Paragraph", + "DE.Controllers.EditContainer.textTable": "Table", + "DE.Controllers.EditContainer.textShape": "Shape", + "DE.Controllers.EditContainer.textImage": "Image", + "DE.Controllers.EditContainer.textChart": "Chart", + "DE.Controllers.EditContainer.textHyperlink": "Hyperlink", + + "DE.Views.EditHyperlink.textLink": "Link", + "DE.Views.EditHyperlink.textDisplay": "Display", + "DE.Views.EditHyperlink.textTip": "Screen Tip", + "DE.Views.EditHyperlink.textEdit": "Edit Link", + "DE.Views.EditHyperlink.textRemove": "Remove Link" + + } \ No newline at end of file