Tools for automating translation process between Oxygen builder and WPML
Since I don't want to copy/paste every translated text field from a page to another inside the Oxygen Builder,
I made a very simple python script to automate at the translation process.
(you will keep doing copy paste between the JSON of a page to the JSON of the translated page)
I just made also a bash script to stop copy pasting and upload everything automatically.
So now the method is the following:
- Upload oxy_json_exporter.php and execute on your website.
- Download JSON files.
- Extract POT file with oxy_translator.py
- Translate with your favorite tool and get .PO files
- Use bulk_run-upload-po2jsons.sh in order to translate and upload translated text.
- Enjoy!
Hope it helps someone.
Script that dumps from the database every JSON in every language
Usage is the following:
Upload the script inside your wp installation
visit the script address from the browser or from the command line using php cli
download the JSONs generated.
TODO:
transform in a WP plugin or in something that can be used remotely.
Script that can import/export contents and links from/to an Oxygen JSON file to/from a CSV/POT/PO file.
Usage is the following:
Method 1) extract a POT file out from a JSON file ./oxy_translator.py -p $SOURCE.json $DEST.pot
Method 2) translate a SOURCE_JSON file using a .PO file into a new DEST_JSON file ./oxy_translator.py -j $SOURCE_JSON $PO_FILE $DEST_JSON
CSV Methods are deprecated and should not be used anymore.
Extracts a single POT file out from many JSON files.
Bulk translate of many JSON files using a single PO file.
Scripts that automatically translates multiple JSON files (exported with oxy_json_exporter.php), translates them with a PO file and UPLOAD automatically in Wordpress!