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/automember.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ipalib/plugins/automember.py') diff --git a/ipalib/plugins/automember.py b/ipalib/plugins/automember.py index 3b652185..fabc9bb3 100644 --- a/ipalib/plugins/automember.py +++ b/ipalib/plugins/automember.py @@ -185,7 +185,7 @@ class automember(LDAPObject): try: (gdn, entry_attrs) = ldap.get_entry(dn, []) except errors.NotFound: - raise errors.NotFound(reason=_(u'Group: %s not found!' % groupname)) + raise errors.NotFound(reason=_(u'Group: %s not found!') % groupname) return gdn def get_dn(self, *keys, **options): @@ -212,7 +212,7 @@ class automember(LDAPObject): if obj is not None: return obj else: - raise errors.NotFound(reason=_('%s is not a valid attribute.' % attr)) + raise errors.NotFound(reason=_('%s is not a valid attribute.') % attr) api.register(automember) @@ -283,7 +283,7 @@ class automember_add_condition(LDAPUpdate): try: (tdn, test_attrs) = ldap.get_entry(dn, []) except errors.NotFound: - raise errors.NotFound(reason=_(u'Auto member rule: %s not found!' % keys[0])) + raise errors.NotFound(reason=_(u'Auto member rule: %s not found!') % keys[0]) # Define container key key = options['key'] # Check to see if the attribute is valid @@ -369,7 +369,7 @@ class automember_remove_condition(LDAPUpdate): try: (tdn, test_attrs) = ldap.get_entry(dn, []) except errors.NotFound: - raise errors.NotFound(reason=_(u'Auto member rule: %s not found!' % keys[0])) + raise errors.NotFound(reason=_(u'Auto member rule: %s not found!') % keys[0]) # Define container key type_attr_default = {'group': 'manager', 'hostgroup': 'fqdn'} -- cgit