Skip to content

Commit

Permalink
Update locale file keys
Browse files Browse the repository at this point in the history
  • Loading branch information
artf committed Nov 5, 2019
1 parent 16b3110 commit 6d2f615
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ images/
private/
vendor/
coverage/
locale/
/locale/
node_modules/
bower_components/
grapesjs-*.tgz
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/I18n.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down
4 changes: 2 additions & 2 deletions src/asset_manager/view/AssetsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion src/asset_manager/view/FileUploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/block_manager/view/BlockView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
Expand Down
3 changes: 2 additions & 1 deletion src/block_manager/view/CategoryView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/commands/view/OpenAssets.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/i18n/locale/en.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
const traitInputAttr = { placeholder: 'eg. Text here' };

export default {
assets: {
assetManager: {
addButton: 'Add image',
inputPlh: 'http://path/to/the/image.jpg',
modalTitle: 'Select Image',
uploadTitle: 'Drop files here or click to upload'
},
// 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',
},
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/locale/tr.js
Original file line number Diff line number Diff line change
@@ -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'
Expand Down

0 comments on commit 6d2f615

Please sign in to comment.