mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
configpanels: auto add i18n help for an arg if present in locales
This commit is contained in:
parent
e4df838d9d
commit
6295374fdb
1 changed files with 4 additions and 0 deletions
|
@ -527,6 +527,7 @@ class ConfigPanel:
|
|||
"filter",
|
||||
"readonly",
|
||||
"enabled",
|
||||
# "confirm", # TODO: to ask confirmation before running an action
|
||||
],
|
||||
"defaults": {},
|
||||
},
|
||||
|
@ -669,6 +670,9 @@ class ConfigPanel:
|
|||
for panel, section, option in self._iterate():
|
||||
if "ask" not in option:
|
||||
option["ask"] = m18n.n(self.config["i18n"] + "_" + option["id"])
|
||||
# auto add i18n help text if present in locales
|
||||
if m18n.key_exists(self.config["i18n"] + "_" + option["id"] + '_help'):
|
||||
option["help"] = m18n.n(self.config["i18n"] + "_" + option["id"] + '_help')
|
||||
|
||||
def display_header(message):
|
||||
"""CLI panel/section header display"""
|
||||
|
|
Loading…
Add table
Reference in a new issue