Commit ef33a69d authored by David Edmundson's avatar David Edmundson

Sort keys in json encoder

Should supress scripty noise.

The previous manualy sorting above was ultimately useless as it's stored
as a map internally inside the json blob. We need to sort when writing out,
it turns out there's an argument for that.

Test Plan:
Ran script
Still got some output.
Running twice didn't change output

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision:
parent 8b92ae56
......@@ -52,7 +52,7 @@ outTranslations = {}
with open(enPath, 'r') as infile:
enData = json.load(infile)
for msgId in sorted(enData):
for msgId in enData:
msg = ""
if msgId in translations:
msg = translations[msgId]
......@@ -60,4 +60,4 @@ for msgId in sorted(enData):
msg = enData[msgId]["message"]
outTranslations[msgId] = {"message" : msg}
outfile.write(json.JSONEncoder(indent=4, ensure_ascii=False).encode(outTranslations))
outfile.write(json.JSONEncoder(indent=4, ensure_ascii=False, sort_keys=True).encode(outTranslations))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment