summaryrefslogtreecommitdiff
path: root/django/contrib/humanize
AgeCommit message (Collapse)Author
2026-03-06Refs #28877 -- Added special ordinal context when humanizing value 1.Julien Palard
Some languages use a different ordinal suffix for the number 1 than for other values ending in 1 (e.g. 21, 31). Added a dedicated pgettext context "ordinal is 1" to allow translators to handle this distinction. For example, in French, 1 is written as "1er" while 21, 31, etc. use "21e", "31e", etc. Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2025-12-02Updated translations from Transifex.Natalia
Forwardport of 00575b79312c719a6b37035067095e2d679bb5d7 from stable/6.0.x.
2025-09-18Updated translations from Transifex.Natalia
Forwardport of 2a2936c3e6444a0f37156773ca405cedaf28dea7 from stable/5.2.x.
2025-07-23Refs #36500 -- Corrected rewrapped long lines fixed via a script.Mike Edmunds
Manually reformatted some comments and docstrings where autofix_w505.py changed the meaning of the formatting.
2025-07-23Refs #36500 -- Rewrapped long docstrings and block comments via a script.django-bot
Rewrapped long docstrings and block comments to 79 characters + newline using script from https://github.com/medmunds/autofix-w505.
2025-05-14Fixed #35852 -- Fixed intcomma locale-aware formatting of string number ↵Timothy McCurrach
representations.
2025-03-31Updated translations from Transifex.Sarah Boyce
Forwardport of cc31b389a11559396fc039511c0dc567d9ade469 from stable/5.2.x.
2025-02-18Refs #36005 -- Used datetime.UTC alias instead of datetime.timezone.utc.Mariusz Felisiak
datetime.UTC was added in Python 3.11.
2025-02-14Fixed #36102 -- Moved i18n comments directly above the translatable string.Julien Palard
xgettext only extracts comment blocks if there is no program code between the comment and the string that gets extracted. For details, see: https://www.gnu.org/software/gettext/manual/html_node/xgettext-Invocation.html#Operation-mode Black formatting has been turned off in some places to ensure the comments are not moved, which previously resulted in them being removed from the po files when scripts/manage_translations.py was run.
2024-10-07Updated translations from Transifex.nessita
Forwardport of e245f62d0052d7b15fa2a60926d59eeeefee9be1 from stable/5.1.x.
2024-08-07Updated translations from Transifex.Natalia
Forwardport of 380c6e6ddd7890fbe65826873579ef6e3af0c07d from stable/5.1.x.
2024-05-27Fixed #35443 -- Changed ordinal to return negative numbers unchanged.Simon Törnqvist
Previously, `-1` was converted to `"-1th"`. This has been updated to return negative numbers "as is", so that for example `-1` is converted to `"-1"`. This is now explicit in the docs. Co-authored-by: Martin Jonson <artin.onson@gmail.com>
2024-02-08Fixed #35172 -- Fixed intcomma for string floats.Mariusz Felisiak
Thanks Warwick Brown for the report. Regression in 55519d6cf8998fe4c8f5c8abffc2b10a7c3d14e9.
2024-02-06Fixed CVE-2024-24680 -- Mitigated potential DoS in intcomma template filter.Adam Johnson
Thanks Seokchan Yoon for the report. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com> Co-authored-by: Natalia <124304+nessita@users.noreply.github.com> Co-authored-by: Shai Berger <shai@platonix.com>
2024-01-29Updated translations from Transifex.Claude Paroz
Forwardport of 3cc35aafabb1523c39332ee83e769b085ed3d923 from stable/5.0.x.
2023-12-04Updated translations from Transifex.Natalia
Forwardport of 8e1b820fa10d16664beb5d1ca2f5671891da1704 from stable/5.0.x.
2023-09-18Updated source translation catalogs.Natalia
This work includes the updating of the translations catalog for JS files. The catalog was generated with this command: django-admin makemessages -l en --domain=djangojs -i views/templates/i18n_catalog.js The `views/templates/i18n_catalog.js` file had to be ignored because otherwise the command would fail as follows: xgettext: warning: msgid '' is used without plural and with plural. ./views/templates/i18n_catalog.js:52: Here is the occurrence without plural. ./views/templates/i18n_catalog.js:60: Here is the occurrence with plural. Workaround: If the msgid is a sentence, change the wording of the sentence; otherwise, use contexts for disambiguation. CommandError: errors happened while running msguniq /home/nessita/fellowship/django/django/conf/locale/djangojs.pot:22: context separator <EOT> within string /home/nessita/fellowship/django/django/conf/locale/djangojs.pot:23: context separator <EOT> within string msguniq: found 2 fatal errors Forwardport of c3f890a5803774887fc73a005cba7bf736bb546c from stable/5.0.x.
2023-04-03Updated translations from Transifex.Mariusz Felisiak
Forwardport of fa687719321329f4e5017b7fc1b8cadae3c63c32 from stable/4.2.x.
2022-12-20Updated translations from Transifex.Mariusz Felisiak
Updated Bulgarian, Esperanto, Hungarian, Japanese, Macedonian, Persian, Portuguese (Brazil), Russian, Spanish, and Turkmen translations. Forwardport of 46b28bbe151282e9198b719d00f84b48c92606ba from stable/4.1.x.
2022-08-03Updated translations from Transifex.Mariusz Felisiak
This also fixes related i18n tests. Forwardport of a3bab9332416f655c6ae0fa306c94f7f52e7398d from stable/4.1.x. Co-authored-by: Claude Paroz <claude@2xlibre.net>
2022-03-24Refs #32365 -- Removed internal uses of utils.timezone.utc alias.Carlton Gibson
Remaining test case ensures that uses of the alias are mapped canonically by the migration writer.
2022-02-08Fixed typo in django/contrib/humanize/templatetags/humanize.py comment.dr-rompecabezas
2022-02-07Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2022-01-29Updated translations from Transifex.Claude Paroz
Updated Bulgarian, Czech, German, Uzbek, and Vietnamese translations. Forwardport of 7a1c6533eb72c3e6faa308796ba7f8d7d447d3b9 from stable/4.0.x.
2021-12-06Updated translations from Transifex.Mariusz Felisiak
This also fixes related i18n tests. Forwardport of 4c5215ab036aa8fda9cd0148fd034f4d8f7d69d1 from stable/4.0.x Co-authored-by: Claude Paroz <claude@2xlibre.net>
2021-07-15Fixed #32910 -- Unified different plural equations for the same language in ↵Mariusz Felisiak
contrib apps. Thanks Martin Svoboda for the report and initial patch.
2021-04-10Fixed #31937 -- Eased translation of time strings in some languages.Claude Paroz
2021-04-06Updated translations from Transifex.Claude Paroz
Forwardport of 1ea5e983151f797b285c789626411b9373cd8727 from stable/3.2.x.
2021-01-15Updated source translation catalogs.Claude Paroz
Forwardport of 3dc3a952b28af444cb3bc83d4638a0e5fc2eeae1 from stable/3.2.x.
2020-09-30Updated translations from Transifex.Claude Paroz
Forwardport of f7397bb7c8cb938161a9d43a16ee974f41c96a8b from stable/3.1.x.
2020-08-01Updated translations from TransifexClaude Paroz
2020-07-21Fixed #31180 -- Configured applications automatically.Aymeric Augustin
2020-06-01Made intword/intcomma template filters independent of USE_L10N.Claude Paroz
2020-03-16Fixed #31363 -- Added support for negative integers to intword template filter.jay20162016
2020-01-31Updated translations from Transifex.Claude Paroz
Forwardport of ca4f87027e2ed32cb272a1823c9ce4104b02d830 from stable/3.0.x
2019-12-02Updated contrib translations from Transifex.Carlton Gibson
Forward port of 4afa0e5d2a7c723a11d06434706810224651c50b from stable/3.0.x
2019-06-29Updated translations from TransifexClaude Paroz
Forward port of b3f7262e6e5d9e68e37fb21af89ed6656291faa3 from stable/2.2.x
2019-06-11Fixed #27486 -- Fixed Python 3.7 DeprecationWarning in intword and ↵Jon Dufresne
filesizeformat filters. intword and filesizeformat passed floats to ngettext() which is deprecated in Python 3.7. The rationale for this warning is documented in BPO-28692: https://bugs.python.org/issue28692. For filesizeformat, the filesize value is expected to be an int -- it fills %d string formatting placeholders. It was likely coerced to a float to ensure floating point division on Python 2. Python 3 always does floating point division, so coerce to an int instead of a float to fix the warning. For intword, the number may contain a decimal component. In English, a decimal component makes the noun plural. A helper function, round_away_from_one(), was added to convert the float to an integer that is appropriate for ngettext().
2019-04-01Updated contrib translations from Transifex.Claude Paroz
Forwardport of 7090cbf54202c21978a93bdb76ba006780e1865c from 2.2.x.
2019-01-16Updated translation catalogsClaude Paroz
2019-01-10Fetched Armenian translations from TransifexClaude Paroz
2018-11-09Fixed #29931 -- Removed unused ValueError handling in naturalday template tag.Hasan Ramezani
2018-09-29Updated translations from TransifexClaude Paroz
Forward port of d5ed08263b58ec972a1e009f23d7b90c30b6b9c1 from master.
2018-08-01Updated contrib translations from TransifexClaude Paroz
Forwardport of cbf7e7dc52db2834e95817bbbfb56a693c83b84f from stable/2.1.x.
2018-06-08Refactored naturaltime to use a class-based formatterClaude Paroz
2018-05-17Updated translation catalogsClaude Paroz
2018-05-10Fixed #21408 — German Translation for “3 days ago”Maximilian Merz
The problem: “3 days ago” should translate to “vor 3 Tagen” in German, while “3 days” translates to “3 Tage”. #21408 describes that django always translated to “Tage”, even when the dative “Tagen” was correct. The same applies to months (“Monate”/“Monaten”) and years (“Jahre”/“Jahren”). The solution: Let `timesince` caller provide the string dict to use for the time-related strings.
2018-05-09Replaced context by comment in 2 humanize strings.Claude Paroz
2018-02-28Updated translations from TransifexClaude Paroz
Forward port of 2126e9317e80a7d4c42e033dd33d7e3378fdfcf8 from stable/2.0.x.