docs/en-US/guide/i18n.md
Element Plus components use English by default. If you want to use other languages, read on to find out how.
Element Plus provides global configuration options.
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
app.use(ElementPlus, {
locale: zhCn,
})
Element Plus also provides a Vue component ConfigProvider for globally configuring locale and other settings.
<template>
<el-config-provider :locale="zhCn">
<app />
</el-config-provider>
</template>
<script setup lang="ts">
import { ElConfigProvider } from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
</script>
We use Day.js library to manage date and time in components like DatePicker. It is important to set a proper locale in Day.js to make internationalization work properly. You have to import Day.js's locale config separately.
import 'dayjs/locale/zh-cn'
If you are using Element Plus via CDN, you need to do the following. Let's take unpkg as an example:
<script src="//unpkg.com/element-plus/dist/locale/zh-cn"></script>
<script>
app.use(ElementPlus, {
locale: ElementPlusLocaleZhCn,
})
</script>
For full documentation, refer to: ConfigProvider
<ul class="language-list"> <li>Simplified Chinese (zh-cn)</li> <li>American English (en)</li> <li>Azerbaijani (az)</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)</li> <li>Turkish (tr)</li> <li>Brazilian Portuguese (pt-br)</li> <li>Farsi (fa)</li> <li>Thai (th)</li> <li>Indonesian (id)</li> <li>Bulgarian (bg)</li> <li>Pashto (pa)</li> <li>Polish (pl)</li> <li>Finnish (fi)</li> <li>Swedish (sv)</li> <li>Greek (el)</li> <li>Slovak (sk)</li> <li>Catalunya (ca)</li> <li>Czech (cs)</li> <li>Ukrainian (uk)</li> <li>Turkmen (tk)</li> <li>Tamil (ta)</li> <li>Latvian (lv)</li> <li>Afrikaans (af)</li> <li>Estonian (et)</li> <li>Slovenian (sl)</li> <li>Arabic (ar)</li> <li>Hebrew (he)</li> <li>Lao (lo)</li> <li>Lithuanian (lt)</li> <li>Mongolian (mn)</li> <li>Kazakh (kk)</li> <li>Hungarian (hu)</li> <li>Romanian (ro)</li> <li>Kurdish (ku)</li> <li>Kurdish (ckb)</li> <li>Uighur (ug-cn)</li> <li>Khmer (km)</li> <li>Serbian (sr)</li> <li>Basque (eu)</li> <li>Kyrgyz (ky)</li> <li>Armenian (hy-am)</li> <li>Croatian (hr)</li> <li>Esperanto (eo)</li> <li>Bengali (bn)</li> <li>Malay (ms)</li> <li>Madagascar (mg)</li> <li>Swahili (sw)</li> <li>Uzbek (uz-uz)</li> <li>Egyptian Arabic (ar-eg)</li> <li>Burmese (my)</li> <li>Hindi (hi)</li> <li>Norsk (no)</li> <li>Hongkong Chinese (zh-hk)</li> <li>Macau Chinese (zh-mo)</li> <li>Telugu (te)</li> </ul>If you need any other languages, PR is always welcome, you only need to add a language file here.
<style> .language-list { list-style: disc } </style>