Skip to content

Smoking i18n CLI(sic) - Frontend Internationalization Toolkit

License

Notifications You must be signed in to change notification settings

SteamedBread2333/sic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation



npm version npm downloads deps

Smoking I18n CLI(sic) Frontend Internationalization Toolkit

Install

Project

npm i smoking-intl-cli --save-dev

Global

npm i smoking-intl-cli -g

Usage

sic [options]

Options

-V --version          Show version number
init                  Init Work Space, Pulling Source Files
xlsx                  Generage Export File(.xlsx)
ts                    Start import .xlsx File, and generate .ts files
langs                 Show All Supported Languages

Config file

Need create intl.config.ts in your project root directory. Type of intl.config.ts as below:

Type

Base Features

  1. Support multiple languages export and import.

More Features

  1. Support google translate prefill.
  2. Table is code, easy to collaborate.

Best Practices

  1. Google sheet is recommended as the editor for exporting files

The default GoogleTranslate service is used. Iflytek and DeepL translation function templates are provided in the project, which can be easily configured and used through Google workspace Apps-script.

  1. When the GoogleTranslate pre - fill function is enabled, {cat} may be translated into {猫} or other languages, which can affect template filling.
// bad
export intlModule = {
  "xxx-key": {action}{name}
  ...,
}
// good
export intlModule = {
  "xxx-key": {1}{2}
  ...,
}

License

MIT

About

Smoking i18n CLI(sic) - Frontend Internationalization Toolkit

Topics

Resources

License

Stars

Watchers

Forks