mirror of
https://github.com/YunoHost/apps.git
synced 2024-09-03 20:06:07 +02:00
[enh] help keys are now translatables
This commit is contained in:
parent
2cafc7f4b2
commit
317b417842
2 changed files with 10 additions and 1 deletions
|
@ -51,9 +51,14 @@ def include_translations_in_manifest(app_name, manifest):
|
||||||
for question in questions:
|
for question in questions:
|
||||||
key = "%s_manifest_arguments_%s_%s" % (app_name, category, question["name"])
|
key = "%s_manifest_arguments_%s_%s" % (app_name, category, question["name"])
|
||||||
if key in translations and translations[key]:
|
if key in translations and translations[key]:
|
||||||
print current_lang, key
|
print "[ask]", current_lang, key
|
||||||
question["ask"][current_lang] = translations[key]
|
question["ask"][current_lang] = translations[key]
|
||||||
|
|
||||||
|
key = "%s_manifest_arguments_%s_help_%s" % (app_name, category, question["name"])
|
||||||
|
if key in translations and translations[key]:
|
||||||
|
print "[help]", current_lang, key
|
||||||
|
question["help"][current_lang] = translations[key]
|
||||||
|
|
||||||
return manifest
|
return manifest
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,4 +19,8 @@ if __name__ == '__main__':
|
||||||
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"]
|
||||||
|
|
||||||
|
if "en" in question.get("help", {}):
|
||||||
|
key = "%s_manifest_arguments_%s_help_%s" % (app, category, question["name"])
|
||||||
|
en[key] = question["help"]["en"]
|
||||||
|
|
||||||
open("locales/en.json", "w").write(json.dumps(en, sort_keys=True, indent=4))
|
open("locales/en.json", "w").write(json.dumps(en, sort_keys=True, indent=4))
|
||||||
|
|
Loading…
Add table
Reference in a new issue