# HG changeset patch # User palgarvio # Date 1181855834 0 # Node ID 36f256561aefd42367910afaedbcf3a7619cc08b # Parent f01ae81a791933cf200fd88a5bf99742b2a0faac 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 @@ + + + + Just a Tests Test + + + + + + diff --git a/babel/messages/tests/data/project/templates/index.xhtml b/babel/messages/tests/data/project/templates/index.xhtml new file mode 100644 --- /dev/null +++ b/babel/messages/tests/data/project/templates/index.xhtml @@ -0,0 +1,14 @@ + + + + Just a Tests Test + + + + + + diff --git a/babel/messages/tests/data/project/templates/layout.html b/babel/messages/tests/data/project/templates/layout.html new file mode 100644 --- /dev/null +++ b/babel/messages/tests/data/project/templates/layout.html @@ -0,0 +1,14 @@ + + + + Just a Tests Test + + + + + + diff --git a/babel/messages/tests/data/project/templates/layout.xhtml b/babel/messages/tests/data/project/templates/layout.xhtml new file mode 100644 --- /dev/null +++ b/babel/messages/tests/data/project/templates/layout.xhtml @@ -0,0 +1,14 @@ + + + + Just a Tests Test + + + + + + diff --git a/babel/messages/tests/data/setup.cfg b/babel/messages/tests/data/setup.cfg new file mode 100644 --- /dev/null +++ b/babel/messages/tests/data/setup.cfg @@ -0,0 +1,6 @@ +[extract_messages] +msgid_bugs_address = bugs.address@email.tld +copyright_holder = FooBar, TM +add_comments = TRANSLATOR:,TRANSLATORS: +output_file = project/i18n/project.pot + diff --git a/babel/messages/tests/data/setup.py b/babel/messages/tests/data/setup.py new file mode 100755 --- /dev/null +++ b/babel/messages/tests/data/setup.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# vim: sw=4 ts=4 fenc=utf-8 +# ============================================================================= +# $Id$ +# ============================================================================= +# $URL$ +# $LastChangedDate$ +# $Rev$ +# $LastChangedBy$ +# ============================================================================= +# Copyright (C) 2006 Ufsoft.org - Pedro Algarvio +# +# Please view LICENSE for additional licensing information. +# ============================================================================= + +# THIS IS A BOGUS PROJECT + +from setuptools import setup, find_packages + +setup( + name = 'TestProject', + version = '0.1', + license = 'BSD', + author = 'Foo Bar', + author_email = 'foo@bar.tld', + packages = find_packages(), +)