Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#22262 closed Cleanup/optimization (fixed)

Error in Translation Comments Documentation for Templates

Reported by: av@… Owned by: Dejan Noveski
Component: Documentation Version: dev
Severity: Normal Keywords: templates, trans tags
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

I think the final example below (at the very bottom of this ticket) is missing some text. Instead of : "#. Translators:", it should be "# Translators: This is a text of the base template #".

Thanks!

Comments for translators in templates
Just like with Python code, these notes for translators can be specified using comments, either with the comment tag:

{% comment %}Translators: View verb{% endcomment %}
{% trans "View" %}

{% comment %}Translators: Short intro blurb{% endcomment %}
<p>{% blocktrans %}A multiline translatable
literal.{% endblocktrans %}</p>
or with the {# ... #} one-line comment constructs:

{# Translators: Label of a button that triggers search #}
<button type="submit">{% trans "Go" %}</button>

{# Translators: This is a text of the base template #}
{% blocktrans %}Ambiguous translatable block of text{% endblocktrans %}
Note
Just for completeness, these are the corresponding fragments of the resulting .po file:

#. Translators: View verb
# path/to/template/file.html:10
msgid "View"
msgstr ""

#. Translators: Short intro blurb
# path/to/template/file.html:13
msgid ""
"A multiline translatable"
"literal."
msgstr ""

# ...

#. Translators: Label of a button that triggers search
# path/to/template/file.html:100
msgid "Go"
msgstr ""

#. Translators:
# path/to/template/file.html:103
msgid "Ambiguous translatable block of text"
msgstr ""

Change History (5)

comment:1 by Baptiste Mispelon, 11 years ago

Easy pickings: set
Triage Stage: UnreviewedAccepted
Version: 1.6master

Hi,

Good catch, the actual comment does appear to be missing for the last example at https://docs.djangoproject.com/en/dev/topics/i18n/translation/#comments-for-translators-in-templates.

For anyone who'd like to contribute a fix, the file to edit is docs/topics/i18n/translation.txt.

Thanks.

comment:2 by Dejan Noveski, 11 years ago

Has patch: set
Owner: changed from nobody to Dejan Noveski
Status: newassigned

comment:3 by Baptiste Mispelon <bmispelon@…>, 11 years ago

Resolution: fixed
Status: assignedclosed

In 958b511a80c01ac010561c8fefe4548203700fa3:

Fixed #22262 -- Added the correct line in the last example of Translator lines

comment:4 by Baptiste Mispelon <bmispelon@…>, 11 years ago

In b86ff4ee82b1dddea7179d72ee3368cb8962cbc6:

[1.5.x] Fixed #22262 -- Added the correct line in the last example of Translator lines

Backport of 958b511a80c01ac010561c8fefe4548203700fa3 from master.

comment:5 by Baptiste Mispelon <bmispelon@…>, 11 years ago

In 141bb90b4c66cca1c4bfafe2a0e5c5777c55c61c:

[1.6.x] Fixed #22262 -- Added the correct line in the last example of Translator lines

Backport of 958b511a80c01ac010561c8fefe4548203700fa3 from master.

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