Repository: wagtail/wagtail

Issue:
Wagtail should not change month name translations
### Issue Summary

Wagtail translations overrides month name translations (at least for Slovenian language) which changes how dates are formatted.

### Steps to Reproduce

With wagtail installed:

```python
>>> from django.utils.translation import activate                                                                                                
>>> activate("sl")                                                                                                                               
>>> from django.utils import formats 
...                                                                                                                                              
>>> from datetime import date                                                                                                                    
>>> formats.date_format(date.today())                                                                                                            
'5. Avgust 2020'
```

It should be (and without wagtail installed it is) `5. avgust 2020`.

* I have confirmed that this issue can be reproduced as described on a fresh Wagtail project: (yes / no)

yes

### Technical details

* Python version: Run `python --version`.

Python 3.7.1

Django version: Look in your requirements.txt, or run `pip show django | grep Version`.

Version: 2.2.14

* Wagtail version: Look at the bottom of the Settings menu in the Wagtail admin, or run `pip show wagtail | grep Version:`.

Version: 2.9.2



Discussion:
This is visible in translation files:

Django

https://github.com/django/django/blob/master/django/conf/locale/sl/LC_MESSAGES/django.po#L919-L953

Wagtail

https://github.com/wagtail/wagtail/blob/b6455ecfb9d91b4a8f36f4f579dc969b1f705eba/wagtail/admin/locale/sl/LC_MESSAGES/django.po#L197-L231

Resolving patch:
diff --git a/wagtail/admin/localization.py b/wagtail/admin/localization.py
--- a/wagtail/admin/localization.py
+++ b/wagtail/admin/localization.py
@@ -1,6 +1,7 @@
 import pytz
 
 from django.conf import settings
+from django.utils.dates import MONTHS, WEEKDAYS, WEEKDAYS_ABBR
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext_lazy
 
@@ -76,38 +77,12 @@ def get_js_translation_strings():
         'VIEW_CHILD_PAGES_OF_PAGE': _('View child pages of \'{title}\''),
         'PAGE_EXPLORER': _('Page explorer'),
 
-        'MONTHS': [
-            _('January'),
-            _('February'),
-            _('March'),
-            _('April'),
-            _('May'),
-            _('June'),
-            _('July'),
-            _('August'),
-            _('September'),
-            _('October'),
-            _('November'),
-            _('December')
-        ],
-        'WEEKDAYS': [
-            _('Sunday'),
-            _('Monday'),
-            _('Tuesday'),
-            _('Wednesday'),
-            _('Thursday'),
-            _('Friday'),
-            _('Saturday')
-        ],
-        'WEEKDAYS_SHORT': [
-            _('Sun'),
-            _('Mon'),
-            _('Tue'),
-            _('Wed'),
-            _('Thu'),
-            _('Fri'),
-            _('Sat')
-        ]
+        'MONTHS': [str(m) for m in MONTHS.values()],
+
+        # Django's WEEKDAYS list begins on Monday, but ours should start on Sunday, so start
+        # counting from -1 and use modulo 7 to get an array index
+        'WEEKDAYS': [str(WEEKDAYS[d % 7]) for d in range(-1, 6)],
+        'WEEKDAYS_SHORT': [str(WEEKDAYS_ABBR[d % 7]) for d in range(-1, 6)],
     }
 
 


Test patch: