https://github.com/juliandavidmr/text2locale
Extract all the texts of any project with HTML files and generate a KV (Key-Value) file, key = reference key, value = extracted text.
https://github.com/juliandavidmr/text2locale
extract html-files i18n text-extraction
Last synced: 13 days ago
JSON representation
Extract all the texts of any project with HTML files and generate a KV (Key-Value) file, key = reference key, value = extracted text.
- Host: GitHub
- URL: https://github.com/juliandavidmr/text2locale
- Owner: juliandavidmr
- License: mit
- Created: 2020-10-10T22:29:26.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-10-11T00:30:39.000Z (over 5 years ago)
- Last Synced: 2025-02-24T02:28:23.022Z (over 1 year ago)
- Topics: extract, html-files, i18n, text-extraction
- Language: JavaScript
- Homepage:
- Size: 328 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# **text2locale**
Extract all the texts of any project with HTML files and generate a KV (Key-Value) file,
`key` = reference key, `value` = extracted text.
## Install
```sh
npm install -g github:juliandavidmr/text2locale
```
## Usage
```bash
$ text2locale input "./example/src" -o "./example/locale/" -l en -t es,de,zh
```
> More command info: `$ text2locale input --help`
## API
### `input` command options
| Option | Description | Default |
|---------------------|----------------------------------------|---------|
| `-l`, `--lang` | Language of the texts to be extracted. | `en` |
| `-o`, `--output` | Output directory. | `./` |
| `-s`, `--separator` | Separator to generate the key names. | `_` |
| `-t`, `--templates` | Generate template for other languages. | `en,es` |
--------
## Whats Next?
The generated files can be manipulated by the [i18n-editor](https://juliandavidmr.github.io/i18n-editor/dist/#/layout) website, you can add/remove/edit all translation resources from multiple JSON files at the time.
## License
[MIT](./LICENSE)