Opened 8 years ago

Closed 7 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: master
Severity: Keywords: Template, Translation, I18N
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: UI/UX:

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 8 years ago.
Simple patch
__init__.2.diff (1.2 KB) - added by Indy 8 years ago.
Updated patch
4713.patch (1.8 KB) - added by SmileyChris 8 years ago.
Better take on it

Download all attachments as: .zip

Change History (7)

Changed 8 years ago by Indy

Simple patch

comment:1 Changed 8 years ago by mtredinnick

  • Component changed from Template system to Internationalization
  • Needs documentation unset
  • Needs tests unset
  • Owner changed from adrian to mtredinnick
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 8 years ago by Indy

Updated the patch for the new variable resolve system.

Changed 8 years ago by Indy

Updated patch

Changed 8 years ago by SmileyChris

Better take on it

comment:3 Changed 8 years ago by SmileyChris

  • Needs tests set

comment:4 Changed 7 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

(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