Fix i18n string test

This commit is contained in:
Alexandre Aubin 2020-05-07 00:07:10 +02:00
parent c7dd881774
commit 882b003bd7
2 changed files with 10 additions and 7 deletions

View file

@ -2103,11 +2103,11 @@ def _set_default_ask_questions(arguments):
# type namei
# N.B. : this is only for install script ... should be reworked for other
# scripts if we supports args for other scripts in the future...
questions_with_default = [("domain", "domain"),
("path", "path"),
("password", "password"),
("user", "admin"),
("boolean", "is_public")]
questions_with_default = [("domain", "domain"), # i18n: app_manifest_install_ask_domain
("path", "path"), # i18n: app_manifest_install_ask_path
("password", "password"), # i18n: app_manifest_install_ask_password
("user", "admin"), # i18n: app_manifest_install_ask_admin
("boolean", "is_public")] # i18n: app_manifest_install_ask_is_public
for script_name, arg_list in arguments.items():
@ -2118,7 +2118,7 @@ def _set_default_ask_questions(arguments):
for arg in arg_list:
# Do not override 'ask' field if provided by app ?... Or shall we ?
#if "ask" in arg:
# if "ask" in arg:
# continue
# If this arg corresponds to a question with default ask message...
@ -2130,7 +2130,6 @@ def _set_default_ask_questions(arguments):
return arguments
def _get_git_last_commit_hash(repository, reference='HEAD'):
"""
Attempt to retrieve the last commit hash of a git repository

View file

@ -23,8 +23,10 @@ def find_expected_string_keys():
# Try to find :
# m18n.n( "foo"
# YunohostError("foo"
# # i18n: foo
p1 = re.compile(r'm18n\.n\(\s*[\"\'](\w+)[\"\']')
p2 = re.compile(r'YunohostError\([\'\"](\w+)[\'\"]')
p3 = re.compile(r'# i18n: [\'\"]?(\w+)[\'\"]?')
python_files = glob.glob("src/yunohost/*.py")
python_files.extend(glob.glob("src/yunohost/utils/*.py"))
@ -42,6 +44,8 @@ def find_expected_string_keys():
if m.endswith("_"):
continue
yield m
for m in p3.findall(content):
yield m
# For each diagnosis, try to find strings like "diagnosis_stuff_foo" (c.f. diagnosis summaries)
# Also we expect to have "diagnosis_description_<name>" for each diagnosis