Skip to content

mathsgod/nuxt-i18n-tc2sc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nuxt-i18n-tc2sc

A Nuxt.js module for automatically converting Traditional Chinese to Simplified Chinese.

Install

Prerequisites: Nuxt@^2, @nuxtjs/i18n@^7

Setup

  1. Add nuxt-i18n-tc2sc dependency to your project

  2. Config 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"

About

A Nuxt.js module for automatically converting Traditional Chinese to Simplified Chinese.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published