Opened 17 years ago

Closed 17 years ago

#4713 closed (fixed)

Simple tags don't have a translation hook - as opposed to the documentation

Reported by: Indy Owned by: nobody
Component: Internationalization Version: dev
Severity: Keywords: Template, Translation, I18N
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The documentation states that template tags offers a translation hook and accept _('...') instead of a constant string. This doesn't work for simple tags because resolve_variable isn't aware of translations.
If you trying to do so, you receive the following error:

VariableDoesNotExist at ...
Failed lookup for key [_('...

The attached patch is very simple and resolves this problem.

Attachments (3)

__init__.diff (865 bytes ) - added by Indy 17 years ago.
Simple patch
__init__.2.diff (1.2 KB ) - added by Indy 17 years ago.
Updated patch
4713.patch (1.8 KB ) - added by Chris Beaven 17 years ago.
Better take on it

Download all attachments as: .zip

Change History (7)

by Indy, 17 years ago

Attachment: __init__.diff added

Simple patch

comment:1 by Malcolm Tredinnick, 17 years ago

Component: Template systemInternationalization
Owner: changed from Adrian Holovaty to Malcolm Tredinnick
Triage Stage: UnreviewedAccepted

comment:2 by Indy, 17 years ago

Updated the patch for the new variable resolve system.

by Indy, 17 years ago

Attachment: __init__.2.diff added

Updated patch

by Chris Beaven, 17 years ago

Attachment: 4713.patch added

Better take on it

comment:3 by Chris Beaven, 17 years ago

Needs tests: set

comment:4 by Malcolm Tredinnick, 17 years ago

Resolution: fixed
Status: newclosed

(In [6679]) Fixed #4713 -- Fixed handling of _() in template tag arguments. Based on
patched from Indy and SmileyChris.

Note: See TracTickets for help on using tickets.
Back to Top