mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
[enh] Better confirmation prompting
This commit is contained in:
parent
7145039e89
commit
594a1a3c32
3 changed files with 4 additions and 3 deletions
|
@ -17,7 +17,7 @@
|
|||
"argument_required" : "Argument {:s} is required",
|
||||
"password" : "Password",
|
||||
"invalid_password" : "Invalid password",
|
||||
"confirm" : "Confirm",
|
||||
"confirm" : "Confirm {:s}",
|
||||
"values_mismatch" : "Values don't match",
|
||||
"authentication_required_long" : "Authentication is required to perform this action",
|
||||
"authentication_required" : "Authentication required",
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
"argument_required" : "L'argument {:s} est requis",
|
||||
"password" : "Mot de passe",
|
||||
"invalid_password" : "Mot de passe incorrect",
|
||||
"confirm" : "Confirmez",
|
||||
"confirm" : "Confirmez le {:s}",
|
||||
"values_mismatch" : "Les valeurs ne correspondent pas",
|
||||
"authentication_required_long" : "L'authentification est requise pour exécuter cette action",
|
||||
"authentication_required" : "Authentification requise",
|
||||
|
|
|
@ -239,7 +239,8 @@ class Interface(BaseInterface):
|
|||
value = prompt(message)
|
||||
|
||||
if confirm:
|
||||
if prompt('%s %s' % (m18n.g('confirm'), message)) != value:
|
||||
m = message[0].lower() + message[1:]
|
||||
if prompt(m18n.g('confirm', m)) != value:
|
||||
raise MoulinetteError(errno.EINVAL, m18n.g('values_mismatch'))
|
||||
|
||||
return value
|
||||
|
|
Loading…
Reference in a new issue