mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #10004 and #12320 -- Enabled the makemessages management command to collect comments for translators that start with the "Translators" keyword. Thanks for the report and patches, martinb and Claude Paroz.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14595 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -100,6 +100,30 @@ instead of positional interpolation (e.g., ``%s`` or ``%d``) whenever you
|
||||
have more than a single parameter. If you used positional interpolation,
|
||||
translations wouldn't be able to reorder placeholder text.
|
||||
|
||||
.. _translator-comments:
|
||||
|
||||
Comments for translators
|
||||
------------------------
|
||||
|
||||
.. versionadded:: 1.3
|
||||
|
||||
If you would like to give translators hints about a translatable string, you
|
||||
can add a comment prefixed with the ``Translators`` keyword on the line
|
||||
preceding the string, e.g.::
|
||||
|
||||
def my_view(request):
|
||||
# Translators: This message appears on the home page only
|
||||
output = ugettext("Welcome to my site.")
|
||||
|
||||
This also works in templates with the :ttag:`comment` tag:
|
||||
|
||||
.. code-block:: django+html
|
||||
|
||||
{% comment %}Translators: This is a text of the base template {% endcomment %}
|
||||
|
||||
The comment will then appear in the resulting .po file and should also be
|
||||
displayed by most translation tools.
|
||||
|
||||
Marking strings as no-op
|
||||
------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user