teto-tool
A tool, but more
Install
$ npm install teto-tool -g
Use
- generate a new project
$ teto init [dest] [source]
Source: {gitUsername}/{repo}, you can find more in download-git-repo
You can specify a repository to create a new project, the default repository is crossjs/plato
- list some templates
$ teto list
- get text to be translated
$ teto i18n
$ teto i18n
?
How to use You just need to create a file named as .i18n
in your project root path, config like this:
"path_src": "src" "path_i18n": "src/i18n" "languages": "zh-CN" "en-US" "th" "include_files": ".js" ".jsx" "i18n_helper": "i18n" "default_data": "src/error.json"
Explanations:
- path_src: Your source file's path, generally, it is a relative path
- path_i18n: The path you place the i18n JSON files
- languages: languages
- include_files: files extention, if you do not set it, it will find all the files under the path_src
- i18n_helper: a symbol to mark the string which should be translated, like: i18n('xxxx')
- default_data: default data, it can be an object or a file path
Which repository can be used?
Generally, you can use any one as your template, but we recommend following these:
-
React-Redux
-
Vue-Vuex