mirror of
https://github.com/YunoHost/apps.git
synced 2024-09-03 20:06:07 +02:00
[enh] allow generate_translation_file to take several jsons
This commit is contained in:
parent
6bfee7b4da
commit
da693cc6bc
1 changed files with 28 additions and 21 deletions
|
@ -9,15 +9,19 @@ if __name__ == '__main__':
|
||||||
print "Abort"
|
print "Abort"
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
builded_file = json.load(open(sys.argv[1], "r"))
|
|
||||||
|
|
||||||
other_langs = {}
|
other_langs = {}
|
||||||
|
|
||||||
keys = []
|
keys = []
|
||||||
|
|
||||||
en = {}
|
en = {}
|
||||||
|
|
||||||
|
for builded_file in sys.argv[1:]:
|
||||||
|
builded_file = json.load(open(builded_file, "r"))
|
||||||
|
|
||||||
for app, data in builded_file.items():
|
for app, data in builded_file.items():
|
||||||
|
if "en" not in data["manifest"]["description"]:
|
||||||
|
continue
|
||||||
|
|
||||||
key = "%s_manifest_description" % app
|
key = "%s_manifest_description" % app
|
||||||
en[key] = data["manifest"]["description"]["en"]
|
en[key] = data["manifest"]["description"]["en"]
|
||||||
keys.append(key)
|
keys.append(key)
|
||||||
|
@ -31,6 +35,9 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
for category, questions in data["manifest"]["arguments"].items():
|
for category, questions in data["manifest"]["arguments"].items():
|
||||||
for question in questions:
|
for question in questions:
|
||||||
|
if "en" not in question["ask"]:
|
||||||
|
continue
|
||||||
|
|
||||||
key = "%s_manifest_arguments_%s_%s" % (app, category, question["name"])
|
key = "%s_manifest_arguments_%s_%s" % (app, category, question["name"])
|
||||||
en[key] = question["ask"]["en"]
|
en[key] = question["ask"]["en"]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue