summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormpachas <miguel.pachas.garcia@gmail.com>2022-04-28 15:12:15 +0200
committerCarlton Gibson <carlton.gibson@noumenal.es>2022-04-28 15:12:15 +0200
commitaa28c392b9491f02330905cb73b7078b1cd18c60 (patch)
treea5e6f209850cfa9104a14ae84e73d6925d86e9b8
parentce586ed6931092d3a5f06df9031cdeb891793ddb (diff)
Fixed #33661 -- Corrected Catalan date-format localization.
Changed DATE_FORMAT, DATETIME_FORMAT and MONTH_DAY_FORMAT to use E placeholder (Month, locale specific alternative) to handle both “de gener” and contracted “d’abril” cases. Thanks to Ferran Jovell for review.
-rw-r--r--django/conf/locale/ca/LC_MESSAGES/django.mobin27427 -> 27460 bytes
-rw-r--r--django/conf/locale/ca/LC_MESSAGES/django.po24
-rw-r--r--django/conf/locale/ca/formats.py6
-rw-r--r--tests/i18n/tests.py5
4 files changed, 19 insertions, 16 deletions
diff --git a/django/conf/locale/ca/LC_MESSAGES/django.mo b/django/conf/locale/ca/LC_MESSAGES/django.mo
index ca8826b722..93ad205482 100644
--- a/django/conf/locale/ca/LC_MESSAGES/django.mo
+++ b/django/conf/locale/ca/LC_MESSAGES/django.mo
Binary files differ
diff --git a/django/conf/locale/ca/LC_MESSAGES/django.po b/django/conf/locale/ca/LC_MESSAGES/django.po
index d315fd5024..4798a87600 100644
--- a/django/conf/locale/ca/LC_MESSAGES/django.po
+++ b/django/conf/locale/ca/LC_MESSAGES/django.po
@@ -1071,51 +1071,51 @@ msgstr "Des."
msgctxt "alt. month"
msgid "January"
-msgstr "gener"
+msgstr "de gener"
msgctxt "alt. month"
msgid "February"
-msgstr "febrer"
+msgstr "de febrer"
msgctxt "alt. month"
msgid "March"
-msgstr "març"
+msgstr "de març"
msgctxt "alt. month"
msgid "April"
-msgstr "abril"
+msgstr "d'abril"
msgctxt "alt. month"
msgid "May"
-msgstr "maig"
+msgstr "de maig"
msgctxt "alt. month"
msgid "June"
-msgstr "juny"
+msgstr "de juny"
msgctxt "alt. month"
msgid "July"
-msgstr "juliol"
+msgstr "de juliol"
msgctxt "alt. month"
msgid "August"
-msgstr "agost"
+msgstr "d'agost"
msgctxt "alt. month"
msgid "September"
-msgstr "setembre"
+msgstr "de setembre"
msgctxt "alt. month"
msgid "October"
-msgstr "octubre"
+msgstr "d'octubre"
msgctxt "alt. month"
msgid "November"
-msgstr "novembre"
+msgstr "de novembre"
msgctxt "alt. month"
msgid "December"
-msgstr "desembre"
+msgstr "de desembre"
msgid "This is not a valid IPv6 address."
msgstr "Aquesta no és una adreça IPv6 vàlida."
diff --git a/django/conf/locale/ca/formats.py b/django/conf/locale/ca/formats.py
index 2f91009119..e6162990d1 100644
--- a/django/conf/locale/ca/formats.py
+++ b/django/conf/locale/ca/formats.py
@@ -2,11 +2,11 @@
#
# The *_FORMAT strings use the Django date format syntax,
# see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
-DATE_FORMAT = r"j \d\e F \d\e Y"
+DATE_FORMAT = r"j E \d\e Y"
TIME_FORMAT = "G:i"
-DATETIME_FORMAT = r"j \d\e F \d\e Y \a \l\e\s G:i"
+DATETIME_FORMAT = r"j E \d\e Y \a \l\e\s G:i"
YEAR_MONTH_FORMAT = r"F \d\e\l Y"
-MONTH_DAY_FORMAT = r"j \d\e F"
+MONTH_DAY_FORMAT = r"j E"
SHORT_DATE_FORMAT = "d/m/Y"
SHORT_DATETIME_FORMAT = "d/m/Y G:i"
FIRST_DAY_OF_WEEK = 1 # Monday
diff --git a/tests/i18n/tests.py b/tests/i18n/tests.py
index 45f0ea9a9b..a25f6bcd9e 100644
--- a/tests/i18n/tests.py
+++ b/tests/i18n/tests.py
@@ -865,12 +865,15 @@ class FormattingTests(SimpleTestCase):
self.maxDiff = 3000
# Catalan locale
with translation.override("ca", deactivate=True):
- self.assertEqual(r"j \d\e F \d\e Y", get_format("DATE_FORMAT"))
+ self.assertEqual(r"j E \d\e Y", get_format("DATE_FORMAT"))
self.assertEqual(1, get_format("FIRST_DAY_OF_WEEK"))
self.assertEqual(",", get_format("DECIMAL_SEPARATOR"))
self.assertEqual("10:15", time_format(self.t))
self.assertEqual("31 de desembre de 2009", date_format(self.d))
self.assertEqual(
+ "1 d'abril de 2009", date_format(datetime.date(2009, 4, 1))
+ )
+ self.assertEqual(
"desembre del 2009", date_format(self.d, "YEAR_MONTH_FORMAT")
)
self.assertEqual(