Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guuri11/i18n-cli
๐ I18n-cli | A tool for a quick addition into the i18n locale files
https://github.com/guuri11/i18n-cli
i18n i18n-js i18n-node i18n-react i18n-tool internationalization intl node nodejs react-i18next translation
Last synced: 6 days ago
JSON representation
๐ I18n-cli | A tool for a quick addition into the i18n locale files
- Host: GitHub
- URL: https://github.com/guuri11/i18n-cli
- Owner: Guuri11
- Created: 2022-10-31T19:04:09.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-12T09:12:09.000Z (over 1 year ago)
- Last Synced: 2024-09-17T10:07:42.987Z (2 months ago)
- Topics: i18n, i18n-js, i18n-node, i18n-react, i18n-tool, internationalization, intl, node, nodejs, react-i18next, translation
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@guuri11/i18n-cli
- Size: 26.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ I18n-cli
CLI tool for quick i18n additions
# ๐ Motivation
Working with translations can be so boring & annoying when you are trasnlating a big project with 3 or more languages availables. So I wanted to have a node tool for inserting ASAP the sentences for i18n.# ๐งช Features
- Add new sentences to locales, just put the folder path where the json files are located.
- Update a the sentences based on a key
- Delete the sentences based on a key
- Export the locales to CSV## Installation
Install with ```$ npm install --save-dev i18n-cli```
or
Install with ```$ yarn add --dev @guuri11/i18n-cli ```
## Usage
Run ```$ node_modules/@guuri11/i18n-cli/bin/cli.js ```or
Create a script in your package.json like this
```json"scripts": {
"i18n-cli": "node_modules/@guuri11/i18n-cli/bin/cli.js"
}
```
and just run```npm run i18n-cli```
or
```yarn run i18n-cli```
#### Preview
```
โน Running i18n editor 15:12:33
โน Please choose an option: 15:12:33
1 -> Add Translation Sentence
2 -> Delete Translation Sentence
3 -> Generate CSV extract
4 -> Exit
Option: 1
Selected option: 1
Enter the folder path where the locale files are located: ./locale
Enter the key of the new translation sentence: hello_world
ready Key: hello_world 15:12:59
Add translation for en locale or type 'update' to modify an existing one: Hello world!
ready Value: Hello world! 15:13:21
โ Translation added to locale 15:13:21
Add translation for es locale or type 'update' to modify an existing one: Hola mundo!
ready Value: Hola mundo! 15:13:25
โ Translation added to locale 15:13:25
โ Translation added to all locales 15:13:25
โน Please choose an option: 15:13:25
1 -> Add Translation Sentence
2 -> Delete Translation Sentence
3 -> Generate CSV extract
4 -> Exit
Option: 3
Selected option: 3
โ CSV generated successfully
```
#### Result##### src/locales/en.json
```json
{
"hello_world": "Hello World"
}
````##### src/locales/es.json
```json
{
"hello_world": "Hola mundo"
}
````##### src/locales/locales.csv
```csv
key,en,es
hello_world,Hello world!,Hola mundo!
````## ๐ Feedback
If you have any feedback, please reach out to me at Linkedin ๐ (https://www.linkedin.com/in/sergio-gurillo-corral-2585431b0/)