-
Notifications
You must be signed in to change notification settings - Fork 36
Workflow for JSON dump files
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.
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
.