Commit 2d0a99ce authored by David Edmundson's avatar David Edmundson
Browse files

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 a8152f26
......@@ -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))
Supports Markdown
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