vite-plugin-i18n-tc2sc
v1.0.1
Published
A module used auto generate simplified chinese (sc) from traditional chinese (tc) in vue-i18n
Downloads
43
Maintainers
Readme
vite-plugin-i18n-tc2sc
Vite plugin of i18n tc2sc for Vue 3
Install
Prerequisites: vue-i18n or @nuxtjs/i18n-edge
npm i vite-plugin-i18n-tc2sc
Setup
Nuxt
// nuxt.config.ts
import tc2scPlugin from 'vite-plugin-i18n-tc2sc'
export default defineNuxtConfig({
vite: {
plugins: [
tc2scPlugin()
]
}
})
Example
In some vue page
<i18n lang="json">
{
"tc": {
"hello": "你好嗎?"
}
}
</i18n>
<template>
<div>
<h1>{{ t('hello') }}</h1>
</div>
</template>
It will be converted to "你好吗?" when locale is "sc"