diff --git a/README.md b/README.md index d2390c3c3..6c4ff561f 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,16 @@ - [Home Page](http://element.eleme.io/) - [Docs](http://element.eleme.io/#/component) - [FAQ 中文](./FAQ.md) +- [i18n](./i18n.md) +- Starter Kit + - [element-starter](https://github.com/ElementUI/element-starter) + - [element-cooking-starter](https://github.com/ElementUI/element-cooking-starter) + - [element-in-laravel-starter](https://github.com/ElementUI/element-in-laravel-starter) +- [Design resources](https://github.com/ElementUI/Resources) +- Boilerplate for bug reports + - [CodePen](https://codepen.io/anon/pen/ozYpNA) + - [JSFiddle](https://jsfiddle.net/gmve9d3p/) +- [Mint UI](https://github.com/ElemeFE/mint-ui) - Mobile UI elements for Vue.js ## Install ```shell @@ -79,17 +89,6 @@ Skip this part if you just want to use Element. For those who are interested in contributing to Element, please refer to our [contributing guide](https://github.com/ElemeFE/element/blob/master/.github/CONTRIBUTING.md) to see how to run this project. -## Other links -- Starter Kit - - [element-starter](https://github.com/ElementUI/element-starter) - - [element-cooking-starter](https://github.com/ElementUI/element-cooking-starter) - - [element-in-laravel-starter](https://github.com/ElementUI/element-in-laravel-starter) -- [Design resources](https://github.com/ElementUI/Resources) -- Boilerplate for bug reports - - [CodePen](https://codepen.io/anon/pen/ozYpNA) - - [JSFiddle](https://jsfiddle.net/gmve9d3p/) -- [Mint UI](https://github.com/ElemeFE/mint-ui) - Mobile UI elements for Vue.js - ## Changelog Detailed changes for each release are documented in the [release notes](https://github.com/ElemeFE/element/releases). diff --git a/examples/docs/zh-cn/quickstart.md b/examples/docs/zh-cn/quickstart.md index ee5b25635..36d7bda94 100644 --- a/examples/docs/zh-cn/quickstart.md +++ b/examples/docs/zh-cn/quickstart.md @@ -232,7 +232,7 @@ Vue.component(Button.name, Button) Vue.component(Select.name, Select) ``` -如果使用其它语言,默认情况下中文语言包依旧是被引入的,可以使用 webpack 的 IgnorePlugn 忽略掉它以减少打包后的文件体积。 +如果使用其它语言,默认情况下中文语言包依旧是被引入的,可以使用 webpack 的 IgnorePlugin 忽略掉它以减少打包后的文件体积。 webpack.config.js ```javascript diff --git a/i18n.md b/i18n.md new file mode 100644 index 000000000..2a2f6e992 --- /dev/null +++ b/i18n.md @@ -0,0 +1,45 @@ +## Internationalization + +The default language of Element is Chinese. If you wish to use another language, you'll need to do some i18n configuration. In your entry file, if you are importing Element entirely: + +```javascript +import Vue from 'vue' +import ElementUI from 'element-ui' +import locale from 'element-ui/lib/locale/lang/en' + +Vue.use(ElementUI, { locale }) +``` + +Or if you are importing Element on demand: + +```javascript +import Vue from 'vue' +import { Button, Select } from 'element-ui' +import lang from 'element-ui/lib/locale/lang/en' +import locale from 'element-ui/lib/locale' + +// configure language +locale.use(lang) + +// import components +Vue.component(Button.name, Button) +Vue.component(Select.name, Select) +``` + +The Chinese language pack is imported by default, even if you're using another language. But with `IgnorePlugin` provided by webpack you can ignore it when building: + +webpack.config.js +```javascript +{ + plugins: [ + new webpack.IgnorePlugin(/element-ui\/lib\/locale\/lang\/zh-cn/) + ] +} +``` + +Currently Element ships with the following languages: + - Chinese + - English + - German + +If your target language is not included, you are more than welcome to contribute: just add another language config [here](https://github.com/ElemeFE/element/tree/master/src/locale/lang) and create a pull request.