@elgato/translate
v0.2.0
Published
Translate resource files using DeepL.
Downloads
104
Readme
@elgato/translate
Command-line tool for translating resource files with DeepL
Pre-requisites
- DeepL auth key
- English text in JSON or RESW format
Usage
- Install
@elgato/translate
npm install @elgato/translate -g- Run the initialization wizard
translate init- Translate resources
translate -k <DEEPL_AUTH_KEY>Configuration
Main configuration that defines the source texts, and target languages.
| Name | Type | Description | Required |
| ----------- | ----------------------------------------------------------------- | ------------------------------ | -------- |
| source | string | Path to the English text. | ✅ |
| targets | TargetLanguage[] | Languages to translate to. | ✅ |
| formality | "less", "prefer_less", "default", "prefer_more", "more" | Formality of the translations. | |
TargetLanguage
Target languages the source texts will be translated to.
| Name | Type | Description | Required |
| ----------- | ----------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------- |
| code | string | Language code, learn more. | ✅ |
| formality | "less", "prefer_less", "default", "prefer_more", "more" | Formality of the translations. | |
| file | string | Output file. | |
| glossary | string | DeepL glossary identifier. | |
| overrides | Override[] | Manual overrides. | |
Override
Allows for manual translations.
| Name | Type | Description | Required |
| ------ | -------- | ----------------------------------------------------------- | -------- |
| text | string | Text that should not be translated with the remote service. | ✅ |
| out | string | Output text; when unspecified, the original text is output. | |
CLI Options
-k, --auth-key <auth_key>
- Default:
undefined(required) - Type: String
The DeepL authentication key used to translate text with DeepL
-c, --config <path>
- Default:
translations.config.json - Type: String
Path to the configuration file.
