Internacionalización ​

Element Plus components use English by default. If you want to use other languages, read on to find out how.

Configuración global ​

Element Plus provides global configuration options.

main.ts
ts
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'

app.use(ElementPlus, {
  locale: zhCn,
})

ConfigProvider ​

Element Plus also provides a Vue component ConfigProvider for globally configuring locale and other settings.

App.vue
vue
<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>

Localización de fecha y hora ​

Utilizamos la librería Day.js para gestionar la fecha y hora en componentes como DatePicker. It is important to set a proper locale in Day.js to make internationalization work properly. Tiene que importar la configuración regional de Day.js por separado.

ts
import 'dayjs/locale/zh-cn'

Uso de un CDN ​

If you are using Element Plus via CDN, you need to do the following. Let's take unpkg as an example:

html
<script src="//unpkg.com/element-plus/dist/locale/zh-cn"></script>
<script>
  app.use(ElementPlus, {
    locale: ElementPlusLocaleZhCn,
  })
</script>

For full documentation, refer to: ConfigProvider

Idiomas disponibles

  • Chino simplificado (zh-cn)
  • Inglés Americano (en)
  • Azerbaijani (az)
  • Alemán (de)
  • Portugués (pt)
  • Español (es)
  • Danés (da)
  • Francés (fr)
  • Noruego (nb-NO)
  • Chino tradicional (zh-tw)
  • Italiano (it)
  • Coreano (ko)
  • Japonés (ja)
  • Holandés (nl)
  • Vietnamita (vi)
  • Ruso (ru)
  • Turco (tr)
  • Portugués brasileño (pt-br)
  • Farsi (fa)
  • Tailandés (th)
  • Indonesio (id)
  • Búlgaro (bg)
  • Pashto (pa)
  • Polaco (pl)
  • Finlandés (fi)
  • Sueco (sv)
  • Griego (el)
  • Eslovaco (sk)
  • Catalán (ca)
  • Checo (cs)
  • Ucraniano (uk)
  • Turco (tk)
  • Tamil (ta)
  • Letón (lv)
  • Africano (af)
  • Estonio (et)
  • Eslovaco (sl)
  • Árabe (ar)
  • Hebreo (he)
  • Lao (lo)
  • Lituano (lt)
  • Mongol (mn)
  • Kazakh (kk)
  • Húngaro (hu)
  • Rumano (ro)
  • Kurdo (ku)
  • Kurdish (ckb)
  • Uighur (ug-cn)
  • Khmer (km)
  • Serbian (sr)
  • Basque (eu)
  • Kyrgyz (ky)
  • Armenian (hy-am)
  • Croatian (hr)
  • Esperanto (eo)
  • Bengali (bn)
  • Malay (ms)
  • Madagascar (mg)
  • Swahili (sw)
  • Uzbek (uz-uz)
  • Egyptian Arabic (ar-eg)
  • Burmese (my)
  • Hindi (hi)
  • Norsk (no)
  • Hongkong Chinese (zh-hk)
  • Macau Chinese (zh-mo)
  • Telugu (te)

If you need any other languages, PR is always welcome, you only need to add a language file here.