nuxt-i18n-tc2sc
v1.0.12
Published
A module used auto generate simplified chinese (sc) from traditional chinese (tc) in nuxt-i18n
Downloads
27
Readme
nuxt-i18n-tc2sc
A Nuxt.js module for automatically converting Traditional Chinese to Simplified Chinese.
Install
Prerequisites: Nuxt@^2, @nuxtjs/i18n@^7
Setup
Add
nuxt-i18n-tc2sc
dependency to your projectConfig nuxt.config.js
export default{
...
modules: [
"@nuxtjs/i18n",
"nuxt-i18n-tc2sc"
],
i18n:{
vueI18nLoader: true, //must be true
locales: ['tc', 'sc'],
}
...
}
Example
In some vue page
<i18n>
{
"tc": {
"hello": "你好嗎?"
}
}
</i18n>
<template>
<div>
<h1>{{ $t('hello') }}</h1>
</div>
</template>
It will be converted to "你好吗?" when locale is "sc"