Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/django/templatetags/i18n.py
Commit message (Collapse)AuthorAgeFilesLines
* Fixed #25331 -- Removed trailing blank lines in docstrings.Maxime Lorant2015-08-311-1/+0
|
* Fixed #24257 -- Corrected i18n handling of percent signs.Doug Beck2015-08-121-0/+6
| | | | | | | | | | | | | | | 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 "%%".
* Fixed #21695 -- Added asvar option to blocktrans.Matthew Somerville2015-07-011-3/+24
| | | | Thanks Bojan Mihelac for the initial patch.
* Fixed #24230 -- Added translated language name for i18n ↵Tomáš Ehrlich2015-06-021-0/+8
| | | | template tag/filter.
* Removed cases of six.iter* wrapped in a list()Curtis Maloney2015-04-181-1/+1
| | | | | There's absolutely no advantage [and a mild performance hit] to using six.iter* in these cases.
* Fixed #24372 - Replaced TokenParser usage with ↵Preston Timmons2015-03-031-40/+49
| | | | traditional parsing.
* Set context.template instead of context.engine while ↵Aymeric Augustin2015-02-191-1/+1
| | | | | | | | rendering. This opens more possibilities, like accessing context.template.origin. It also follows the chain of objects instead of following a shortcut.
* Sorted imports with isort; refs #23860.Tim Graham2015-02-061-4/+5
|
* Fixed #24149 -- Normalized tuple settings to lists.darkryder2015-02-031-1/+1
|
* Cleaned up the django.template namespace.Aymeric Augustin2014-12-281-3/+2
| | | | | | | | | 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.
* Fixed #23968 -- Replaced list comprehension with ↵Jon Dufresne2014-12-081-1/+1
| | | | generators and dict comprehension
* Encapsulated TEMPLATE_STRING_IF_INVALID in Engine.Aymeric Augustin2014-11-231-1/+1
|
* Fix many many typos in comments throughout the codebaseAlex Gaynor2014-04-261-1/+1
|
* Fixed #21417 -- Expanded TEMPLATE_STRING_IF_INVALID in ↵Claude Paroz2014-02-081-2/+8
| | | | | | | | blocktrans Thanks keturn for the reporti, Chris Medrela for details and Tim Graham for the review. Refs #19915.
* Fixed #5849 -- Strip whitespace from blocktransBouke Haarsma2013-11-071-3/+12
| | | | | | | | | | | 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.
* Fixed the remaining E302 violations int eh django packageAlex Gaynor2013-11-031-0/+10
|
* Fixed up some more flake8 violations (this particular ↵Alex Gaynor2013-10-261-2/+2
| | | | violation still has many occurrences in the tests/ dir so it can't be removed from setup.cfg yet)
* Removed a few trailing backslashes.Aymeric Augustin2013-09-221-1/+1
| | | | We have always been at war with trailing backslashes.
* Fixed #20989 -- Removed explicit list comprehension ↵Tim Graham2013-08-291-1/+1
| | | | | | | inside dict() and tuple() Thanks jeroen.pulles at redslider.net for the suggestion and helper script.
* Fixed #18003 -- Preserved tracebacks when re-raising errors.konarkmodi2013-03-191-2/+5
| | | | Thanks jrothenbuhler for draft patch, Konark Modi for updates.
* Fixed #19915 - Made blocktrans tag honor ↵matiasb2013-03-031-2/+5
| | | | | | TEMPLATE_STRING_IF_INVALID. Thanks Natalia Bidart for the report and Matías Bordese for the fix.
* Remove leading underscore from a function that's all ↵Carl Meyer2013-02-251-3/+3
| | | | | | | | growed up now. This function is now the de facto standard function for rendering values in a template, and is imported by two other built-in template modules. It shouldn't have a leading underscore.
* Used token.split_contents() for tokenisation in template ↵Baptiste Mispelon2013-02-231-6/+9
| | | | | | tags accepting variables. Fixed #6271, #18260.
* Fixed #19088 -- Always escape % inside blocktrans tagClaude Paroz2012-10-231-6/+7
| | | | Thanks vlinhart for the report and Łukasz Rekucki for the patch.
* [py3] Fixed access to dict keys/values/items.Aymeric Augustin2012-08-071-1/+1
|
* [py3] Replaced basestring by six.string_types.Aymeric Augustin2012-07-221-1/+2
|
* Fixed #18269 -- Applied unicode_literals for Python 3 ↵Claude Paroz2012-06-071-4/+5
| | | | | | | compatibility. Thanks Vinay Sajip for the support of his django3 branch and Jannis Leidel for the review.
* Fixed #18393 -- Prevented blocktrans to crash when a ↵Julien Phalip2012-05-281-1/+1
| | | | variable name is badly formatted.
* Removed with_statement imports, useless in Python >= ↵Claude Paroz2012-03-301-1/+0
| | | | | | 2.6. Refs #17965. Thanks jonash for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17828 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #14806 -- Added support for contextual ↵Julien Phalip2011-10-191-12/+65
| | | | | | translations to the `trans` and `blocktrans` template tags. Thanks to jtiai for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17015 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #16721 -- Made sure that blocktrans correctly ↵Jannis Leidel2011-09-081-2/+3
| | | | | | handles percents (%), even in the plural block. Thanks for the initial patch, Claude Paroz. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16730 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #16516 -- Relaxed the blocktrans rendering a ↵Jannis Leidel2011-09-081-1/+6
| | | | | | 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 #16717 -- Added ability to store result of trans ↵Jannis Leidel2011-08-301-10/+21
| | | | | | template tag in context variable. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16712 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #16402 -- Correctly check for number of arguments ↵Jannis Leidel2011-07-041-1/+1
| | | | | | to new language template tag. Thanks, Florian Apolloner. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16504 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #16332 -- Added language template tag that ↵Jannis Leidel2011-07-041-7/+46
| | | | | | switches the activate language for the enclosed template section, e.g. to allow translation of URLs as added in r16405. Many thanks to Florian Apolloner and Orne Brocaar. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16501 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Replaced old-style with new-style decorator syntax.Jannis Leidel2011-05-011-12/+10
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@16138 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #15535 -- Stopped the blocktrans template tag from ↵Jannis Leidel2011-03-021-1/+1
| | | | | | raising a KeyError if an included variable can't be found in the context. Thanks, melinath. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15709 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixes #7817 and #9456.Chris Beaven2010-12-181-26/+38
| | | | | | | | | | | | | | | - The include tag now has a 'with' option to include to provide extra context vairables to the included template. - The include tag now has an 'only' option to exclude the current context when rendering the included template. - The with tag now accepts multiple variable assignments. - The with, include and blocktrans tags now use a new keyword argument format for variable assignments (e.g. `{% with foo=1 bar=2 %}`). git-svn-id: http://code.djangoproject.com/svn/django/trunk@14922 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #4030 -- Added ability to translate language ↵Jannis Leidel2010-12-131-0/+83
| | | | | | 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 #12248 -- Refactored django.template to get code ↵Russell Keith-Magee2010-11-271-1/+2
| | | | | | out of __init__.py, to help with avoiding circular import dependencies. Thanks to Tom Tobin for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14722 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #14126 -- Fixed an issue with changes to the ↵Jannis Leidel2010-10-161-2/+1
| | | | | | blocktrans tag introduced in r13967 related to multiple plural forms. Thanks, mark0978, svetlyak40wt and Ramiro. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14239 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #13568 -- Fixed the blocktrans tag to not raise a ↵Jannis Leidel2010-10-011-1/+3
| | | | | | KeyError if the number of variables in the singular and the plural block differ. Thanks, deloide. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13967 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #5972 - Allow the template filters to be used with ↵Jannis Leidel2010-02-221-8/+22
| | | | | | the trans tag. Thanks for the initial patch, Dmitri Fedortchenko. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12472 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Changed a whole bunch of places to raise exception ↵Adrian Holovaty2010-01-101-9/+9
| | | | | | instances instead of old-style raising exception classes plus a comma. Good for the future Python 3 conversion git-svn-id: http://code.djangoproject.com/svn/django/trunk@12180 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #10369 -- Fixed auto-escaping inside "tran" and ↵Malcolm Tredinnick2009-04-111-3/+3
| | | | | | | | "blocktrans" tags. Patch from Andrew Badr. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10519 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #4539 -- Fixed a subtle context resolving bug in ↵Malcolm Tredinnick2008-03-171-2/+5
| | | | | | | | | the i18n template tag. Excellent debugging from permonik@mesias.brnonet.cz. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7261 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #5969 -- Corrected a problem introduced in [6682].Malcolm Tredinnick2007-11-181-1/+1
| | | | | | | *sigh* As usual, the one case I forget to test turned out to be broken. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6689 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed a few problems with variable resolving inside of ↵Malcolm Tredinnick2007-11-171-13/+19
| | | | | | | | | blocktrans tags. A couple of these were exposed by the auto-escaping changes, but I suspect the other one has been hiding in plain sight for a while. Fixed #5952, #5953 git-svn-id: http://code.djangoproject.com/svn/django/trunk@6682 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #4982 -- Fixed handling of '%' symbols in ↵Malcolm Tredinnick2007-10-201-2/+6
| | | | | | | | | 'blocktrans' blocks. Thanks, permonik@mesias.brnonet.cz. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6565 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #3453: introduced a new template variable ↵Jacob Kaplan-Moss2007-09-211-3/+3
| | | | | | | | | resolution system by Brian Harring (thanks!). The upshot is that variable resolution is about 25% faster, and you should see a measurable performance increase any time you've got long or deeply nested loops. Variable resolution has changed behind the scenes -- see the note in templates_python.txt -- but template.resolve_variable() still exists. This should be fully backwards-compatible. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6399 bcc190cf-cafb-0310-a4f2-bffc1f526a37