summaryrefslogtreecommitdiff
path: root/django/utils/translation
AgeCommit message (Collapse)Author
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-03-30Fixed warnings per flake8 7.2.0.Mariusz Felisiak
https://github.com/PyCQA/flake8/releases/tag/7.2.0
2024-09-16Fixed #34221 -- Honored translation precedence with mixed plural forms.Claude Paroz
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.
2024-01-26Applied Black's 2024 stable style.Mariusz Felisiak
https://github.com/psf/black/releases/tag/24.1.0
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.
2022-11-10Updated documentation and comments for RFC updates.Nick Pope
- Updated references to RFC 1123 to RFC 5322 - Only partial as RFC 5322 sort of sub-references RFC 1123. - Updated references to RFC 2388 to RFC 7578 - Except RFC 2388 Section 5.3 which has no equivalent. - Updated references to RFC 2396 to RFC 3986 - Updated references to RFC 2616 to RFC 9110 - Updated references to RFC 3066 to RFC 5646 - Updated references to RFC 7230 to RFC 9112 - Updated references to RFC 7231 to RFC 9110 - Updated references to RFC 7232 to RFC 9110 - Updated references to RFC 7234 to RFC 9111 - Tidied up style of text when referring to RFC documents
2022-10-31Used more augmented assignment statements.Nick Pope
Identified using the following command: $ git grep -I '\(\<[_a-zA-Z0-9]\+\>\) *= *\1 *[-+/*^%&|<>@]'
2022-10-13Fixed #34069 -- Made LocaleMiddleware respect language from requests when ↵Sergio
i18n patterns are used.
2022-06-20Fixed #23689 -- Made parsing HTTP Accept-Language header case-insensitive.Zainab Amir
Thank you Daniel Samuels for test project.
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-07Refs #32355 -- Removed unnecessary list() calls before reversed() on dictviews.Mariusz Felisiak
Dict and dictviews are iterable in reversed insertion order using reversed() in Python 3.8+.
2022-01-07Fixed #28628 -- Changed \d to [0-9] in regexes where appropriate.Ad Timmering
2021-12-17Changed signatures of setting_changed signal receivers.Adam Johnson
2021-12-03Fixed #33078 -- Added support for language regions in i18n_patterns().Maxim Piskunov
2021-09-27Refs #32355 -- Used @functools.lru_cache as a straight decorator.Mariusz Felisiak
2021-08-05Refs #32986 -- Moved TRANSLATOR_COMMENT_MARK to ↵Chris Jerdonek
django.utils.translation.template.
2021-05-05Fixed #32479 -- Added fallbacks to subsequent language codes in translations.Maxim Beder
Thanks Claude Paroz and Nick Pope for reviews.
2021-03-22Fixed #32581 -- Prevented to_locale() from corrupting locale names.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-11-05Fixed #25791 -- Implement autoreload behaviour for cached template loader.Tom Forbes
2020-07-30Bumped minimum isort version to 5.1.0.David Smith
Fixed inner imports per isort 5. isort 5.0.0 to 5.1.0 was unstable.
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-11Refs #30116 -- Simplified regex match group access with Match.__getitem__().Jon Dufresne
The method has been available since Python 3.6. The shorter syntax is also marginally faster.
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-12-18Fixed #30585 -- Added {% translate %} and {% blocktranslate %} template tags.Mike Hansen
2019-10-29Fixed #30899 -- Lazily compiled import time regular expressions.Hasan Ramezani
2019-07-24Fixed #30647 -- Fixed crash of autoreloader when extra directory cannot be ↵Tom Forbes
resolved.
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-02-14Refs #15902 -- Deprecated storing user's language in the session.Claude Paroz
2019-02-08Fixed #30165 -- Deprecated ugettext(), ugettext_lazy(), ugettext_noop(), ↵Jon Dufresne
ungettext(), and ungettext_lazy().
2019-02-06Fixed #30159 -- Removed unneeded use of OrderedDict.Nick Pope
Dicts preserve order since Python 3.6.
2019-01-28Fixed #30137 -- Replaced OSError aliases with the canonical OSError.Jon Dufresne
Used more specific errors (e.g. FileExistsError) as appropriate.
2019-01-13Fixed #27685 -- Added watchman support to the autoreloader.Tom Forbes
Removed support for pyinotify (refs #9722).
2018-12-06Fixed #29986 -- Added .format() support to ngettext_lazy strings.Patrick Arminio
2018-11-23Improved readability of translation's to_locale().Jaap Roes
2018-11-06Refs #29926 -- Removed usage of gettext.translation()'s deprecated codeset ↵Tim Graham
parameter. https://bugs.python.org/issue33710
2018-09-28Refs #28909 -- Simplifed code using unpacking generalizations.Sergey Fedoseev
2018-05-12Moved to_language() to django.utils.translation.Tim Graham
Follow up to 1b7d524cfa7b7834af26c99407af66be6813938d.
2018-05-12Consolidated duplicate to_locale() implementations.Tim Graham
Follow up to ac59ec8f1a34ea0e82bdb3c77422694e8016e0a7.
2018-05-12Aliased trans_null.to_locale() to trans_real.to_locale().Hasan Ramezani
The implementations have unintentionally diverged.
2018-05-10Replaced TOKEN_* constants by TokenType enums.Claude Paroz
Thanks Tim Graham for the review.
2018-03-16Fixed hanging indentation in various code.Mariusz Felisiak