diff --git a/CHANGES b/CHANGES index efc95ae..90333a2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +Version 0.7.4 +------------- +* New ROSETTA_POFILENAMES setting. (PR #44, thanks @wrboyce) + Version 0.7.3 ------------- * Fix for test settings leaking onto global settings: LANGUAGES was overridden and not set back (Issue #81 - Thanks @zsoldosp) diff --git a/rosetta/__init__.py b/rosetta/__init__.py index 58720e7..2865a48 100644 --- a/rosetta/__init__.py +++ b/rosetta/__init__.py @@ -1,4 +1,4 @@ -VERSION = (0, 7, 3) +VERSION = (0, 7, 4) def get_version(svn=False, limit=3): diff --git a/rosetta/tests/pr44.po.template b/rosetta/tests/pr44.po.template new file mode 100644 index 0000000..a5c30ef --- /dev/null +++ b/rosetta/tests/pr44.po.template @@ -0,0 +1,27 @@ +# 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 "" + +#~ msgid "String 2" +#~ msgstr "" + + + diff --git a/rosetta/tests/tests.py b/rosetta/tests/tests.py index d731883..035a288 100644 --- a/rosetta/tests/tests.py +++ b/rosetta/tests/tests.py @@ -596,6 +596,28 @@ class RosettaTestCase(TestCase): except ImproperlyConfigured: pass + def test_30_pofile_names(self): + POFILENAMES = rosetta_settings.POFILENAMES + rosetta_settings.POFILENAMES = ('pr44.po', ) + + os.unlink(self.dest_file) + destfile = os.path.normpath(os.path.join(self.curdir, '../locale/xx/LC_MESSAGES/pr44.po')) + shutil.copy(os.path.normpath(os.path.join(self.curdir, './pr44.po.template')), destfile) + + self.client.get(reverse('rosetta-pick-file') + '?filter=third-party') + r = self.client.get(reverse('rosetta-home')) + self.assertTrue('xx/LC_MESSAGES/pr44.po' in str(r.content)) + + r = self.client.get(reverse('rosetta-language-selection', args=('xx', 0,), kwargs=dict()) + '?rosetta') + r = self.client.get(reverse('rosetta-home')) + + self.assertTrue('dummy language' in str(r.content)) + + os.unlink(destfile) + rosetta_settings.POFILENAMES = POFILENAMES + + + # Stubbed access control function def no_access(user): return False