So for example, on an initial site with the following in
`mysite/mysite/__init__.py`:
{{{
from django.utils.translation import pgettext
var_1 = pgettext(
'context1',
'a singleline string',
)
var_2 = pgettext(
'context2',
(
'A '
'multiline '
'string'
)
)
}}}
`django-admin makemessages -l es_ES` produces:
{{{
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-04-25 17:05+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <L...@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: mysite/mysite/__init__.py:5
msgctxt "context1"
msgid "a singleline string"
msgstr ""
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29362>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => invalid
Comment:
It will work if you simply remove the parentheses around the second
parameter. Anyway, this is gettext behavior, Django cannot do anything
about it.
--
Ticket URL: <https://code.djangoproject.com/ticket/29362#comment:1>