diff options
author | Petr Viktorin <pviktori@redhat.com> | 2012-02-10 04:27:53 -0500 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2012-02-10 11:53:40 +0100 |
commit | 90d99f6017c934541a5263f4ccd708ad7c36491f (patch) | |
tree | 07d3596ba18675c99cc2656da8ca25814eb6185a /ipalib/plugins/baseldap.py | |
parent | eba3a341e607b542afabdedf0f6508e7c0a5e96c (diff) | |
download | freeipa-90d99f6017c934541a5263f4ccd708ad7c36491f.tar.gz freeipa-90d99f6017c934541a5263f4ccd708ad7c36491f.tar.xz freeipa-90d99f6017c934541a5263f4ccd708ad7c36491f.zip |
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.
Diffstat (limited to 'ipalib/plugins/baseldap.py')
-rw-r--r-- | ipalib/plugins/baseldap.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py index 66ba4eff3..66339ccad 100644 --- a/ipalib/plugins/baseldap.py +++ b/ipalib/plugins/baseldap.py @@ -1644,8 +1644,8 @@ class LDAPSearch(BaseLDAPCommand, crud.Search): Retrieve all LDAP entries matching the given criteria. """ member_attributes = [] - member_param_incl_doc = _('Search for %s with these %s %s.') - member_param_excl_doc = _('Search for %s without these %s %s.') + member_param_incl_doc = _('Search for %(searched_object)s with these %(relationship)s %(ldap_object)s.') + member_param_excl_doc = _('Search for %(searched_object)s without these %(relationship)s %(ldap_object)s.') # pointer to function for entries sorting # if no function is assigned the entries are sorted by their primary key value @@ -1684,18 +1684,20 @@ class LDAPSearch(BaseLDAPCommand, crud.Search): relationship = self.obj.relationships.get( attr, ['member', '', 'no_'] ) - doc = self.member_param_incl_doc % ( - self.obj.object_name_plural, relationship[0].lower(), - ldap_obj.object_name_plural + doc = self.member_param_incl_doc % dict( + searched_object=self.obj.object_name_plural, + relationship=relationship[0].lower(), + ldap_object=ldap_obj.object_name_plural ) name = '%s%s' % (relationship[1], to_cli(ldap_obj_name)) yield Str( '%s*' % name, cli_name='%ss' % name, doc=doc, label=ldap_obj.object_name, csv=True ) - doc = self.member_param_excl_doc % ( - self.obj.object_name_plural, relationship[0].lower(), - ldap_obj.object_name_plural + doc = self.member_param_excl_doc % dict( + searched_object=self.obj.object_name_plural, + relationship=relationship[0].lower(), + ldap_object=ldap_obj.object_name_plural ) name = '%s%s' % (relationship[2], to_cli(ldap_obj_name)) yield Str( |