Code

Makefile: only add gettext tests on XGETTEXT_INCLUDE_TESTS=YesPlease
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Mon, 13 Sep 2010 12:42:29 +0000 (12:42 +0000)
committerÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Sat, 30 Oct 2010 07:58:18 +0000 (07:58 +0000)
Change the "pot" target so that the xgettext(1) invocation no longer
include test files from t/t0200.

These should only be included in the Icelandic is.po file since Git's
own test suite uses them for regression tests, but nobody else should
translate them. Previously I indicated this with a TRANSLATORS comment
for all the strings:

    #. TRANSLATORS: This is a test. You don't need to translate it.
    #, c-format
    msgid "TEST: A C test string %s"
    msgstr ""

But if translators follow those instructions they'll never have 100%
translation coverage. It's much better to add a hidden option so that
is.po now has to use a special git.pot file for msgmerge(1):

    make pot XGETTEXT_INCLUDE_TESTS=YesPlease

But everything else can continue to use the documented:

    make pot

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Makefile

index 4064df1001bbb94a649a2108a0caf09cbc4fe528..e1650baa25d1e430dd5913006b123f26b046a2bf 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2073,9 +2073,15 @@ XGETTEXT_OPTIONS_C = $(XGETTEXT_OPTIONS) --keyword=_ --keyword=N_ --language=C
 XGETTEXT_OPTIONS_SH = $(XGETTEXT_OPTIONS) --language=Shell
 XGETTEXT_OPTIONS_PERL = $(XGETTEXT_OPTIONS) --keyword=__ --language=Perl
 
-LOCALIZED_C = $(C_OBJ:o=c) t/t0200/test.c
-LOCALIZED_SH = $(SCRIPT_SH) t/t0200/test.sh
-LOCALIZED_PERL = $(SCRIPT_PERL) t/t0200/test.perl
+LOCALIZED_C = $(C_OBJ:o=c)
+LOCALIZED_SH = $(SCRIPT_SH)
+LOCALIZED_PERL = $(SCRIPT_PERL)
+
+ifdef XGETTEXT_INCLUDE_TESTS
+LOCALIZED_C += t/t0200/test.c
+LOCALIZED_SH += t/t0200/test.sh
+LOCALIZED_PERL += t/t0200/test.perl
+endif
 
 pot:
        $(XGETTEXT) $(XGETTEXT_OPTIONS_C) $(LOCALIZED_C)