[PATCH 0/3] gettext: minor fixes

DORMANTno replies

5 messages, 1 author, 2016-06-15 · open the first message on its own page

[PATCH 0/3] gettext: minor fixes

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2016-06-15 22:49:24

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(-)

-- 
1.7.2.2.513.g82b8

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

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2016-06-15 22:49:24

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).

Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
 Makefile |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 62d526a..155b69b 100644
--- a/Makefile
+++ b/Makefile
@@ -2008,10 +2008,11 @@ cscope:
 	$(RM) cscope*
 	$(FIND) . -name '*.[hcS]' -print | xargs cscope -b
 
+POT_BUGS = Git Mailing List <git@vger.kernel.org>
 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))
-- 
1.7.2.2.513.g82b8

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

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2016-06-15 22:49:24

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

Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
 po/is.po                 |    4 ++--
 t/t0200-gettext-basic.sh |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/po/is.po b/po/is.po
index 95739f1..2f3a220 100644
--- a/po/is.po
+++ b/po/is.po
@@ -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
diff --git a/t/t0200-gettext-basic.sh b/t/t0200-gettext-basic.sh
index 522338d..e8b7710 100755
--- a/t/t0200-gettext-basic.sh
+++ b/t/t0200-gettext-basic.sh
@@ -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
 '
 
-- 
1.7.2.2.513.g82b8

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

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2016-06-15 22:49:24

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.

Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
 po/is.po |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/po/is.po b/po/is.po
index 2f3a220..d34cade 100644
--- a/po/is.po
+++ b/po/is.po
@@ -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 <git@vger.kernel.org>\n"
 "Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\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 <avarab@gmail.com>\n"
+"Language-Team: Git Mailing List <git@vger.kernel.org>\n"
+"Language: is\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-- 
1.7.2.2.513.g82b8

Re: [PATCH 0/3] gettext: minor fixes

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2016-06-15 22:49:24

On Sat, Aug 28, 2010 at 17:54, Ævar Arnfjörð Bjarmason [off-list ref] wrote:
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help