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.
This commit is contained in:
Petr Viktorin
2012-02-10 04:27:53 -05:00
committed by Martin Kosek
parent eba3a341e6
commit 90d99f6017
5 changed files with 21 additions and 19 deletions

View File

@@ -241,8 +241,8 @@ class config_mod(LDAPUpdate):
continue
if obj_attr not in new_allowed_attrs:
raise errors.ValidationError(name=attr,
error=_('%s default attribute %s would not be allowed!') \
% (obj, obj_attr))
error=_('%(obj)s default attribute %(attr)s would not be allowed!') \
% dict(obj=obj, attr=obj_attr))
if 'ipaselinuxusermapdefault' in options and options['ipaselinuxusermapdefault'] is None:
raise errors.ValidationError(name='ipaselinuxusermapdefault',