This project provides a script for comparing and translating Redborder YAML files while ensuring hierarchical structures are preserved and merged correctly. It is designed to handle nested dictionaries and integrate with the DeepL API for language translation.
- Python 3.x
- Pip
- Libraries:
pyyaml
requests
- DeepL API key
-
Clone the repository:
git clone https://github.com/your-username/yaml-translation-tool.git cd yaml-translation-tool
-
Install the required dependencies:
pip install pyyaml requests
-
Register in DeepL and paste your API key in the line 102 of the yamlComparer.py script:
"auth_key": "INSERT YOUR API KEY"
-
Prepare Your YAML Files:
- Place the script in the same directory as your .yaml files or edit the script file paths to match the path to your .yaml files.
-
Select both languages:
- In the line 138 and 139 of the script you can change the languages you want to translate from and to.
file1Path = 'en.yml' file2Path = 'es.yml'
-
Run the Script:
python yamlComparer.py
-
Translation Workflow:
- The script will:
- Load the two YAML files.
- Compare the keys between them.
- Prompt you to translate missing keys.
- Write the updated translations back into the target YAML file.
- The script will:
This project is licensed under the MIT License.