Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/django/utils/translation/__init__.py
Commit message (Collapse)AuthorAgeFilesLines
* Fixed #25571 -- Fixed boolean evaluation of ungettext_lazyClaude Paroz2015-10-221-0/+6
|
* Fixed #25295 -- Restored 'no active translation' after ↵Claude Paroz2015-08-251-1/+3
| | | | | | language override Thanks David Nelson Adamec for the report and Tim Graham for the review.
* Sorted imports in __init__.py files.Tim Graham2015-06-271-2/+3
|
* Fixed #24230 -- Added translated language name for i18n ↵Tomáš Ehrlich2015-06-021-3/+8
| | | | template tag/filter.
* Fixed #22820 -- Treated int and long types alike in ↵Claude Paroz2014-08-301-1/+1
| | | | | | lazy_number Thanks kwist for the report and the initial patch.
* Fixed #23381 -- Context manager restored state should be ↵Thomas Chaumeny2014-08-291-1/+1
| | | | determined in __enter__
* Fixed #23323 -- Made django.utils.translation.override ↵Thomas Chaumeny2014-08-281-1/+2
| | | | usable as a decorator.
* Fixed #23005 -- Allowed specifying special fallback ↵Claude Paroz2014-07-141-1/+4
| | | | | | | | | | languages 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.
* Fixed #22586 -- Added LANGUAGE_SESSION_KEY to __all__.Tim Graham2014-05-071-0/+1
| | | | Thanks david.fischer.ch at gmail.com for the report.
* Fixed #21389 -- Accept most valid language codesBouke Haarsma2014-02-261-2/+2
| | | | | | | | | | | | 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.
* Extra new line to make flake8 happyAlex Gaynor2014-02-221-0/+1
|
* Fixed #22120 -- Documented persistent activation of ↵Erik Romijn2014-02-221-0/+1
| | | | languages and cleaned up language session key use
* Fixed #5849 -- Strip whitespace from blocktransBouke Haarsma2013-11-071-1/+7
| | | | | | | | | | | 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.
* Correct flake8 E302 violationsRay Ashman Jr2013-11-031-0/+24
|
* Fixed flake8 E241Boryslav Larin2013-11-021-1/+1
|
* Fixed #20989 -- Removed useless explicit list ↵Simon Charette2013-08-301-1/+1
| | | | comprehensions.
* Fixes #19763 - LocaleMiddleware should check for ↵Łukasz Langa2013-02-241-7/+7
| | | | supported languages in settings.LANGUAGE_CODE
* Fixes #17866: Vary: Accept-Language header when language ↵Łukasz Langa2013-02-231-2/+2
| | | | prefix used
* Changed %r to %s in get_language_info error message.Konrad Hałas2013-02-231-2/+2
|
* Fixed #19811 - Added language code fallback in ↵Konrad Hałas2013-02-231-0/+6
| | | | get_language_info.
* Made ungettext_lazy usable for messages that do not ↵Aymeric Augustin2013-02-021-1/+7
| | | | | | contain the count. Fixed #19160 (again). Thanks Alexey Boriskin.
* Fixed #19160 -- Made lazy plural translations usable.Aymeric Augustin2013-01-301-3/+32
| | | | Many thanks to Alexey Boriskin, Claude Paroz and Julien Phalip.
* Fixed #19552 -- Enhanced makemessages handling of ``{# ↵Ramiro Morales2013-01-291-0/+5
| | | | | | | | | | | | | | | | | | | | | | | #}``-style template comments. They are simply ignored now. This allows for a more correct behavior when they are placed before translatable constructs on the same line. Previously, the latter were wrongly ignored because the former were preserved when converting template code to the internal Python-syntax form later fed to xgettext but Python has no ``/* ... */``-style comments. Also, special comments directed to translators are now only taken in account when they are located at the end of a line. e.g.:: {# Translators: ignored #}{% trans "Literal A" %}{# Translators: valid, associated with "Literal B" below #} {% trans "Literal B" %} Behavior of ``{% comment %}...{% endcomment %}``tags remains unchanged. Thanks juneih at redpill-linpro dot com for the report and Claude for his work on the issue.
* [py3] Stopped attempting to translate bytes.Aymeric Augustin2012-08-181-3/+3
| | | | That goes actively against the goal of cleaning string handling.
* [py3] Ported django.utils.encoding.Aymeric Augustin2012-08-071-2/+2
| | | | | | | | | | | * 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.
* [py3] Replaced unicode/str by six.text_type/bytes.Aymeric Augustin2012-07-221-7/+8
|
* Fixed #18269 -- Applied unicode_literals for Python 3 ↵Claude Paroz2012-06-071-1/+3
| | | | | | | compatibility. Thanks Vinay Sajip for the support of his django3 branch and Jannis Leidel for the review.
* Fixed #18040 -- Removed so-called project-level locale ↵Ramiro Morales2012-04-011-18/+0
| | | | | | | | | | | trees from the list of paths the translation loading process takes in account. Deprecated in Django 1.3. Removed completely for Django 1.5. Thanks Claude for the review. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17861 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #17873 -- Removed stale code from translation ↵Jannis Leidel2012-03-121-7/+0
| | | | | | utilities that should have been removed a while ago. Thanks, Aymeric Augustin. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17684 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #17720 -- Stopped the LocaleMiddleware from ↵Jannis Leidel2012-02-181-2/+2
| | | | | | overeagerly using the 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
* Fixed #16516 -- Relaxed the blocktrans rendering a ↵Jannis Leidel2011-09-081-1/+4
| | | | | | little by falling back to the default language if resolving one of the arguments fails, raising a KeyError. Thanks, Claude Paroz and Aymeric Augustin. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16723 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #11585 -- Added ability to translate and prefix ↵Jannis Leidel2011-06-151-0/+3
| | | | | | URL patterns with a 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
* Added missing callables to ↵Jannis Leidel2011-05-101-7/+13
| | | | | | django.utils.translation.__all__ (`override` and `ugettext_noop`). Many thanks to Ramiro for the hint. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16211 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Added django.utils.translation.override context manager ↵Jannis Leidel2011-05-061-0/+15
| | | | | | to easily activate and deactivate a language for a code block. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16166 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Advanced deprecations in django.utils.translation.Russell Keith-Magee2011-04-021-1/+1
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@15987 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #15286 -- Don't show deprecation warning if ↵Jannis Leidel2011-02-121-8/+12
| | | | | | project locale dir is included in LOCALE_PATHS. Thanks to Claude and Ramiro. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15508 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #5494, #10765, #14924 -- Modified the order in ↵Ramiro Morales2011-02-071-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | which translations are read when composing the final translation to offer at runtime. This is slightly backward-incompatible (could result in changed final translations for literals appearing multiple times in different .po files but with different translations). Translations are now read in the following order (from lower to higher priority): For the 'django' gettext domain: * Django translations * INSTALLED_APPS apps translations (with the ones listed first having higher priority) * settings/project path translations (deprecated, see below) * LOCALE_PATHS translations (with the ones listed first having higher priority) For the 'djangojs' gettext domain: * Python modules whose names are passed to the javascript_catalog view * LOCALE_PATHS translations (with the ones listed first having higher priority, previously they weren't included) Also, automatic loading of translations from the 'locale' subdir of the settings/project path is now deprecated. Thanks to vanschelven, vbmendes and an anonymous user for reporting issues, to vanschelven, Claude Paroz and an anonymous contributor for their initial work on fixes and to Jannis Leidel and Claude for review and discussion. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15441 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #4030 -- Added ability to translate language ↵Jannis Leidel2010-12-131-1/+8
| | | | | | names. Thanks to Antti Kaihola and Ramiro Morales for the initial patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14894 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #12201 -- Added a lineno attibute to template ↵Ramiro Morales2010-12-041-2/+2
| | | | | | Token so e.g. we can report line numbers in errors during i18n literals extraction. Thanks madewulf for the report and Claude Paroz for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14813 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #9988 -- Added support for translation contexts. ↵Jannis Leidel2010-11-041-1/+10
| | | | | | Thanks, Claude Paroz. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14450 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #14306 -- Cleaned up django.utils.translation ↵Jannis Leidel2010-09-271-31/+37
| | | | | | module a bit to be quicker. Thanks for the report and initial patch, Anssi Kääriäinen. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13899 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #13234 -- Rejiggered the imports in the ↵Russell Keith-Magee2010-03-291-4/+3
| | | | | | translation utils . Thanks to roklenardic and Spark23 for their reports, and to Alex for his suggestion on a potential fix. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12875 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #12769, #12924 -- Corrected the pickling of ↵Russell Keith-Magee2010-03-271-20/+14
| | | | | | curried and lazy objects, which was preventing queries with translated or related fields from being pickled. And lo, Alex Gaynor didst slayeth the dragon. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12866 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #8654: added `ugettext_lazy` to ↵Jacob Kaplan-Moss2008-08-281-1/+1
| | | | | | `django.utils.translation.__all__`. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8680 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #2920 -- Removed _() from builtins.Malcolm Tredinnick2007-10-211-4/+1
| | | | | | | 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
* Fixed #5674 -- Fixed a typo in a docstring from [6446]. ↵Malcolm Tredinnick2007-10-041-1/+1
| | | | | | Thanks, ski.whitespace@gmail.com. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6448 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #4796. Fixed a problem when using i18n support for ↵Malcolm Tredinnick2007-10-031-5/+9
| | | | | | | | | the first time -- in 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
* Merged Unicode branch into trunk (r4952:5608). This ↵Malcolm Tredinnick2007-07-041-5/+18
| | | | | | | | | | | should be fully 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
* Fixed #3900 -- Included missing function in ↵Malcolm Tredinnick2007-04-031-1/+4
| | | | | | utils/translation/__init__.py. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4907 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Delayed the reading of settings.USE_I18N until the first ↵Malcolm Tredinnick2007-04-021-6/+92
| | | | | | | | | use of the i18n functions. This solves a few import problems we are seeing. Fixed #3687. Refs #2920. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4905 bcc190cf-cafb-0310-a4f2-bffc1f526a37