git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Makefile: only add gettext tests on XGETTEXT_INCLUDE_TESTS=YesPlease

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Sep 13, 2010, 12:47 UTC
Message-ID
<1284382076-1907-1-git-send-email-avarab@gmail.com>
In-Reply-To
<alpine.DEB.2.00.1009130810580.31516@ds9.cixit.se>

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>
---
On Mon, Sep 13, 2010 at 07:15, Peter Krefting <peter@softwolves.pp.se> wrote:
Show 8 quoted lines
> Ævar Arnfjörð Bjarmason:
>> * You're translating the TEST: messages, it's redundant except for
>>  Icelandic (which uses it for git.git tests), but I can see how it
>>  can be painful to have non-100% translation coverage.
>
> I just copied them verbatim, I didn't actually translate them. Without
> translating them I can't tell if I've translated everything when doing a
> "msgfmt -vvv --check sv.po".

This is a much better solution then. I'll submit this as part of an updated ab/i18n series.

 Makefile |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 8cec626..680e578 100644
--- a/Makefile
+++ b/Makefile
@@ -2047,9 +2047,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)
-- 
1.7.2.3.313.gcd15
Previous: Peter KreftingNext: Ævar Arnfjörð Bjarmason
Message 4 of 24 in “Add Swedish translation.”
  1. 2/2 Add Swedish translation.Peter Krefting, Sep 12, 2010
  2. Ævar Arnfjörð BjarmasonSep 12, 2010
  3. Peter KreftingSep 13, 2010
  4. Makefile: only add gettext tests on XGETTEXT_INCLUDE_TESTS=YesPleaseÆvar Arnfjörð Bjarmason, Sep 13, 2010
  5. Ævar Arnfjörð BjarmasonSep 13, 2010
  6. Peter KreftingSep 13, 2010
  7. Ævar Arnfjörð BjarmasonSep 13, 2010
  8. Peter KreftingSep 14, 2010
  9. Ævar Arnfjörð BjarmasonSep 15, 2010
  10. Peter KjellerstedtSep 13, 2010
  11. Peter KreftingSep 15, 2010
  12. Peter KjellerstedtSep 15, 2010
  13. Robin RosenbergSep 15, 2010
  14. Peter KjellerstedtSep 16, 2010
  15. Jeremiah FosterSep 16, 2010
  16. Peter KreftingSep 16, 2010
  17. Ævar Arnfjörð BjarmasonSep 16, 2010
  18. Michael J GruberSep 16, 2010
  19. Ævar Arnfjörð BjarmasonSep 16, 2010
  20. Peter KreftingSep 16, 2010
  21. Robin RosenbergSep 16, 2010
  22. Peter KreftingSep 16, 2010
  23. Ævar Arnfjörð BjarmasonSep 16, 2010
  24. Göran UddeborgSep 18, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.