summaryrefslogtreecommitdiff
path: root/tests/i18n/tests.py
AgeCommit message (Collapse)Author
2026-03-06Fixed #36679 -- Fixed Basque date formats to use parenthetical declension ↵Unai Loidi
suffixes. Basque (eu) grammar requires conditional suffixes on years and day articles that depend on the final sound of the preceding word. Since Django's format strings are static, the CLDR parenthetical convention ("(e)ko" instead of "ko") is used to express the optionality. Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2026-02-21Fixed a typo in tests/i18n/tests.py.jun
2025-09-23Fixed #36543 -- Fixed time formats for fr_CA.Mridul Dhall
Thanks Chris Anderson for the report.
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.
2024-09-16Fixed #34221 -- Honored translation precedence with mixed plural forms.Claude Paroz
2024-08-07Fixed i18n.tests.TranslationTests.test_plural to use correct French translation.Natalia
Forwardport of d5ad743e798fadc83663f016023cd124eadc366c from stable/5.1.x.
2024-07-25Fixed #35627 -- Raised a LookupError rather than an unhandled ValueError in ↵Lorenzo Peña
get_supported_language_variant(). LocaleMiddleware didn't handle the ValueError raised by get_supported_language_variant() when language codes were over 500 characters. Regression in 9e9792228a6bb5d6402a5d645bc3be4cf364aefb.
2024-07-09Fixed CVE-2024-39614 -- Mitigated potential DoS in ↵Sarah Boyce
get_supported_language_variant(). Language codes are now parsed with a maximum length limit of 500 chars. Thanks to MProgrammer for the report.
2023-12-31Used addCleanup() in tests where appropriate.Mariusz Felisiak
2023-05-02Fixed #34515 -- Made LocaleMiddleware prefer language from paths when i18n ↵Mariusz Felisiak
patterns are used. Regression in 94e7f471c4edef845a4fe5e3160132997b4cca81. This reverts commit 94e7f471c4edef845a4fe5e3160132997b4cca81 (refs #34069) and partly reverts commit 3b4728310a7a64f8fcc548163b0aa5f98a5c78f5. Thanks Anthony Baillard for the report. Co-Authored-By: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
2023-04-10Fixed #34455 -- Restored i18n_patterns() respect of prefix_default_language ↵sarahboyce
argument when fallback language is used. Regression in 94e7f471c4edef845a4fe5e3160132997b4cca81. Thanks Oussama Jarrousse for the report.
2023-02-01Fixed CVE-2023-23969 -- Prevented DoS with pathological values for ↵Nick Pope
Accept-Language. The parsed values of Accept-Language headers are cached in order to avoid repetitive parsing. This leads to a potential denial-of-service vector via excessive memory usage if the raw value of Accept-Language headers is very large. Accept-Language headers are now limited to a maximum length in order to avoid this issue.
2023-01-17Refs #32873 -- Removed settings.USE_L10N per deprecation timeline.Mariusz Felisiak
2023-01-04Simplified django.utils.formats.date_format()/time_format() calls.Nick Pope
This removes redundant get_format() calls and passing a default value for the format argument.
2023-01-04Refs #34074 -- Used headers argument for RequestFactory and Client in docs ↵David Wobrock
and tests.
2022-11-14Fixed #34074 -- Added headers argument to RequestFactory and Client classes.David Wobrock
2022-10-13Fixed #34069 -- Made LocaleMiddleware respect language from requests when ↵Sergio
i18n patterns are used.
2022-10-10Used test client headers in i18n tests.Adam Johnson
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-06-20Fixed #23689 -- Made parsing HTTP Accept-Language header case-insensitive.Zainab Amir
Thank you Daniel Samuels for test project.
2022-05-31Fixed #33748 -- Fixed date template filter crash with lazy format.Claude Paroz
Regression in 659d2421c7adbbcd205604002d521d82d6b0b465.
2022-05-02Removed 'tests' path prefix in a couple tests.Tim Graham
2022-04-28Fixed #33661 -- Corrected Catalan date-format localization.mpachas
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.
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-07Fixed #28628 -- Changed \d to [0-9] in regexes where appropriate.Ad Timmering
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-12-03Fixed #33078 -- Added support for language regions in i18n_patterns().Maxim Piskunov
2021-12-03Refs #33078 -- Added extra assertions to ↵Mariusz Felisiak
MiscTests.test_get_language_from_path_real().
2021-09-14Fixed #32873 -- Deprecated settings.USE_L10N.Claude Paroz
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-09-08Fixed #30086, Refs #32873 -- Made floatformat template filter independent of ↵Mariusz Felisiak
USE_L10N.
2021-07-19Fixed #32941 -- Removed get_format_modules()'s unused reverse argument.Keryn Knight
Unused since 0d8b523422fda71baa10807d5aebefd34bad7962.
2021-05-12Refs #32738 -- Added sanitize_strftime_format() to replace datetime_safe.Nick Pope
2021-05-05Fixed #32479 -- Added fallbacks to subsequent language codes in translations.Maxim Beder
Thanks Claude Paroz and Nick Pope for reviews.
2021-04-22Fixed isolation of i18n.tests.FormattingTests.test_get_custom_format().Mariusz Felisiak
2021-04-06Updated translations from Transifex.Claude Paroz
Forwardport of 1ea5e983151f797b285c789626411b9373cd8727 from stable/3.2.x.
2021-03-22Fixed #32581 -- Prevented to_locale() from corrupting locale names.Claude Paroz
2021-03-22Added to_locale() tests for 3-char language codes.Claude Paroz
2021-01-14Refs #15902 -- Stopped set_language() storing user's language in the session.Mariusz Felisiak
Per deprecation timeline.
2021-01-14Refs #30165 -- Removed ugettext(), ugettext_lazy(), ugettext_noop(), ↵Mariusz Felisiak
ungettext(), and ungettext_lazy() per deprecation timeline.
2020-10-13Fixed #20601 -- Allowed forcing format with thousand separators in ↵Jacob Walls
floatformat filter. Thanks Claude Paroz and Nick Pope for reviews.
2020-06-04Fixed #30134 -- Ensured unlocalized numbers are string representation in ↵Claude Paroz
templates.
2020-06-04Refs #30134 -- Added test for {% localize off %} tag with format settings.Claude Paroz
2020-06-01Fixed #31570 -- Corrected translation loading for apps providing territorial ↵Carlton Gibson
language variants with different plural equations. Regression in e3e48b00127c09eafe6439d980a82fc5c591b673. Thanks to Shai Berger for report, reproduce and suggested fix.
2020-05-04Refs #30372 -- Stopped watching built-in Django translation files by ↵Tom Forbes
auto-reloader.
2020-03-10Fixed #30439 -- Added support for different plural forms for a language.Claude Paroz
Thanks to Michal Čihař for review.
2019-07-02Fixed typos in comments and docs.Min ho Kim
2019-06-20Fixed #30451 -- Added ASGI handler and coroutine-safety.Andrew Godwin
This adds an ASGI handler, asgi.py file for the default project layout, a few async utilities and adds async-safety to many parts of Django.
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-27Fixed typos in test names.Daniel Hahler