Browse Source

Update locale file keys

pull/2385/head
Artur Arseniev 6 years ago
parent
commit
6d2f61568b
  1. 2
      .gitignore
  2. 2
      docs/modules/I18n.md
  3. 4
      src/asset_manager/view/AssetsView.js
  4. 2
      src/asset_manager/view/FileUploader.js
  5. 2
      src/block_manager/view/BlockView.js
  6. 3
      src/block_manager/view/CategoryView.js
  7. 2
      src/commands/view/OpenAssets.js
  8. 4
      src/i18n/locale/en.js
  9. 2
      src/i18n/locale/tr.js

2
.gitignore

@ -14,7 +14,7 @@ images/
private/
vendor/
coverage/
locale/
/locale/
node_modules/
bower_components/
grapesjs-*.tgz

2
docs/modules/I18n.md

@ -9,7 +9,7 @@ The **I18n** module allows the internalization and updates of strings in the edi
::: warning
This guide is referring to GrapesJS v0.15.9 or higher
The module was added recently so we're open to receive help in [translating strings in other languages](#adding-new-language). Your help will be much appreciated!
The module was added recently so we're open to receive support in [translating strings in other languages](#adding-new-language). Your help will be much appreciated!
:::
[[toc]]

4
src/asset_manager/view/AssetsView.js

@ -11,10 +11,10 @@ export default Backbone.View.extend({
<div class="${pfx}assets-header">
<form class="${pfx}add-asset">
<div class="${ppfx}field ${pfx}add-field">
<input placeholder="${em && em.t('assets.inputPlh')}"/>
<input placeholder="${em && em.t('assetManager.inputPlh')}"/>
</div>
<button class="${ppfx}btn-prim">${em &&
em.t('assets.addButton')}</button>
em.t('assetManager.addButton')}</button>
<div style="clear:both"></div>
</form>
</div>

2
src/asset_manager/view/FileUploader.js

@ -249,7 +249,7 @@ export default Backbone.View.extend(
const { $el, pfx, em } = this;
$el.html(
this.template({
title: em && em.t('assets.uploadTitle'),
title: em && em.t('assetManager.uploadTitle'),
uploadId: this.uploadId,
disabled: this.disabled,
multiUpload: this.multiUpload,

2
src/block_manager/view/BlockView.js

@ -140,7 +140,7 @@ export default Backbone.View.extend({
const { em, el, ppfx, model } = this;
const className = `${ppfx}block`;
const label =
(em && em.t(`blocks.labels.${model.id}`)) || model.get('label');
(em && em.t(`blockManager.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`;

3
src/block_manager/view/CategoryView.js

@ -71,7 +71,8 @@ export default Backbone.View.extend({
render() {
const { em, el, $el, model } = this;
const label = em.t(`blocks.categories.${model.id}`) || model.get('label');
const label =
em.t(`blockManager.categories.${model.id}`) || model.get('label');
el.innerHTML = this.template({
pfx: this.pfx,
label

2
src/commands/view/OpenAssets.js

@ -4,7 +4,7 @@ export default {
const am = editor.AssetManager;
const config = am.getConfig();
const amContainer = am.getContainer();
const title = opts.modalTitle || editor.t('assets.modalTitle') || '';
const title = opts.modalTitle || editor.t('assetManager.modalTitle') || '';
const types = opts.types;
const accept = opts.accept;

4
src/i18n/locale/en.js

@ -1,7 +1,7 @@
const traitInputAttr = { placeholder: 'eg. Text here' };
export default {
assets: {
assetManager: {
addButton: 'Add image',
inputPlh: 'http://path/to/the/image.jpg',
modalTitle: 'Select Image',
@ -9,7 +9,7 @@ export default {
},
// Here just as a reference, GrapesJS core doesn't contain any block,
// so this should be omitted from other local files
blocks: {
blockManager: {
labels: {
// 'block-id': 'Block Label',
},

2
src/i18n/locale/tr.js

@ -1,5 +1,5 @@
export default {
assets: {
assetManager: {
addButton: 'Görsel Ekle',
modalTitle: 'Görsel Seçin',
uploadTitle: 'Dosya yüklemek için buraya sürükleyin veya tıklayın'

Loading…
Cancel
Save