Skip to contentSkip to conversation

gettext: minor fixes

PATCH In review Ævar Arnfjörð Bjarmason 1 participant 5 messages Jun 15, 2016 Kbuild

lore
Share & tools
lore
#0 lore raw

cover gettext: minor fixes

Here are some trivial fixes to the gettext infrastructure. I encountered these while doing more significant work.

It's based on next, and the gettext series I'm about to send soon will be based on this one.

Ævar Arnfjörð Bjarmason (3):
gettext: update test/is.po to match t/t0200/test.c
Makefile: provide a --msgid-bugs-address to xgettext(1)
gettext: msgmerge is.po and add Language: header

 Makefile                 |    7 ++++---
 po/is.po                 |   10 ++++++----
 t/t0200-gettext-basic.sh |    2 +-
 3 files changed, 11 insertions(+), 8 deletions(-)
Signature · 1 line
1.7.2.2.513.g82b8
#1 lore raw

PATCH 1/3 gettext: update test/is.po to match t/t0200/test.c

Change test.c to use '' quotes around "git help COMMAND" as git.c does. An earlier version of the gettext series didn't use '' quotes, but I hadn't run msgmerge since then so I didn't spot it.

For reference, the msgmerge command:

    msgmerge --backup=off -U is.po git.pot
---
 po/is.po                 |    4 ++--
 t/t0200-gettext-basic.sh |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
po/is.po +2 -2
index 95739f1..2f3a220 100644
@@ -10,8 +10,8 @@ msgstr ""
 "Content-Transfer-Encoding: 8bit\n"
 
 #: t/t0200/test.c:4
-msgid "See git help COMMAND for more information on a specific command."
-msgstr "Sjá git help SKIPUN til að sjá hjálp fyrir tiltekna skipun."
+msgid "See 'git help COMMAND' for more information on a specific command."
+msgstr "Sjá 'git help SKIPUN' til að sjá hjálp fyrir tiltekna skipun."
 
 #. TRANSLATORS: This is a test. You don't need to translate it.
 #: t/t0200/test.c:9
t/t0200-gettext-basic.sh +1 -1
index 522338d..e8b7710 100755
@@ -69,7 +69,7 @@ test_expect_success GETTEXT_LOCALE 'xgettext: C extraction of _() and N_() strin
     printf "Sjá git help SKIPUN til að sjá hjálp fyrir tiltekna skipun." >>expect &&
     LANGUAGE=is LC_ALL="$is_IS_locale" gettext "TEST: A C test string" >actual &&
     printf "\n" >>actual &&
-    LANGUAGE=is LC_ALL="$is_IS_locale" gettext "See git help COMMAND for more information on a specific command." >>actual &&
+    LANGUAGE=is LC_ALL="$is_IS_locale" gettext "See '\''git help COMMAND'\'' for more information on a specific command." >>actual &&
     test_cmp expect actual
 '
 
Signature · 1 line
1.7.2.2.513.g82b8
#2 lore raw

PATCH 2/3 Makefile: provide a --msgid-bugs-address to xgettext(1)

In reply to Ævar Arnfjörð Bjarmason

Change the invocations of xgettext to use the --msgid-bugs-address option. This has the effect of adding a Report-Msgid-Bugs-To header to the git.pot and the derived *.po files. Doing so is recommended by the gettext manual.

If this isn't added the Report-Msgid-Bugs-To already in po/is.po will be removed by msgmerge(1).

---
 Makefile |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
Makefile +4 -3
index 62d526a..155b69b 100644
@@ -2008,10 +2008,11 @@ cscope:
 	$(RM) cscope*
 	$(FIND) . -name '*.[hcS]' -print | xargs cscope -b
 
+POT_BUGS = Git Mailing List <[email protected]>
 pot:
-	$(XGETTEXT) --add-comments --keyword=_ --keyword=N_ --output=po/git.pot --language=C $(C_OBJ:o=c) t/t0200/test.c
-	$(XGETTEXT) --add-comments --join-existing --output=po/git.pot --language=Shell $(SCRIPT_SH) t/t0200/test.sh
-	$(XGETTEXT) --add-comments --join-existing --keyword=__ --output=po/git.pot --language=Perl $(SCRIPT_PERL) t/t0200/test.perl
+	$(XGETTEXT) --msgid-bugs-address="$(POT_BUGS)" --add-comments --keyword=_ --keyword=N_ --output=po/git.pot --language=C $(C_OBJ:o=c) t/t0200/test.c
+	$(XGETTEXT) --msgid-bugs-address="$(POT_BUGS)" --add-comments --join-existing --output=po/git.pot --language=Shell $(SCRIPT_SH) t/t0200/test.sh
+	$(XGETTEXT) --msgid-bugs-address="$(POT_BUGS)" --add-comments --join-existing --keyword=__ --output=po/git.pot --language=Perl $(SCRIPT_PERL) t/t0200/test.perl
 
 POFILES := $(wildcard po/*.po)
 MOFILES := $(patsubst po/%.po,share/locale/%/LC_MESSAGES/git.mo,$(POFILES))
Signature · 1 line
1.7.2.2.513.g82b8
#3 lore raw

PATCH 3/3 gettext: msgmerge is.po and add Language: header

In reply to Ævar Arnfjörð Bjarmason

Change is.po to use the header order added by msgmerge(1), this'll make subsequent diffs to it smaller and easier to manage. While I'm at it add a Language header indicating that the file is in Icelandic.

When we add more *.po files later we should add a Language header to those as well.

---
 po/is.po |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
po/is.po +4 -2
index 2f3a220..d34cade 100644
@@ -1,10 +1,12 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: Git\n"
-"PO-Revision-Date: 2010-06-05 19:06 +0000\n"
-"Language-Team: Git Mailing List <[email protected]>\n"
 "Report-Msgid-Bugs-To: Git Mailing List <[email protected]>\n"
+"POT-Creation-Date: 2010-08-28 17:38+0000\n"
+"PO-Revision-Date: 2010-08-28 17:27+0000\n"
 "Last-Translator: Ævar Arnfjörð Bjarmason <[email protected]>\n"
+"Language-Team: Git Mailing List <[email protected]>\n"
+"Language: is\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
Signature · 1 line
1.7.2.2.513.g82b8
#4 lore raw
In reply to Ævar Arnfjörð Bjarmason
Quoted 5 lines · Ævar Arnfjörð Bjarmason

Here are some trivial fixes to the gettext infrastructure. I encountered these while doing more significant work.

It's based on next, and the gettext series I'm about to send soon will be based on this one.

Please disregard this series. It has a bug, and in any case it's better folded into a future gettext series that I'll submit later.