Browse Source

Update dependencies

pull/2385/head
Artur Arseniev 6 years ago
parent
commit
7b11ba8e20
  1. 961
      dist/grapes.js
  2. 6
      dist/grapes.min.js
  3. 2
      dist/grapes.min.js.map
  4. 42
      docs/api/i18n.md
  5. 2048
      package-lock.json
  6. 27
      package.json
  7. 1
      src/dom_components/model/Component.js

961
dist/grapes.js

File diff suppressed because it is too large

6
dist/grapes.min.js

File diff suppressed because one or more lines are too long

2
dist/grapes.min.js.map

File diff suppressed because one or more lines are too long

42
docs/api/i18n.md

@ -2,7 +2,7 @@
## I18n
You can customize the initial state of the module from the editor initialization
You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object][1]
```js
const editor = grapesjs.init({
@ -10,9 +10,7 @@ const editor = grapesjs.init({
locale: 'en',
localeFallback: 'en',
messages: {
en: {
hello: 'Hello',
},
it: { hello: 'Ciao', ... },
...
}
}
@ -35,7 +33,7 @@ const i18n = editor.I18n;
Get module configurations
Returns **[Object][1]** Configuration object
Returns **[Object][2]** Configuration object
## setLocale
@ -43,7 +41,7 @@ Update current locale
### Parameters
- `locale` **[String][2]** Locale value
- `locale` **[String][3]** Locale value
### Examples
@ -57,7 +55,7 @@ Returns **this**
Get current locale
Returns **[String][2]** Current locale value
Returns **[String][3]** Current locale value
## getMessages
@ -65,9 +63,9 @@ Get all messages
### Parameters
- `lang` **[String][2]?** Specify the language of messages to return
- `opts` **[Object][1]?** Options (optional, default `{}`)
- `opts.debug` **[Boolean][3]?** Show warnings in case of missing language
- `lang` **[String][3]?** Specify the language of messages to return
- `opts` **[Object][2]?** Options (optional, default `{}`)
- `opts.debug` **[Boolean][4]?** Show warnings in case of missing language
### Examples
@ -78,7 +76,7 @@ i18n.getMessages('en');
// -> { hello: '...' }
```
Returns **[Object][1]**
Returns **[Object][2]**
## setMessages
@ -86,7 +84,7 @@ Set new set of messages
### Parameters
- `msg` **[Object][1]** Set of messages
- `msg` **[Object][2]** Set of messages
### Examples
@ -107,7 +105,7 @@ Update messages
### Parameters
- `msg` **[Object][1]** Set of messages to add
- `msg` **[Object][2]** Set of messages to add
### Examples
@ -128,10 +126,10 @@ Translate the locale message
### Parameters
- `key` **[String][2]** Label to translate
- `opts` **[Object][1]?** Options for the translation (optional, default `{}`)
- `opts.params` **[Object][1]?** Params for the translation
- `opts.debug` **[Boolean][3]?** Show warnings in case of missing resources
- `key` **[String][3]** Label to translate
- `opts` **[Object][2]?** Options for the translation (optional, default `{}`)
- `opts.params` **[Object][2]?** Params for the translation
- `opts.debug` **[Boolean][4]?** Show warnings in case of missing resources
### Examples
@ -148,10 +146,12 @@ obj.t('msg2', { l: 'it', params: { test: 'hello' } }); // custom local
// -> outputs `Msg hello it`
```
Returns **[String][2]**
Returns **[String][3]**
[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[1]: https://github.com/artf/grapesjs/blob/master/src/i18n/config.js
[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean

2048
package-lock.json

File diff suppressed because it is too large

27
package.json

@ -16,11 +16,11 @@
"url": "https://github.com/artf/grapesjs.git"
},
"dependencies": {
"@babel/runtime": "^7.6.0",
"@babel/runtime": "^7.7.1",
"backbone": "1.3.3",
"backbone-undo": "^0.2.5",
"cash-dom": "^1.3.7",
"codemirror": "^5.48.4",
"codemirror": "^5.49.2",
"codemirror-formatting": "^1.0.0",
"font-awesome": "^4.7.0",
"keymaster": "^1.6.2",
@ -29,26 +29,26 @@
"underscore": "^1.9.1"
},
"devDependencies": {
"@babel/cli": "^7.6.4",
"@babel/core": "^7.6.0",
"@babel/plugin-transform-runtime": "^7.6.0",
"@babel/preset-env": "^7.6.0",
"@babel/cli": "^7.7.0",
"@babel/core": "^7.7.0",
"@babel/plugin-transform-runtime": "^7.6.2",
"@babel/preset-env": "^7.7.1",
"babel-loader": "^8.0.6",
"documentation": "^8.1.2",
"eslint": "^6.4.0",
"eslint": "^6.6.0",
"html-webpack-plugin": "^3.2.0",
"husky": "^2.7.0",
"jest": "^24.9.0",
"lint-staged": "^8.2.1",
"node-sass": "^4.12.0",
"node-sass": "^4.13.0",
"npm-run-all": "^4.1.5",
"prettier": "^1.18.2",
"sinon": "^7.4.2",
"sinon": "^7.5.0",
"string-replace-loader": "^2.2.0",
"vuepress": "^0.10.2",
"webpack": "^4.40.2",
"webpack-cli": "^3.3.8",
"webpack-dev-server": "^3.8.0",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10",
"webpack-dev-server": "^3.9.0",
"whatwg-fetch": "^3.0.0"
},
"keywords": [
@ -71,8 +71,7 @@
"> 1%",
"ie 11",
"safari 8"
],
"modules": false
]
}
]
],

1
src/dom_components/model/Component.js

@ -875,7 +875,6 @@ const Component = Backbone.Model.extend(Styleable).extend(
const i18nPfx = 'domComponents.names.';
const i18nStr =
em && (em.t(`${i18nPfx}${type}`) || em.t(`${i18nPfx}${tagName}`));
console.log({ i18nStr, type });
return i18nStr || customName || name;
},

Loading…
Cancel
Save