diff --git a/src/block_manager/view/BlockView.js b/src/block_manager/view/BlockView.js index b9abe12c9..e21a1daf4 100644 --- a/src/block_manager/view/BlockView.js +++ b/src/block_manager/view/BlockView.js @@ -139,7 +139,7 @@ export default Backbone.View.extend({ render() { const { em, el, ppfx, model } = this; const className = `${ppfx}block`; - const label = model.get('label'); + const label = em.t(`blocks.labels.${model.id}`) || model.get('label'); const render = model.get('render'); const media = model.get('media'); el.className += ` ${className} ${ppfx}one-bg ${ppfx}four-color-h`; diff --git a/src/block_manager/view/CategoryView.js b/src/block_manager/view/CategoryView.js index f05acdf97..4ff54edf7 100644 --- a/src/block_manager/view/CategoryView.js +++ b/src/block_manager/view/CategoryView.js @@ -14,7 +14,8 @@ export default Backbone.View.extend({ initialize(o = {}, config = {}) { this.config = config; - const pfx = this.config.pStylePrefix || ''; + const pfx = config.pStylePrefix || ''; + this.em = config.em; this.pfx = pfx; this.caretR = 'fa fa-caret-right'; this.caretD = 'fa fa-caret-down'; @@ -69,13 +70,16 @@ export default Backbone.View.extend({ }, render() { - this.el.innerHTML = this.template({ + const { em, el, $el, model } = this; + const label = em.t(`blocks.categories.${model.id}`) || model.get('label'); + el.innerHTML = this.template({ pfx: this.pfx, - label: this.model.get('label') + label }); - this.el.className = this.className; - this.$el.css({ order: this.model.get('order') }); + el.className = this.className; + $el.css({ order: model.get('order') }); this.updateVisibility(); + return this; } }); diff --git a/src/i18n/locale/en.js b/src/i18n/locale/en.js index 4e3507dc0..4ce27f335 100644 --- a/src/i18n/locale/en.js +++ b/src/i18n/locale/en.js @@ -4,5 +4,9 @@ export default { inputPlh: 'http://path/to/the/image.jpg', modalTitle: 'Select Image', uploadTitle: 'Drop files here or click to upload' + }, + blocks: { + labels: {}, + categories: {} } }; diff --git a/src/i18n/locale/tr.js b/src/i18n/locale/tr.js index 1b7183583..7c21334d7 100644 --- a/src/i18n/locale/tr.js +++ b/src/i18n/locale/tr.js @@ -146,36 +146,6 @@ export default { layerManager: { layerName: 'Katman' }, - categories: { - Basic: 'Genel', - Extra: 'Ekstra', - Forms: 'Formlar' - }, - blocks: { - testBlock: 'Blok', - column1: 'Kolon - 1', - column2: 'Kolon - 2', - column3: 'Kolon - 3', - 'column3-7': 'Kolon 3-7', - text: 'Metin', - link: 'Bağlantı', - image: 'Resim', - video: 'Video', - map: 'Harita', - 'h-navbar': 'Dikey Navbar', - countdown: 'Geri Sayım', - form: 'Form', - input: 'Giriş', - textarea: 'Metin Alanı', - select: 'Seçim', - button: 'Buton', - label: 'Etiket', - checkbox: 'İşaret Kutusu', - radio: 'Seçim Kutusu', - 'link-block': 'Blok Bağlantı', - quote: 'Alıntı', - 'text-basic': 'Basit Metin' - }, utils: { colorPicker: { cancel: 'İptal',