summaryrefslogtreecommitdiff
path: root/django/utils/translation
AgeCommit message (Collapse)Author
2015-12-18Fixed #25915 -- Allowed language not in Django's default LANGUAGESClaude Paroz
This fixes a regression introduced by a5f6cbce07. Thanks Gavin Wahl for the report and Tim Graham for the review.
2015-11-11Fixed #25720 -- Made gettext() return bytestring on Python 2 if input is ↵Marti Raudsepp
bytestring. This is consistent with the behavior of Django 1.7.x and earlier.
2015-10-22Fixed #25571 -- Fixed boolean evaluation of ungettext_lazyClaude Paroz
2015-09-04Fixed #25297 -- Allowed makemessages to work with {% trans %} tags that use ↵Alexandre Pocquet
template filters.
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-08-12Fixed #24257 -- Corrected i18n handling of percent signs.Doug Beck
Refactored tests to use a sample project. Updated extraction: * Removed special handling of single percent signs. * When extracting messages from template text, doubled all percent signs so they are not interpreted by gettext as string format flags. All strings extracted by gettext, if containing a percent sign, will now be labeled "#, python-format". Updated translation: * Used "%%" for "%" in template text before calling gettext. * Updated {% trans %} rendering to restore "%" from "%%".
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
2015-04-24Fixed #24063 -- Allowed locale variants supported by gettext.Michal Čihař
The locale code can contain a variant after @, so allowed that.
2015-04-04Fixed #24569 -- Made some translation functions accept None valueClaude Paroz
get_language() can return None when translations are deactivated. Thanks Nicola Peduzzi for the reporti and Tim Graham for the review.
2015-03-21Fixed #24515 -- Fixed DjangoTranslation plural handlingClaude Paroz
2015-03-20Cleaned up the template debug implementation.Preston Timmons
This patch does three major things: * Merges the django.template.debug implementation into django.template.base. * Simplifies the debug implementation. The old implementation copied debug information to every token and node. The django_template_source attribute was set in multiple places, some quite hacky, like django.template.defaulttags.ForNode. Debug information is now annotated in two high-level places: * Template.compile_nodelist for errors during parsing * Node.render_annotated for errors during rendering These were chosen because they have access to the template and context as well as to all exceptions that happen during either the parse or render phase. * Moves the contextual line traceback information creation from django.views.debug into django.template.base.Template. The debug views now only deal with the presentation of the debug information.
2015-02-28Fixed #24413 -- Prevented translation fallback for EnglishClaude Paroz
Thanks Tomasz Kontusz for the report, Baptiste Mispelon for analysis and Tim Graham for the review.
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2015-01-17Removed deprecated Chinese language codes; refs #18149.Tim Graham
2015-01-08Fixed #24073 -- Returned None for get_language when translations are deactivatedClaude Paroz
This fixes a regression caused by f7c287fca9. Thanks Markus Holtermann for identifying the regression.
2014-12-28Cleaned up the django.template namespace.Aymeric Augustin
Since this package is going to hold both the implementation of the Django Template Language and the infrastructure for Multiple Template Engines, it should be untied from the DTL as much as possible within our backwards-compatibility policy. Only public APIs (i.e. APIs mentioned in the documentation) were left.
2014-12-26Fixed #24045 -- Removed useless mark_safe() call in trans_null.pyTim Graham
2014-12-24Fixed #20349 -- Moved setting_changed signal to django.core.signals.Collin Anderson
This removes the need to load django.test when not testing.
2014-11-19Simplified caching of supported languages.Aymeric Augustin
2014-09-21Fixed #23196 -- Short-circuited empty string translationYuri Kriachko
Translating an empty string used to return the gettext catalog metadata instead of the empty string. Thanks Ned Batchelder for the suggestion, Tim Graham for the review and Anton Berezin and Claude Paroz for contributions to the patch.
2014-09-05Limited lines to 119 characters in django/Tim Graham
refs #23395.
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-06-23Fixed #8033 -- Explained app registry error during translation setupClaude Paroz
Thanks Tim Graham and Aymeric Augustin for the review.
2014-06-16Fixed #21498: Don't use a fallback language if you're en-us.Andrew Godwin
2014-06-06Fixed #22773 -- Forced templatize() to return unicodeClaude Paroz
2014-05-25Removed code deprecated from Django 1.2Claude Paroz
2014-05-24Applied unicode_literals to makemessages commandClaude Paroz
This also fixes #22686 as some sort of side-effect.
2014-05-06Fixed #22586 -- Added LANGUAGE_SESSION_KEY to __all__.Tim Graham
Thanks david.fischer.ch at gmail.com for the report.
2014-05-02Fixed #22565 -- Prevented pgettext_lazy crash with bytestring inputClaude Paroz
Thanks ygbo for the report.
2014-04-30flake8 fixes.Tim Graham
2014-04-30Refactored DjangoTranslation classDoug Beck
Also fixes #18192 and #21055.
2014-04-02Refactor. Stop using memory for list copies.Tomasz Wysocki
2014-03-29Increased memoization cache size for language codes.Aymeric Augustin
There may be more than 100 (default maxsize) commonly seen xx-yy values on some sites. The additional memory consumption isn't significant. Also added a comment explaining why this cache must have a maxsize.
2014-03-21Removed reading of old 'django_language' session variable per deprecation ↵Tim Graham
timeline. refs #5789.
2014-03-18Fixed #22283 -- Updated documentation referring to non-existent tuples.Matthew Somerville
2014-03-08Fixed #21188 -- Introduced subclasses for to-be-removed-in-django-XX warningsClaude Paroz
Thanks Anssi Kääriäinen for the idea and Simon Charette for the review.
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-12-24Renamed AppCache to Apps.Aymeric Augustin
Also renamed app_cache to apps and "app cache" to "app registry". Deprecated AppCache.app_cache_ready() in favor of Apps.ready().
2013-12-22Moved apps back in the toplevel django namespace.Aymeric Augustin
Reverted 4a56a93cc458e9ab4dcab95d9f5067d4975dd1a2.
2013-12-22Stopped iterating on INSTALLED_APPS.Aymeric Augustin
Used the app cache's get_app_configs() method instead.
2013-12-04Fixed 21406 -- Made blocktrans 'trimmed' option preserve line numbers.Bouke Haarsma
Thanks Bouke Haarsma for report, fix and initial patch.
2013-11-20Fixed #21458 -- Made check_for_language more resistant to malformed input.Baptiste Mispelon
Thanks to Sergey Sorokin for the report and to Bouke Haarsma for the review.
2013-11-11Fixed #21351 -- Replaced memoize with Python's lru_cache.Bouke Haarsma
Replaced the custom, untested memoize with a similar decorator from Python's 3.2 stdlib. Although some minor performance degradation (see ticket), it is expected that in the long run lru_cache will outperform memoize once it is implemented in C. Thanks to EvilDMP for the report and Baptiste Mispelon for the idea of replacing memoize with lru_cache.
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.