# HG changeset patch # User palgarvio # Date 1181855834 0 # Node ID f7aa8105e5a8e33fb8dfc0f785e6dd85f4febe4d # Parent eeed857fa3d55c811ca221701e58f5efb40f9233 Adding a test project to play with :) diff --git a/babel/messages/tests/data/project/CVS/a_test_file.txt b/babel/messages/tests/data/project/CVS/a_test_file.txt new file mode 100644 --- /dev/null +++ b/babel/messages/tests/data/project/CVS/a_test_file.txt @@ -0,0 +1,1 @@ +Just a test file. diff --git a/babel/messages/tests/data/project/CVS/an_example.txt b/babel/messages/tests/data/project/CVS/an_example.txt new file mode 100644 diff --git a/babel/messages/tests/data/project/CVS/this_wont_normally_be_here.py b/babel/messages/tests/data/project/CVS/this_wont_normally_be_here.py new file mode 100644 --- /dev/null +++ b/babel/messages/tests/data/project/CVS/this_wont_normally_be_here.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- + +# This file won't normally be in this directory. +# It IS only for tests + +from gettext import ngettext + +def foo(): + # Note: This will have the TRANSLATOR: tag but shouldn't + # be included on the extracted stuff + print ngettext('FooBar', 'FooBars', 1) diff --git a/babel/messages/tests/data/project/__init__.py b/babel/messages/tests/data/project/__init__.py new file mode 100644 diff --git a/babel/messages/tests/data/project/file1.py b/babel/messages/tests/data/project/file1.py new file mode 100644 --- /dev/null +++ b/babel/messages/tests/data/project/file1.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +# file1.py for tests + +from gettext import gettext as _ +def foo(): + # TRANSLATOR: This will be a translator coment, + # that will include several lines + print _('bar') diff --git a/babel/messages/tests/data/project/file2.py b/babel/messages/tests/data/project/file2.py new file mode 100644 --- /dev/null +++ b/babel/messages/tests/data/project/file2.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# file2.py for tests + +from gettext import ngettext + +def foo(): + # Note: This will have the TRANSLATOR: tag but shouldn't + # be included on the extracted stuff + print ngettext('foobar', 'foobars', 1) diff --git a/babel/messages/tests/data/project/mapping.cfg b/babel/messages/tests/data/project/mapping.cfg new file mode 100644 --- /dev/null +++ b/babel/messages/tests/data/project/mapping.cfg @@ -0,0 +1,6 @@ +# Extraction from Python source files +[python: project/**.py] + +# Ignore extraction from HTML and XHTML templates +[ignore: foobar/**/templates/**.html] +[ignore: foobar/**/templates/**.xhtml] \ No newline at end of file diff --git a/babel/messages/tests/data/project/templates/index.html b/babel/messages/tests/data/project/templates/index.html new file mode 100644 --- /dev/null +++ b/babel/messages/tests/data/project/templates/index.html @@ -0,0 +1,14 @@ + + +
+