From 90d99f6017c934541a5263f4ccd708ad7c36491f Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Fri, 10 Feb 2012 04:27:53 -0500 Subject: Clean up i18n strings This patch switches to named ("%(name)s") instead of positional ("%s") substitutions for internationalized strings, so translators can reorder the words. This fixes https://fedorahosted.org/freeipa/ticket/2179 (xgettext no longer gives warnings). Also, some i18n calls are rewritten to translate the template before substitutions, not after. --- ipalib/plugins/sudorule.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ipalib/plugins/sudorule.py') diff --git a/ipalib/plugins/sudorule.py b/ipalib/plugins/sudorule.py index 05fba455d..ff7b756a3 100644 --- a/ipalib/plugins/sudorule.py +++ b/ipalib/plugins/sudorule.py @@ -587,8 +587,8 @@ class sudorule_add_option(LDAPQuery): return dict(result=entry_attrs) def output_for_cli(self, textui, result, cn, **options): - textui.print_dashed(_('Added option "%s" to Sudo Rule "%s"') % \ - (options['ipasudoopt'], cn)) + textui.print_dashed(_('Added option "%(option)s" to Sudo Rule "%(rule)s"') % \ + dict(option=options['ipasudoopt'], rule=cn)) super(sudorule_add_option, self).output_for_cli(textui, result, cn, options) @@ -642,8 +642,8 @@ class sudorule_remove_option(LDAPQuery): return dict(result=entry_attrs) def output_for_cli(self, textui, result, cn, **options): - textui.print_dashed(_('Removed option "%s" from Sudo Rule "%s"') % \ - (options['ipasudoopt'], cn)) + textui.print_dashed(_('Removed option "%(option)s" from Sudo Rule "%(rule)s"') % \ + dict(option=options['ipasudoopt'], rule=cn)) super(sudorule_remove_option, self).output_for_cli(textui, result, cn, options) api.register(sudorule_remove_option) -- cgit