Coder Social home page Coder Social logo

kuaizi-co / i18n Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 1.0 455 KB

基于vue-i18n生态的一系列工具插件

Home Page: https://github.com/Kuaizi-co/i18n

License: MIT License

JavaScript 70.39% TypeScript 29.61%
vue vue-i18n vue-cli vue-cli-plugin webpack-plugin loader

i18n's Introduction

@kuaizi/i18n

作为一个具有国际业务的Sass供应商,多语言是最基本的刚需,如何方便保持页面维护和支持多语言,由最初的直接用中文作为key值思路,@veici 最早实现的 i18n-placeholder-loader,衍生去整合我们的多语言工具链

包含的工具:

  • i18n-loader
  • vue-cli-plugin-i18n
  • webpack-plugin-i18n
  • i18n-cli
  • vue-i18n-helper

vue-i18n-loader

参考 i18n-placeholder-loader

自动替换占位符

使用文档

vue-cli-plugin-i18n

vue-cli3.x插件,注入配置 i18n-loader

使用文档

webpack-plugin-i18n

i18n-loader的插件版本,在build才替换

使用文档

i18n-cli

提供一键翻译 excel 文件

使用文档

vue-i18n-helper

提供i18n扩展的vscode快捷键

使用文档

Test 自动化测试

# 测试全部包
> yarn test

# 测试一个模块
> yarn test i18n-loader

# 测试多个模块
> yarn test i18n-loader,i18n-cli

publish

# 打版本
> npx lerna version prerelease --amend --conventional-commits
# 发布
> npx lerna publish --force-publish --yes --no-git-tag-version
# 预发版
> npx lerna publish --canary --force-publish --yes --no-git-tag-version
# 发布下一个版本
> npx lerna publish --dist-tag next --force-publish --yes

i18n's People

Contributors

tomieric avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jingluochen

i18n's Issues

[enhancement] cursor select the key

Hello,

One suggestion (ask of enhancement), is it possible to select the key in the editor after the shortcut CTRL + T ?

It will help to :

  • copy / paste the inital value
    or
  • change the key used for the translation

[Enhancement Request] Handle key levels with the command @kuaizi: $i (CTRL + i)

Firstly, thanks for your work. The extension is great and enhance a lot the experience with vue i18n.

I would like to know if you could generate expanded translation from 'key.levels' with @kuaizi: $i command (CTRL + i) ?

Indeed, I organize some translations keys in levels (example: $t('meta.title'), $t('meta.description'))
Then i use the magic 'CTRL + i' to auto generate vue i18n translations keys but the the key is flatten.
I would like that the auto generated translation to be expanded in <i18n> tag
Note: I use the "." (dot) as level separator

<template>
      <table>
        <tr>
          <th>title</th>
          <td>{{ $t('meta.title') }}</td>
        </tr>
        <tr>
          <th>desciption</th>
          <td>{{ $t('meta.description') }}</td>
        </tr>
      </table>
</template>

<i18n>
{
  "en": {
    "meta.description": "" // [Actual behavior: flatten] Key generated after CTRL + i command,
    "meta": {
      "title": "Kuaizi i18n plugin", // [Enhancement request: expanded] Key with 2 levels after CTRL + i command
    }
  },
  "fr": {
    "meta.description": "",
    "meta": {
      "title": "Kuaizi i18n module d'extension"
    }
  }
}
</i18n>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.