Repository: TabbycatDebate/tabbycat

Issue:
Add BADGE_DATETIME_FORMAT for bn, ms, zh_Hans
Sentry Issue: [BACKEND-2D5](https://sentry.io/organizations/tabbycat/issues/1266921761/?referrer=github_integration)

```
No BADGE_DATETIME_FORMAT found for language: bn
```

- [x] `bn` (Bangla)
- [x] `ms` (Malay)
- [x] `zh_Hans` (Chinese - Simplified)


Discussion:
I think we're still missing Malay, right?

Also, Bengali doesn't have a short datetime format, and the [short date format](https://github.com/django/django/blob/master/django/conf/locale/bn/formats.py) uses the short text month `j M`, not the numeric `d/m`. And Malay isn't even supported by Django, so we'll need to define every date and time format we need for them!
Yes, still missing Malay. I asked the Bengali translators for their format already (as you can see). What date _or_ time formats do we need? We could ask (and possibly add to Django)
Umm, I'm not sure. I guess for the purposes of a hotfix, we should just get as far as it having it not crash. I believe it will fall back to the defaults in [global_settings.py](https://github.com/django/django/blob/3.0.7/django/conf/global_settings.py#L324-L353) or as specified in [the Django docs](https://docs.djangoproject.com/en/3.0/ref/settings/#std:setting-SHORT_DATE_FORMAT), which are all in US format.
Doesn't crash as it defaults
So to avoid a crash we just need to specify a `BADGE_DATETIME_FORMAT`, right?
It already doesn't crash; even without specifying formats. It's just a warning that's passed to Sentry.

You can try changing the language on your instance on the admin tournament home (uses badge date time). Doesn't crash for me.
The page loads for me, but the feeds do not.

Chinese:
![image](https://user-images.githubusercontent.com/1725499/84841577-9502e800-aff7-11ea-9c8a-7f5d008a1905.png)

Spanish:
![image](https://user-images.githubusercontent.com/1725499/84841591-a0eeaa00-aff7-11ea-9af9-ec040a416992.png)

Actually, it's strange that this still fails for Chinese, let me look into this further…
Okay, I just needed to run `npm run build` to pick up on the new languages, lol.

So it doesn't crash because of this fallback:
https://github.com/TabbycatDebate/tabbycat/blob/5dd6eb5f02a2a1ceeb3ceeb3a60fae479365b65d/tabbycat/utils/misc.py#L42-L50

Though the purpose of that fallback is to notify us that we forgot to specify it, while providing something so that it doesn't crash entirely for the user. So we should put something in so that it no longer triggers this error report, since that's the point of the error report 🙂
(Side note, digging into this made me realize the bug that I just fixed in 546396e09ed4366f57fdf824493c7f238683e9ca, that's escaped us for some three years…)

Resolving patch:
diff --git a/tabbycat/utils/formats/ms/__init__.py b/tabbycat/utils/formats/ms/__init__.py
new file mode 100644
diff --git a/tabbycat/utils/formats/ms/formats.py b/tabbycat/utils/formats/ms/formats.py
new file mode 100644
--- /dev/null
+++ b/tabbycat/utils/formats/ms/formats.py
@@ -0,0 +1,8 @@
+BADGE_DATETIME_FORMAT = 'h:i A d/m'  # '4:33 PM 08/02'
+
+# Provide Django format definitions as Malay is not included yet
+DATE_FORMAT = 'd/m/Y'  # '08/02/2020'
+TIME_FORMAT = 'h:i A'  # '4:33 PM'
+DATETIME_FORMAT = 'h:i A d/m/Y'  # '4:33 PM 08/02/2020'
+SHORT_DATE_FORMAT = 'd/m/Y'  # '08/02/2020'
+SHORT_DATETIME_FORMAT = 'h:i A d/m/Y'  # '4:33 PM 08/02/2020'


Test patch: