Changed string delimiters form ' to ". Moved the webmail locale datetime formatting settings to new settings.py in webmail module.

This commit is contained in:
Christian Wiegand
2016-10-06 15:53:44 +02:00
parent 169d07b8fa
commit 0fd1fafef3
2 changed files with 2 additions and 24 deletions
+2 -4
View File
@@ -100,7 +100,5 @@ def extra_static_content(caller, st_type, user):
@register.filter(name='localize_header_name')
def localize_header_name(headername):
""" Localizes the header names """
names = {'From': _('From'), 'To': _('To'), 'Date': _('Date'), 'Subject': _('Subject')}
if names.has_key(headername):
return names[headername]
return headername
names = {"From": _("From"), "To": _("To"), "Date": _("Date"), "Subject": _("Subject")}
return names.get(headername, headername)
-20
View File
@@ -106,26 +106,6 @@ USE_L10N = False
USE_TZ = True
# Webmail datetime formats according to
# https://docs.djangoproject.com/en/1.10/ref/templates/builtins/
# modoboa-webmail is able to show the datetime of emails
# in two ways.
# If none is provided, default is RFC 5322 formatted date.
# For this, USE_L10N must be set to True!
# emails of the last week
# en-us style
WEBMAIL_SHORT_DATETIME_FORMAT = "l, P"
# european style
# WEBMAIL_SHORT_DATETIME_FORMAT = "l, H:i"
# emails older than a week
# en-us style
WEBMAIL_DATETIME_FORMAT = "N, j Y P"
# european style
# WEBMAIL_DATETIME_FORMAT = "d. N Y H:i"
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.6/howto/static-files/