Django

Code

Ticket #4713 (closed: fixed)

Opened 1 year ago

Last modified 1 year ago

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

Reported by: Indy Assigned to: nobody
Milestone: Component: Internationalization
Version: SVN Keywords: Template, Translation, I18N
Cc: Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 1 Patch needs improvement: 0

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

__init__.diff (0.8 kB) - added by Indy on 06/27/07 15:31:26.
Simple patch
__init__.2.diff (1.2 kB) - added by Indy on 10/07/07 05:05:23.
Updated patch
4713.patch (1.8 kB) - added by SmileyChris on 10/07/07 19:31:50.
Better take on it

Change History

06/27/07 15:31:26 changed by Indy

  • attachment __init__.diff added.

Simple patch

06/27/07 23:40:58 changed by mtredinnick

  • needs_better_patch changed.
  • component changed from Template system to Internationalization.
  • needs_tests changed.
  • owner changed from adrian to mtredinnick.
  • needs_docs changed.
  • stage changed from Unreviewed to Accepted.

10/07/07 05:05:05 changed by Indy

Updated the patch for the new variable resolve system.

10/07/07 05:05:23 changed by Indy

  • attachment __init__.2.diff added.

Updated patch

10/07/07 19:31:50 changed by SmileyChris

  • attachment 4713.patch added.

Better take on it

10/07/07 19:32:33 changed by SmileyChris

  • needs_tests set to 1.

11/16/07 22:04:13 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

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


Add/Change #4713 (Simple tags don't have a translation hook - as opposed to the documentation)




Change Properties
Action