Bug 34983: Force a sort order in JSON output of po2json
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Wed, 4 Oct 2023 13:04:27 +0000 (15:04 +0200)
committerFridolin Somers <fridolin.somers@biblibre.com>
Thu, 26 Oct 2023 06:53:08 +0000 (20:53 -1000)
commit82d4eff906cf0b88b001cfe2f43f15d8e63f6ca6
tree627119c734032a1169ce550be5fa00d3a9a9cbfd
parent0c3807caa01e6ffcf01028928fc226081f5d9c61
Bug 34983: Force a sort order in JSON output of po2json

This patch does so by default. If you do not want them sorted,
export CANONICAL-0 on the command line.

Test plan:
Copy a staff PO file from misc/translator to test.po
Now run:   time misc/translator/po2json test.po > json1
And do:    time misc/translator/po2json test.po > json2
Run:       diff json1 json2; #They should be the same.
Now:       export CANONICAL=0
And run:   time misc/translator/po2json test.po > json3
And again: time misc/translator/po2json test.po > json4
And run:   diff json3 json4; # Lots of changes
Remove the created cruft. And signoff :)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a5fc346403665cf6eb692f401bf1cca5ece3cb81)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
misc/translator/po2json