summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-12-06 17:32:40 +0000
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-12-06 17:32:40 +0000
commit76109c3c16fc5b6bf163eae0d2a21085bfcfcc8b (patch)
tree2ff02a39433b619a84430391640d577172fcb9f4
parent4658e8acdbb17c67f3b84e412ee37c810c3af549 (diff)
downloadpykolab-76109c3c16fc5b6bf163eae0d2a21085bfcfcc8b.tar.gz
First translate, then lowercase the mail attributes.
-rw-r--r--pykolab/plugins/recipientpolicy/__init__.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/pykolab/plugins/recipientpolicy/__init__.py b/pykolab/plugins/recipientpolicy/__init__.py
index 94e2349..fd04e39 100644
--- a/pykolab/plugins/recipientpolicy/__init__.py
+++ b/pykolab/plugins/recipientpolicy/__init__.py
@@ -63,10 +63,14 @@ class KolabRecipientpolicy(object):
try:
mail = kw['primary_mail'] % user_attrs
- return utils.translate(mail.lower(), user_attrs['preferredLanguage'])
+ mail = utils.translate(mail, user_attrs['preferredlanguage'])
+ mail = mail.lower()
+ return mail
except KeyError, e:
log.warning(_("Attribute substitution for 'mail' failed in Recipient Policy"))
- return user_attrs['mail'].lower()
+ mail = utils.translate(user_attrs['mail'], user_attrs['preferredlanguage'])
+ mail = mail.lower()
+ return mail
def set_secondary_mail(self, *args, **kw):
"""
@@ -105,7 +109,7 @@ class KolabRecipientpolicy(object):
log.warning(_("Attribute substitution for 'alternative_mail' failed in Recipient Policy"))
#log.debug(_("Appending additional mail address: %s") %(retval), level=8)
- alternative_mail.append(utils.translate(retval), user_attrs['preferredLanguage'])
+ alternative_mail.append(utils.translate(retval, user_attrs['preferredlanguage']))
for _domain in kw['secondary_domains']:
user_attrs['domain'] = _domain
@@ -115,7 +119,7 @@ class KolabRecipientpolicy(object):
log.warning(_("Attribute substitution for 'alternative_mail' failed in Recipient Policy"))
#log.debug(_("Appending additional mail address: %s") %(retval), level=8)
- alternative_mail.append(utils.translate(retval))
+ alternative_mail.append(utils.translate(retval, user_attrs['preferredlanguage']))
alternative_mail = utils.normalize(alternative_mail)