Opened 18 years ago
Closed 18 years ago
#3970 closed (invalid)
Adding {{{as}}} keyword to {{{trans}}}
Reported by: | Owned by: | hugo | |
---|---|---|---|
Component: | Internationalization | Version: | dev |
Severity: | Keywords: | i18n trans context tags | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Currently the {% trans ... %}
tag allows for translating text to be rendered to the template. However, there are cases where allowing this to be written to the context for further processing is useful. An easy example was when a friend in IRC wanted to have multiple cases for the same phrase on the same page. He did not want to clutter his .po
files with alternate case styles. He just wanted to use the provided filters on the translated text (for one case). The as
keyword would be used like so:
{% trans "this is a test" as translated_text %} {{ translated_text|upper }} {{ translated_text|lower }}
Note that the noop
keyword should still work:
{% trans "this is a test" as translated_text noop %} {{ translated_text|upper }} {{ translated_text|lower }}
I have written patches. Please let me know what you think!
Attachments (2)
Change History (4)
by , 18 years ago
Attachment: | 118n-tags_3970.patch added |
---|
comment:1 by , 18 years ago
Needs tests: | set |
---|
comment:2 by , 18 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
{% blocktrans with "value"|upper as translated_title %}
Alteration to templatetags/i18n.py for as keyword