Internationalization
Onu UI uses English by default, if you wish you to use other languages, please continue to read.
Global configuration
Onu UI provides global configurations:
ts
import { createApp } from 'vue'
import OnuUI, { zhCn } from 'onu-ui'
const app = createApp(App)
app.use(OnuUI, {
locale: zhCn,
})
import { createApp } from 'vue'
import OnuUI, { zhCn } from 'onu-ui'
const app = createApp(App)
app.use(OnuUI, {
locale: zhCn,
})
ConfigProvider
Config Provider is used to set global theme(WIP), set global language and set namespace(WIP) for components (detached parts).
vue
<script setup lang='ts'>
import { zhCn } from 'onu-ui'
const locale = ref(zhCn)
</script>
<template>
<o-config-provider :locale="locale">
<app />
</o-config-provider>
</template>
<script setup lang='ts'>
import { zhCn } from 'onu-ui'
const locale = ref(zhCn)
</script>
<template>
<o-config-provider :locale="locale">
<app />
</o-config-provider>
</template>
Supported languages
PRs are welcomed for locales that are not supported yet!
Language | lang | Version |
---|---|---|
Chinese (Simplified) | zhCN | - |
English | en | - |
Portuguese | pt | - |