An open API service indexing awesome lists of open source software.

https://github.com/mathsgod/vite-plugin-i18n-tc2sc


https://github.com/mathsgod/vite-plugin-i18n-tc2sc

Last synced: about 1 year ago
JSON representation

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"