summaryrefslogtreecommitdiff
path: root/django/utils/translation/__init__.py
AgeCommit message (Collapse)Author
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.
2022-10-31Used more augmented assignment statements.Nick Pope
Identified using the following command: $ git grep -I '\(\<[_a-zA-Z0-9]\+\>\) *= *\1 *[-+/*^%&|<>@]'
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
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-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.
2019-10-29Fixed #30899 -- Lazily compiled import time regular expressions.Hasan Ramezani
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-08Fixed #30165 -- Deprecated ugettext(), ugettext_lazy(), ugettext_noop(), ↵Jon Dufresne
ungettext(), and ungettext_lazy().
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-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-02-23Fixed #27449 -- Added django.utils.translation.get_supported_language_variant().Sebastian Sangervasi
2017-09-29Refs #27067 -- Removed string_concat in django.utils.translation.__all__.Mariusz Felisiak
Undefined since 87d2240e6cc594a3bf28dfdb2ec023c54fb76ff7.
2017-09-22Refs #27067 -- Removed django.utils.translation.string_concat() per ↵Tim Graham
deprecation timeline.
2017-09-07Reverted "Fixed #27818 -- Replaced try/except/pass with contextlib.suppress()."Tim Graham
This reverts commit 550cb3a365dee4edfdd1563224d5304de2a57fda because try/except performs better.
2017-06-28Fixed #27818 -- Replaced try/except/pass with contextlib.suppress().Mads Jensen
2017-04-27Refs #27795 -- Replaced many force_text() with str()Claude Paroz
Thanks Tim Graham for the review.
2017-02-07Converted usage of ugettext* functions to their gettext* aliasesClaude Paroz
Thanks Tim Graham for the review.
2017-01-28Made ugettext* functions aliases of gettext*Claude Paroz
Thanks Tim Graham for the review.
2017-01-19Refs #23919 -- Removed usage of django.utils.decorators.ContextDecorator.Chillar Anand
2017-01-19Refs #23919 -- Removed __nonzero__() methods (for Python 2).Simon Charette
Thanks Tim for the review.
2017-01-19Refs #23919 -- Stopped inheriting from object to define new style classes.Simon Charette
2017-01-18Refs #23919 -- Removed six.<various>_types usageClaude Paroz
Thanks Tim Graham and Simon Charette for the reviews.
2017-01-18Refs #23919 -- Removed encoding preambles and future importsClaude Paroz
2016-11-14Fixed E305 flake8 warnings.Ramin Farajpour Cami
2016-10-01Refs #26940 -- Re-allowed makemessages without settingsClaude Paroz
Thanks Tim Graham for the review.
2016-09-17Refs #27025 -- Fixed "invalid escape sequence" warnings in Python 3.6.Tim Graham
http://bugs.python.org/issue27364
2016-08-25Fixed #27067 -- Deprecated string_concat() in favor of format_lazy().Mattias Loverot
2016-08-11Fixed #27034 -- Made makemessages independent of USE_I18NClaude Paroz
Thanks Tim Graham for the review.
2016-04-08Fixed E128 flake8 warnings in django/.Tim Graham
2016-02-15Fixed #26212 -- Made forms.FileField and translation.lazy_number() picklable.Alexey Kotlyarov
2015-10-22Fixed #25571 -- Fixed boolean evaluation of ungettext_lazyClaude Paroz
2015-08-25Fixed #25295 -- Restored 'no active translation' after language overrideClaude Paroz
Thanks David Nelson Adamec for the report and Tim Graham for the review.
2015-06-27Sorted imports in __init__.py files.Tim Graham
2015-06-02Fixed #24230 -- Added translated language name for i18n template tag/filter.Tomáš Ehrlich
2014-08-30Fixed #22820 -- Treated int and long types alike in lazy_numberClaude Paroz
Thanks kwist for the report and the initial patch.
2014-08-28Fixed #23381 -- Context manager restored state should be determined in __enter__Thomas Chaumeny
2014-08-28Fixed #23323 -- Made django.utils.translation.override usable as a decorator.Thomas Chaumeny
2014-07-14Fixed #23005 -- Allowed specifying special fallback languagesClaude Paroz
This fixes the Chinese language issues described in #23005 but also provides for other fallback exceptions by updating the LANG_INFO structure. Thanks caxekis at gmail.com for the report and Tim Graham for the review.
2014-05-06Fixed #22586 -- Added LANGUAGE_SESSION_KEY to __all__.Tim Graham
Thanks david.fischer.ch at gmail.com for the report.
2014-02-26Fixed #21389 -- Accept most valid language codesBouke Haarsma
By removing the 'supported' keyword from the detection methods and only relying on a cached settings.LANGUAGES, the speed of said methods has been improved; around 4x raw performance. This allows us to stop checking Python's incomplete list of locales, and rely on a less restrictive regular expression for accepting certain locales. HTTP Accept-Language is defined as being case-insensitive, based on this fact extra performance improvements have been made; it wouldn't make sense to check for case differences.
2014-02-22Extra new line to make flake8 happyAlex Gaynor
2014-02-22Fixed #22120 -- Documented persistent activation of languages and cleaned up ↵Erik Romijn
language session key use
2013-11-08Fixed #5849 -- Strip whitespace from blocktransBouke Haarsma
Add the trimmed option to the blocktrans tag to trim any newlines and whitespace from its content. This allows the developer to indent the blocktrans tag without adding new lines and whitespace to the msgid in the PO file. Thanks to mpessas for the initial patch and Dmitri Fedortchenko for the report.