Skip to content

Workflow for JSON dump files

Aaron van Geffen edited this page Oct 25, 2020 · 4 revisions

The Localisation repository contains an objects folder. The JSON files in this folder can be used by translators to easily update strings in the objects repository. This document is intended to detail the workflow used to exchange information between these so-called dump files and the official JSON objects.

Creating a dump file for one language

A dump file for one particular language can be created by invoking language_dump.py, e.g.:

$ ./language_dump.py \
    -l ja-JP \
    -d ja-JP-all.json

This will create a file ja-JP-all.json containing all object strings, ordered by filename. It may be more practical to order them by English identifier, however. This is not done by the script, but can easily be done with a tool like jq:

$ jq 'to_entries | sort_by(.value."reference-name") | from_entries' \
    < ja-JP-all.json \
    > ja-JP-all-sorted.json

This takes ja-JP-all.json, orders its entries by their reference-name keys, and outputs the ordered version to ja-JP-all-sorted.json.

Creating a dump file for all languages

Importing information from a dump file

Importing information from all dump files

Clone this wiki locally