This app or script is used to automatically Google Translate a ZIP export from R20Exporter
- Launch the app. On macOS you might need to right clic > Open as the app is not signed.
- Select you original ZIP file
- Select the lang to translate to
- Run
The processing will take a while (can take several hours for big campaign) and a new ZIP will be created in the same folder as the source one. 💡 Sometimes logs do not appear live during processing. Be patient they will appear at the end.
You can select a folder containing as many CSV files as you like. The CSV must be a 2 columns CSV with the english value in the first column and the translated one in the second.
Giant Bear, Ours Géant
Neverwinter, Padhiver
💡 Note that you should also include plurals.
💡 When you run the app it will also output a file name $campaign_proper_nous_$lang.csv
this is a tentative to export the propers nouns in the campaign. You can use this as a template and move it in your custom translations folder.
On a second run the processing willl be much faster as the translations are stored.
The app embarks some generic DnD translation in translations_db/$lang
. You can opt-in to also use those.
Your custom translations always have priority.
Feel free to make a PR to add some !
If some translations fail an error will be displayed, indicating that the translated ZIP might partially translated.
It mostly can occur on:
- random errors
- some kind on limit reached on Google Translate.
- Since we cut text to translate smaller part we might have tried to translate some special characters
You can scroll the logs to see what when wrong and decide if you want to relaunch the process. It will complete the translations (if possible) and recreate the ZIP file.
💡 If you reached some kind of Google Limit, you might need to wait one day, otherwise translations will continue to fail.
- You must have Python installed. Setup your usual venv.
- If you intend to use the GUI, install Gooey fork manually. It is a fork from Gooey that better handles dark mode.
> pip install git+https://github.com/nicolasbraun/Gooey.git@feat/better_dark_mode#egg=gooey
- Install dependencies
pip install -r requirements.txt
- Run the script commands.
> python3 main.py $OPTIONS # CLI
> python3 main_with_gui.py # GUI
Note: The translations might fail if you reach some kind off limit on Google side (or any other error). It that case the translated ZIP will be created but is partially translated. Simply relaunch the process until all translations have passed and the ZIP is created.
- Use DnD offical translation packages
- What was a script grew bigger. Could use some refactoring
- Need to have install python from the official packager with universal2 architectures
- Create a venv using the x86_64 python executable
python3-intel64 -m venv venv
- activate
source venv/bin/activate
- In the venv
# install requirements
> python -m pip install 'git+https://github.com/nicolasbraun/Gooey.git@feat/better_dark_mode#egg=gooey'
> python -m pip install -r requirements.txt
# Then use the pyinstaller command
> pyinstaller --onefile --windowed --target-arch x86_64 --add-data 'translations_db:translations_db' -n R20Translator_mac_x86_64 main_with_gui.py
pyinstaller --onefile --windowed --target-arch arm64 --add-data 'translations_db:translations_db' -n R20Translator_mac_arm64 main_with_gui.py