Browse Source

Setup i18n for BlockManager

pull/2385/head
Artur Arseniev 6 years ago
parent
commit
2b13e0fa7b
  1. 2
      src/block_manager/view/BlockView.js
  2. 14
      src/block_manager/view/CategoryView.js
  3. 4
      src/i18n/locale/en.js
  4. 30
      src/i18n/locale/tr.js

2
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`;

14
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;
}
});

4
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: {}
}
};

30
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',

Loading…
Cancel
Save