Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sillytavern/sillytavern-i18n
Tools for working with frontend localization files.
https://github.com/sillytavern/sillytavern-i18n
i18n
Last synced: about 3 hours ago
JSON representation
Tools for working with frontend localization files.
- Host: GitHub
- URL: https://github.com/sillytavern/sillytavern-i18n
- Owner: SillyTavern
- License: agpl-3.0
- Created: 2024-06-01T17:49:05.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-06-09T17:19:21.000Z (5 months ago)
- Last Synced: 2024-06-09T18:43:00.177Z (5 months ago)
- Topics: i18n
- Language: Python
- Homepage:
- Size: 45.9 KB
- Stars: 1
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SillyTavern-i18n
Tools for working with frontend localization files.
## Features
1. Automatically add new keys to translate from HTML files.
2. Prune missing keys from localization files.
3. Use automatic Google translation to auto-populate missing values.
4. Sort JSON files by keys.## Usage
```txt
usage: generate.py [-h] [-d DIRECTORY] [--auto-add] [--auto-translate] [--auto-remove] [--sort-keys]
jsonUpdate or Generate i18n JSON files
positional arguments:
json JSON file pathoptions:
-h, --help show this help message and exit
-d DIRECTORY, --directory DIRECTORY
Directory path
--auto-add Auto add missing keys
--auto-translate Auto translate missing keys when they are added
--auto-remove Auto remove extra keys
--sort-keys Sort keys as they appear in i18n dataset
```Dependencies: Python 3.10 and up.
1) Install the requirements.
```bash
pip install -r ./requirements.txt
```2) Run `generate.py` **while in the SillyTavern directory**.
Example (update for `zh-cn` file, sort keys):
```bash
cd ~/SillyTavern
python ~/SillyTavern-i18n/generate.py zh-cn --sort-keys
```3) Commit and PR changes to the SillyTavern repository.
## License and credits
AGPLv3
* Original idea and implementation by [Zhongyi-Lu](https://github.com/Zhongyi-Lu)
* Improvements by [steve02081504](https://github.com/steve02081504)