Add search in msgctxt

This commit is contained in:
Iacopo Spalletti 2018-11-20 10:21:15 +01:00
parent 710da65f04
commit a73e7edc8e
3 changed files with 7 additions and 1 deletions

View file

@ -2,7 +2,7 @@
# 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.
#
#
msgid ""
msgstr ""
"Project-Id-Version: Rosetta\n"
@ -166,5 +166,6 @@ msgstr ""
#. Translators: consectetur adipisicing
#: templates/eiusmod/tempor.html:43
msgctxt "purus pellentesque"
msgid "Lorem ipsum"
msgstr "dolor sit amet"

View file

@ -943,6 +943,10 @@ class RosettaTestCase(TestCase):
r = self.client.get(url % 'adipisicing')
self.assertContains(r, 'Lorem')
# Search context
r = self.client.get(url % 'pellentesque')
self.assertContains(r, 'Lorem')
def test_45_issue186_plural_msg_search(self):
"""Confirm that search of the .po file works for plurals.
"""

View file

@ -601,6 +601,7 @@ class TranslationFormView(RosettaFileLevelMixin, TemplateView):
def concat_entry(e):
return (six.text_type(e.msgstr) +
six.text_type(e.msgid) +
six.text_type(e.msgctxt) +
six.text_type(e.comment) +
u''.join([o[0] for o in e.occurrences]) +
six.text_type(e.msgid_plural) +