[ADD] Locale mapping for DataTables and Moment.JS

This commit is contained in:
Peter Pfeufer
2025-01-20 04:35:10 +01:00
parent 1b6cf98885
commit 856e939c21
39 changed files with 4459 additions and 22 deletions

View File

@@ -117,6 +117,39 @@ LANGUAGES = ( # Sorted by Language Code alphabetical order + English at top
("zh-hans", _("Simplified Chinese")),
)
# Django's language codes are different from some of the libraries we use,
# so we need to map them.
LANGUAGE_MAPPING = {
"DataTables": {
"cs-cz": "cs",
"de": "de-DE",
"es": "es-ES",
"fr-fr": "fr-FR",
"it-it": "it-IT",
"ja": "ja",
"ko-kr": "ko",
"nl-nl": "nl-NL",
"pl-pl": "pl",
"ru": "ru",
"uk": "uk",
"zh-hans": "zh-HANT",
},
"MomentJS": {
"cs-cz": "cs",
"de": "de",
"es": "es",
"fr-fr": "fr",
"it-it": "it",
"ja": "ja",
"ko-kr": "ko",
"nl-nl": "nl",
"pl-pl": "pl",
"ru": "ru",
"uk": "uk",
"zh-hans": "zh-cn",
},
}
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',