mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
questions: improve support for group question used in manifestv2
This commit is contained in:
parent
556e75ef08
commit
5cfa0d3be8
3 changed files with 15 additions and 0 deletions
|
@ -4,6 +4,8 @@
|
|||
"additional_urls_already_added": "Additionnal URL '{url}' already added in the additional URL for permission '{permission}'",
|
||||
"additional_urls_already_removed": "Additionnal URL '{url}' already removed in the additional URL for permission '{permission}'",
|
||||
"admin_password": "Administration password",
|
||||
"admins": "Admins",
|
||||
"all_users": "All YunoHost users",
|
||||
"already_up_to_date": "Nothing to do. Everything is already up-to-date.",
|
||||
"app_action_broke_system": "This action seems to have broken these important services: {services}",
|
||||
"app_action_failed": "Failed to run action {action} for app {app}",
|
||||
|
@ -34,6 +36,8 @@
|
|||
"app_manifest_install_ask_is_public": "Should this app be exposed to anonymous visitors?",
|
||||
"app_manifest_install_ask_password": "Choose an administration password for this app",
|
||||
"app_manifest_install_ask_path": "Choose the URL path (after the domain) where this app should be installed",
|
||||
"app_manifest_install_ask_init_main_permission": "Who should have access to this app? (This can later be changed)",
|
||||
"app_manifest_install_ask_init_admin_permission": "Who should have access to admin features for this app? (This can later be changed)",
|
||||
"app_not_correctly_installed": "{app} seems to be incorrectly installed",
|
||||
"app_not_installed": "Could not find {app} in the list of installed apps: {all_apps}",
|
||||
"app_not_properly_removed": "{app} has not been properly removed",
|
||||
|
@ -722,6 +726,7 @@
|
|||
"user_unknown": "Unknown user: {user}",
|
||||
"user_update_failed": "Could not update user {user}: {error}",
|
||||
"user_updated": "User info changed",
|
||||
"visitors": "Visitors",
|
||||
"yunohost_already_installed": "YunoHost is already installed",
|
||||
"yunohost_configured": "YunoHost is now configured",
|
||||
"yunohost_installing": "Installing YunoHost...",
|
||||
|
|
|
@ -2021,6 +2021,8 @@ def _set_default_ask_questions(questions, script_name="install"):
|
|||
("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
|
||||
("group", "init_main_permission"), # i18n: app_manifest_install_ask_init_main_permission
|
||||
("group", "init_admin_permission"), # i18n: app_manifest_install_ask_init_admin_permission
|
||||
]
|
||||
|
||||
for question_name, question in questions.items():
|
||||
|
|
|
@ -1341,6 +1341,14 @@ class GroupQuestion(Question):
|
|||
|
||||
self.choices = list(user_group_list(short=True)["groups"])
|
||||
|
||||
def _human_readable_group(g):
|
||||
# i18n: visitors
|
||||
# i18n: all_users
|
||||
# i18n: admins
|
||||
return m18n.n(g) if g in ["visitors", "all_users", "admins"] else g
|
||||
|
||||
self.choices = {g:_human_readable_group(g) for g in self.choices}
|
||||
|
||||
if self.default is None:
|
||||
self.default = "all_users"
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue