summaryrefslogtreecommitdiffstats
path: root/wallace/module_resources.py
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-07-22 10:03:03 -0400
committerThomas Bruederli <bruederli@kolabsys.com>2014-07-22 10:03:03 -0400
commitb3e6648328dd00dd53e60633b23a40ed6ff578e5 (patch)
tree110102750c6222af2e7fc7944c004056448e6700 /wallace/module_resources.py
parent9876593d6551fe4e7dcd7ce93011f70ebab5b8a1 (diff)
downloadpykolab-b3e6648328dd00dd53e60633b23a40ed6ff578e5.tar.gz
Test localized notifications from iTip messages
Diffstat (limited to 'wallace/module_resources.py')
-rw-r--r--wallace/module_resources.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/wallace/module_resources.py b/wallace/module_resources.py
index dba2653..b31a8d0 100644
--- a/wallace/module_resources.py
+++ b/wallace/module_resources.py
@@ -100,6 +100,9 @@ def cleanup():
def execute(*args, **kw):
global auth, imap
+ # (re)set language to default
+ pykolab.translate.setUserLanguage(conf.get('kolab','default_locale'))
+
if not os.path.isdir(mybasepath):
os.makedirs(mybasepath)
@@ -875,6 +878,8 @@ def send_response(from_address, itip_events, owner=None):
attendee = itip_event['xml'].get_attendee_by_email(from_address)
participant_status = itip_event['xml'].get_ical_attendee_participant_status(attendee)
+ # TODO: look-up event organizer in LDAP and change localization to its preferredlanguage
+
message_text = reservation_response_text(participant_status, owner)
subject_template = _("Reservation Request for %(summary)s was %(status)s")
@@ -944,6 +949,10 @@ def send_owner_notification(resource, owner, itip_event, success=True):
level=8
)
+ # change gettext language to the preferredlanguage setting of the resource owner
+ if owner.has_key('preferredlanguage'):
+ pykolab.translate.setUserLanguage(owner['preferredlanguage'])
+
message_text = owner_notification_text(resource, owner, itip_event['xml'], success)
msg = MIMEText(utils.stripped_message(message_text))