diff --git a/rosetta/tests/__init__.py b/rosetta/tests/__init__.py index 4a316b5..a8718e7 100644 --- a/rosetta/tests/__init__.py +++ b/rosetta/tests/__init__.py @@ -552,6 +552,21 @@ class RosettaTestCase(TestCase): # Restore setting to default settings.ROSETTA_ACCESS_CONTROL_FUNCTION = None + def test_25_reflang(self): + rosetta_settings.ENABLE_REFLANG = True + shutil.copy(os.path.normpath(os.path.join(self.curdir, './django.po.issue60.template')), self.dest_file) + self.client.get(reverse('rosetta-pick-file') + '?filter=third-party') + r = self.client.get(reverse('rosetta-language-selection', args=('xx', 0), kwargs=dict())) + r = self.client.get(reverse('rosetta-home')) + + # Verify that there's an option to select a reflang + self.assertTrue('' in str(r.content)) + + r = self.client.get('/rosetta/select-ref/xx/') + r = self.client.get(reverse('rosetta-home')) + # The translated string in the test PO file ends up in the "Reference" column + self.assertTrue('translated-string1' in str(r.content)) + # Stubbed access control function def no_access(user): diff --git a/rosetta/tests/django.po.issue60.template b/rosetta/tests/django.po.issue60.template new file mode 100644 index 0000000..8fd0ec7 --- /dev/null +++ b/rosetta/tests/django.po.issue60.template @@ -0,0 +1,37 @@ +# 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 , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: Rosetta\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-10-21 12:21+0200\n" +"PO-Revision-Date: 2008-09-22 11:02\n" +"Last-Translator: Admin Admin \n" +"Language-Team: French \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Translated-Using: django-rosetta 0.4.RC2\n" + + +msgid "String 1" +msgstr "translated-string1" + +msgid "String 2" +msgstr "" + +#. Translators: This is a text of the base template +#: templates/base.html:43 +msgid "String 3 with comment" +msgstr "" + +msgctxt "Context hint" +msgid "String 4" +msgstr "" + + + +