summaryrefslogtreecommitdiff
path: root/django/utils/dates.py
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2010-12-13 13:51:28 +0000
committerJannis Leidel <jannis@leidel.info>2010-12-13 13:51:28 +0000
commit7292af85422980df3fefcd0ce131f8a37fe466e9 (patch)
tree17f6383a2c90aae34dea41418f9499131193d806 /django/utils/dates.py
parentdc8c4f087980dc746e41bebc47a53f95a0cbb0c3 (diff)
Fixed #14570 -- Added new date format character for alternative month names using the new context capabilities. Also add context to Associated Press style month names (refs #9988). Thanks to Claude and shell_dweller.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14899 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/utils/dates.py')
-rw-r--r--django/utils/dates.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/django/utils/dates.py b/django/utils/dates.py
index 4427af8ca9..e732bec629 100644
--- a/django/utils/dates.py
+++ b/django/utils/dates.py
@@ -1,6 +1,6 @@
"Commonly-used date structures"
-from django.utils.translation import ugettext_lazy as _
+from django.utils.translation import ugettext_lazy as _, pgettext_lazy
WEEKDAYS = {
0:_('Monday'), 1:_('Tuesday'), 2:_('Wednesday'), 3:_('Thursday'), 4:_('Friday'),
@@ -31,3 +31,17 @@ MONTHS_AP = { # month names in Associated Press style
1:_('Jan.'), 2:_('Feb.'), 3:_('March'), 4:_('April'), 5:_('May'), 6:_('June'), 7:_('July'),
8:_('Aug.'), 9:_('Sept.'), 10:_('Oct.'), 11:_('Nov.'), 12:_('Dec.')
}
+MONTHS_ALT = { # required for long date representation by some locales
+ 1: pgettext_lazy('alt. month', 'January'),
+ 2: pgettext_lazy('alt. month', 'February'),
+ 3: pgettext_lazy('alt. month', 'March'),
+ 4: pgettext_lazy('alt. month', 'April'),
+ 5: pgettext_lazy('alt. month', 'May'),
+ 6: pgettext_lazy('alt. month', 'June'),
+ 7: pgettext_lazy('alt. month', 'July'),
+ 8: pgettext_lazy('alt. month', 'August'),
+ 9: pgettext_lazy('alt. month', 'September'),
+ 10: pgettext_lazy('alt. month', 'October'),
+ 11: pgettext_lazy('alt. month', 'November'),
+ 12: pgettext_lazy('alt. month', 'December')
+}