https://github.com/mathsgod/vite-plugin-i18n-tc2sc
https://github.com/mathsgod/vite-plugin-i18n-tc2sc
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/mathsgod/vite-plugin-i18n-tc2sc
- Owner: mathsgod
- License: mit
- Created: 2023-04-04T08:52:34.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-06T03:31:03.000Z (about 3 years ago)
- Last Synced: 2025-04-13T12:17:10.342Z (about 1 year ago)
- Language: JavaScript
- Size: 18.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vite-plugin-i18n-tc2sc
Vite plugin of i18n tc2sc for Vue 3
## Install
Prerequisites: [vue-i18n](https://www.npmjs.com/package/vue-i18n) or [@nuxtjs/i18n-edge](https://www.npmjs.com/package/@nuxtjs/i18n-edge)
```
npm i vite-plugin-i18n-tc2sc
```
## Setup
### Nuxt
```ts
// nuxt.config.ts
import tc2scPlugin from 'vite-plugin-i18n-tc2sc'
export default defineNuxtConfig({
vite: {
plugins: [
tc2scPlugin()
]
}
})
```
## Example
In some vue page
```vue
{
"tc": {
"hello": "你好嗎?"
}
}
{{ t('hello') }}
```
It will be converted to "你好吗?" when locale is "sc"