mirror of https://github.com/ElemeFE/element
				
				
				
			
		
			
				
	
	
		
			64 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			Markdown
		
	
	
			
		
		
	
	
			64 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			Markdown
		
	
	
## 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 `NormalModuleReplacementPlugin` provided by webpack you can replace default locale:
 | 
						|
 | 
						|
webpack.config.js
 | 
						|
```javascript
 | 
						|
{
 | 
						|
  plugins: [
 | 
						|
    new webpack.NormalModuleReplacementPlugin(/element-ui[\/\\]lib[\/\\]locale[\/\\]lang[\/\\]zh-CN/, 'element-ui/lib/locale/lang/en')
 | 
						|
  ]
 | 
						|
}
 | 
						|
```
 | 
						|
 | 
						|
Currently Element ships with the following languages:
 | 
						|
<ul class="language-list">
 | 
						|
  <li>Simplified Chinese (zh-CN)</li>
 | 
						|
  <li>English (en)</li>
 | 
						|
  <li>German (de)</li>
 | 
						|
  <li>Portuguese (pt)</li>
 | 
						|
  <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>
 | 
						|
  <li>Dutch (nl)</li>
 | 
						|
  <li>Vietnamese (vi)</li>
 | 
						|
  <li>Russian (ru-RU)</li>
 | 
						|
  <li>Turkish (tr-TR)</li>
 | 
						|
  <li>Brazilian Portuguese (pt-br)</li>
 | 
						|
  <li>Farsi (fa)</li>
 | 
						|
  <li>Thai (th)</li>
 | 
						|
</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.
 |