diff --git a/edx_notifications/locale/zh-cn/LC_MESSAGES/django.mo b/edx_notifications/locale/zh_CN/LC_MESSAGES/django.mo similarity index 100% rename from edx_notifications/locale/zh-cn/LC_MESSAGES/django.mo rename to edx_notifications/locale/zh_CN/LC_MESSAGES/django.mo diff --git a/edx_notifications/locale/zh-cn/LC_MESSAGES/django.po b/edx_notifications/locale/zh_CN/LC_MESSAGES/django.po similarity index 100% rename from edx_notifications/locale/zh-cn/LC_MESSAGES/django.po rename to edx_notifications/locale/zh_CN/LC_MESSAGES/django.po diff --git a/edx_notifications/stores/sql/models.py b/edx_notifications/stores/sql/models.py index e484b3f5..8a1f027d 100644 --- a/edx_notifications/stores/sql/models.py +++ b/edx_notifications/stores/sql/models.py @@ -133,18 +133,10 @@ def to_data_object(self, options=None): # pylint: disable=unused-argument return msg def translate_payload_title(self, payload): - announcement_date = payload['announcement_date'] - - # print "///////////###############//////////////////" - # print (_(title[0])) - # print (title[0]) - # title = "{} {} {} {} {}".format(_(title[0]), _(title[1]), title[2], title[3], title[4]) - # print "///////////###############//////////////////" - # print (title) - - title = _('Announcement on {annoucement_date}').format(annoucement_date=announcement_date) - - payload['title'] = title + if payload and 'notification_type' in payload and payload['notification_type'] == "courseannouncement": + announcement_date = payload['announcement_date'] + title = _('Announcement on {annoucement_date}').format(annoucement_date=announcement_date) + payload['title'] = title return payload @classmethod