2016-11-13 03:58:45 +00:00
## Internationalization
2016-11-10 13:46:55 +00:00
2016-11-13 03:58:45 +00:00
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:
2016-11-10 13:46:55 +00:00
```javascript
import Vue from 'vue'
import ElementUI from 'element-ui'
import locale from 'element-ui/lib/locale/lang/en'
Vue.use(ElementUI, { locale })
```
2016-11-13 03:58:45 +00:00
Or if you are importing Element on demand:
2016-11-10 13:46:55 +00:00
```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'
2016-11-13 03:58:45 +00:00
// configure language
2016-11-10 13:46:55 +00:00
locale.use(lang)
2016-11-13 03:58:45 +00:00
// import components
2016-11-10 13:46:55 +00:00
Vue.component(Button.name, Button)
Vue.component(Select.name, Select)
```
2016-12-06 09:19:40 +00:00
The Chinese language pack is imported by default, even if you're using another language. But with `NormalModuleReplacementPlugin` provided by webpack you can replace default locale:
2016-11-10 13:46:55 +00:00
2016-11-13 03:58:45 +00:00
webpack.config.js
2016-11-10 13:46:55 +00:00
```javascript
{
plugins: [
2016-12-06 09:19:40 +00:00
new webpack.NormalModuleReplacementPlugin(/element-ui[\/\\]lib[\/\\]locale[\/\\]lang[\/\\]zh-CN/, 'element-ui/lib/locale/lang/en')
2016-11-10 13:46:55 +00:00
]
}
```
2016-11-13 03:58:45 +00:00
Currently Element ships with the following languages:
< ul class = "language-list" >
2016-11-18 07:04:19 +00:00
< li > Simplified Chinese (zh-CN)< / li >
2016-11-13 03:58:45 +00:00
< li > English (en)< / li >
< li > German (de)< / li >
< li > Portuguese (pt)< / li >
2016-11-18 07:54:33 +00:00
< li > Spanish (es)< / li >
< li > Danish (da)< / li >
< li > French (fr)< / li >
< li > Norwegian (nb-NO)< / li >
< li > Traditional Chinese (zh-TW)< / li >
< li > Italian (it)< / li >
< li > Korean (ko)< / li >
< li > Japanese (ja)< / li >
2016-12-06 08:05:38 +00:00
< li > Dutch (nl)< / li >
< li > Vietnamese (vi)< / li >
< li > Russian (ru-RU)< / li >
< li > Turkish (tr-TR)< / li >
< li > Brazilian Portuguese (pt-br)< / li >
2016-12-09 09:59:51 +00:00
< li > Farsi (fa)< / li >
< li > Thai (th)< / li >
2016-11-13 03:58:45 +00:00
< / ul >
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.