From ab6d8c529f1391a6648d577aeafa506d3828a7f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Fri, 21 Nov 2014 11:06:29 +0100 Subject: [PATCH] [fix] Do not translate authenticator's help message in MoulinetteSignals --- moulinette/core.py | 6 +----- moulinette/interfaces/cli.py | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/moulinette/core.py b/moulinette/core.py index 0dc3c1f8..6bb03a1b 100644 --- a/moulinette/core.py +++ b/moulinette/core.py @@ -372,7 +372,7 @@ class MoulinetteSignals(object): Keyword arguments: - authenticator -- The authenticator object to use - - help -- A help message for the authenticator + - help -- The translation key of the authenticator's help message Returns: The authenticator object @@ -380,10 +380,6 @@ class MoulinetteSignals(object): """ if authenticator.is_authenticated: return authenticator - - # Retrieve help translation since it's not loaded yet - if help: - help = m18n.n(help) return self._authenticate(authenticator, help) def prompt(self, message, is_password=False, confirm=False): diff --git a/moulinette/interfaces/cli.py b/moulinette/interfaces/cli.py index 270d7246..07cdced0 100644 --- a/moulinette/interfaces/cli.py +++ b/moulinette/interfaces/cli.py @@ -218,7 +218,7 @@ class Interface(BaseInterface): """ # TODO: Allow token authentication? - msg = help or m18n.g('password') + msg = m18n.n(help) if help else m18n.g('password') return authenticator(password=self._do_prompt(msg, True, False, color='yellow'))