Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#15376 closed (duplicate)

translation in templates does not allow for a context variable

Reported by: wildfire@… Owned by: nobody
Component: Internationalization Version: 1.3-beta
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

As per http://docs.djangoproject.com/en/dev//topics/i18n/internationalization/#contextual-markers, one of the newer features of the i18n framework allows for a context to be associated with each translatable string.

This works great, if all your strings are in your views.

However it is not so useful if your strings are in your templates and you also want to present the same context to translators (ideally, a single .po file with all translatable strings and contexts).

What would be nice is an extension to the 'trans' tag so that if two values were given to it, i.e.

{% trans "Month name" "May" %}

The contextual portion (the first string) in this case is output to the .po file

This may require some extra careful jiggery-pokery if this option is taken since {% trans "string" noop %} is also possible.

Change History (3)

comment:1 Changed 5 years ago by anonymous

  • milestone set to 1.3
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 5 years ago by jezdez

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

Duplicate of #14806.

comment:3 Changed 4 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

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