summaryrefslogtreecommitdiff
path: root/django/utils/translation/trans_null.py
AgeCommit message (Collapse)Author
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>
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.
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-02-23Fixed #27449 -- Added django.utils.translation.get_supported_language_variant().Sebastian Sangervasi
2017-01-28Made ugettext* functions aliases of gettext*Claude Paroz
Thanks Tim Graham for the review.
2016-11-14Fixed E305 flake8 warnings.Ramin Farajpour Cami
2016-01-25Fixed #26125 -- Fixed E731 flake warnings.userimack
2014-12-26Fixed #24045 -- Removed useless mark_safe() call in trans_null.pyTim Graham
2014-05-25Removed code deprecated from Django 1.2Claude Paroz
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.
2013-11-03Fixed all E226 violationsAlex Gaynor
2013-11-02Correct flake8 E302 violationsRay Ashman Jr
2013-10-17Fixed #21270 -- Fixed E701 pep8 warningsAlasdair Nicol
2013-10-10Whitespace cleanup.Tim Graham
* Removed trailing whitespace. * Added newline to EOF if missing. * Removed blank lines at EOF. * Removed some stray tabs.
2013-02-23Fixes #17866: Vary: Accept-Language header when language prefix usedŁukasz Langa
2012-08-07[py3] Ported django.utils.encoding.Aymeric Augustin
* Renamed smart_unicode to smart_text (but kept the old name under Python 2 for backwards compatibility). * Renamed smart_str to smart_bytes. * Re-introduced smart_str as an alias for smart_text under Python 3 and smart_bytes under Python 2 (which is backwards compatible). Thus smart_str always returns a str objects. * Used the new smart_str in a few places where both Python 2 and 3 want a str.
2012-02-18Fixed #17720 -- Stopped the LocaleMiddleware from overeagerly using the ↵Jannis Leidel
request path for language activation if it's actually not wanted. Thanks to Anssi Kääriäinen for the initial patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17547 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-07-13Fixed #16225 -- Removed unused imports. Many thanks to Aymeric Augustin for ↵Jannis Leidel
the work on the patch and Alex for reviewing. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16539 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-15Fixed #11585 -- Added ability to translate and prefix URL patterns with a ↵Jannis Leidel
language code as an alternative method for language discovery. Many thanks to Orne Brocaar for his initial work and Carl Meyer for feedback. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16405 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-02Advanced deprecations in django.utils.translation.Russell Keith-Magee
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15987 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-04Fixed #9988 -- Added support for translation contexts. Thanks, Claude Paroz.Jannis Leidel
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14450 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-11Fixed #14436 -- Escalated 1.2 PendingDeprecationWarnings to ↵Russell Keith-Magee
DeprecationWarnings, and removed 1.1 deprecated code. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14138 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-22Fixed #7980 - Improved i18n framework to support locale aware formatting ↵Jannis Leidel
(dates and numbers) and form processing. Thanks to Marc Garcia for working on this during his Google Summer of Code 2009! Additionally fixes #1061, #2203, #3940, #5526, #6449, #6231, #6693, #6783, #9366 and #10891. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11964 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-17Translating safe strings should return a safe result.Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6681 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-21Fixed #2920 -- Removed _() from builtins.Malcolm Tredinnick
This is backwards incompatible, but easy to work around. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6582 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-03Fixed #4796. Fixed a problem when using i18n support for the first time -- inMalcolm Tredinnick
particular when string_concat() was the first call made. Thanks, Andy Durdin. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6446 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-04Merged Unicode branch into trunk (r4952:5608). This should be fullyMalcolm Tredinnick
backwards compatible for all practical purposes. Fixed #2391, #2489, #2996, #3322, #3344, #3370, #3406, #3432, #3454, #3492, #3582, #3690, #3878, #3891, #3937, #4039, #4141, #4227, #4286, #4291, #4300, #4452, #4702 git-svn-id: http://code.djangoproject.com/svn/django/trunk@5609 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-04-05Small fix to [4931].Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4932 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-04-05Fixed #3918 -- Handle technical message IDs correctly when settings.USE_I18N isMalcolm Tredinnick
False. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4931 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-27Fixed #2408 -- Added get_language_from_request() to trans_null.py. Thanks, ↵Adrian Holovaty
ubernostrum git-svn-id: http://code.djangoproject.com/svn/django/trunk@3458 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-14Added check_for_language and to_locale to utils.translation.trans_nullAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3344 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-11Added get_language_bidi to django.utils.translation.trans_nuill. Refs #2203Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3329 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-10Fixed bug in utils.translation.trans_null -- get_date_formats and ↵Adrian Holovaty
get_partial_date_formats weren't returning tuples properly git-svn-id: http://code.djangoproject.com/svn/django/trunk@3306 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-08Fixed #2310 -- Changed trans_null.py to use settings.LANGUAGE_CODE instead ↵Adrian Holovaty
of hard-coded 'en' git-svn-id: http://code.djangoproject.com/svn/django/trunk@3298 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-04Made django/utils/translation.py into a package django/utils/translation, ↵Adrian Holovaty
which is loaded lazily depending on the value of settings.USE_I18N. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3271 bcc190cf-cafb-0310-a4f2-bffc1f526a37