https://github.com/win-le/script-language
CLI generate multiple language
https://github.com/win-le/script-language
cli language multiple-language script
Last synced: 6 months ago
JSON representation
CLI generate multiple language
- Host: GitHub
- URL: https://github.com/win-le/script-language
- Owner: win-le
- Created: 2022-03-14T14:30:06.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-08-24T03:20:04.000Z (over 3 years ago)
- Last Synced: 2025-10-17T09:56:29.462Z (6 months ago)
- Topics: cli, language, multiple-language, script
- Language: JavaScript
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# script-language
This is CLI command.
The `script-language` will generate text which around by any function to object.
## Install
With npm
```
npm install -g script-language
```
With yarn
```
yarn global add script-language
```
## Usage
Run script in your code folder
```
script-language
```
## CLI command
| Flag | Type | Description |
| ------------ | ------ | ---------------------------------------- |
| **--outDir** | string | Path of folder consist will be generated |
## File language.config.json
| Properties | Type | Description | Default |
| ---------------- | ------------------ | ----------------------------------------------- | ------------------------- |
| **excludes** | array | Folder will be ignored | ["node_modules"] |
| **includes** | array | Folder will be run | ["src"] |
| **match** | string | File match | \^.\*.(js\|ts\|jsx\|tsx)$ |
| **nameFunction** | string \| string[] | Name of function contain text will be generated | "\_t" |
| **outDir** | string | Path of folder consist will be generated | "./language" |
| **language** | array | List language | ["vi-VI", "en-EN"] |
## Example
```
...
{ _t("Sessions is expired.") }
...
{_t("Sign in")}
...
console.log(_t("You can reset password"))
...
{_t("Sent")}
```
`language/vi.json`
```
{
"Sessions is expired.": "Sessions is expired.",
"Sign in":"Sign in",
"You can reset password": "You can reset password",
"Send": "Send",
}
```
`language/en.json`
```
{
"Sessions is expired.": "Sessions is expired.",
"Sign in":"Sign in",
"You can reset password": "You can reset password",
"Send": "Send",
}
```