git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>,
	"Jiang Xin" <worldhello.net@gmail.com>
Subject: [RFC/PATCH] Makefile: allow po generation through po target
Date: Thu, 17 Mar 2016 16:14:52 +0100	[thread overview]
Message-ID: <2296423d1c46365f1fdeaa12cd1917bc859ff8d9.1458227678.git.git@drmicha.warpmail.net> (raw)
In-Reply-To: <56EAC47F.6000708@drmicha.warpmail.net>

The main Makefile has a "pot" target that recreates the git.pot file of
strings which are marked for translation.

Add a "po" target that recreates the $(LANGUAGE).po files which contain
the translations (or stubs).

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---

Notes:
    This makes it easier to recreate po (and mo) without reading po/README.
    Alternatively, one may think about a Makefile in po/ which does both pot
    and po updates, just like we have makefiles in t/ and Ducumentation/.
    
    This doesn't give you proper before-after diffs yet, but at least the after
    state.

 Makefile | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/Makefile b/Makefile
index 24bef8d..bb60a34 100644
--- a/Makefile
+++ b/Makefile
@@ -445,6 +445,7 @@ TCL_PATH = tclsh
 TCLTK_PATH = wish
 XGETTEXT = xgettext
 MSGFMT = msgfmt
+MSGMERGE = msgmerge
 CURL_CONFIG = curl-config
 PTHREAD_LIBS = -lpthread
 PTHREAD_CFLAGS =
@@ -1514,6 +1515,7 @@ ifndef V
 	QUIET_LNCP     = @echo '   ' LN/CP $@;
 	QUIET_XGETTEXT = @echo '   ' XGETTEXT $@;
 	QUIET_MSGFMT   = @echo '   ' MSGFMT $@;
+	QUIET_MSGMERGE = @echo '   ' MSGMERGE $@;
 	QUIET_GCOV     = @echo '   ' GCOV $@;
 	QUIET_SP       = @echo '   ' SP $<;
 	QUIET_RC       = @echo '   ' RC $@;
@@ -2088,6 +2090,9 @@ pot: po/git.pot
 POFILES := $(wildcard po/*.po)
 MOFILES := $(patsubst po/%.po,po/build/locale/%/LC_MESSAGES/git.mo,$(POFILES))
 
+.PHONY: po
+po: $(POFILES)
+
 ifndef NO_GETTEXT
 all:: $(MOFILES)
 endif
@@ -2095,6 +2100,9 @@ endif
 po/build/locale/%/LC_MESSAGES/git.mo: po/%.po
 	$(QUIET_MSGFMT)mkdir -p $(dir $@) && $(MSGFMT) -o $@ $<
 
+po/%.po: po/git.pot
+	$(QUIET_MSGMERGE)$(MSGMERGE) --add-location --backup=off -q -U $@ $<
+
 FIND_SOURCE_FILES = ( git ls-files '*.[hcS]' 2>/dev/null || \
 			$(FIND) . \( -name .git -type d -prune \) \
 				-o \( -name '*.[hcS]' -type f -print \) )
-- 
2.8.0.rc2.197.g3b88641.dirty

  reply	other threads:[~2016-03-17 15:14 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-10 23:04 [ANNOUNCE] Git v2.8.0-rc2 Junio C Hamano
2016-03-12  9:11 ` Max Horn
2016-03-14 18:10   ` Junio C Hamano
2016-03-14 15:29 ` Michael J Gruber
2016-03-14 15:30   ` [PATCH] wt-status: allow "ahead " to be picked up by l10n Michael J Gruber
2016-03-14 15:57     ` Junio C Hamano
2016-03-14 15:56   ` [ANNOUNCE] Git v2.8.0-rc2 Junio C Hamano
2016-03-14 17:47     ` Junio C Hamano
2016-03-16 13:33       ` Michael J Gruber
2016-03-16 13:40         ` Duy Nguyen
2016-03-16 15:32           ` Michael J Gruber
2016-03-16 16:30             ` Junio C Hamano
2016-03-17 14:51               ` Michael J Gruber
2016-03-17 15:14                 ` Michael J Gruber [this message]
2016-03-17 22:42                   ` [RFC/PATCH] Makefile: allow po generation through po target Junio C Hamano
2016-03-17 16:15                 ` [ANNOUNCE] Git v2.8.0-rc2 Junio C Hamano
2016-03-20  9:45         ` Jiang Xin
2016-03-20 15:11           ` Michael J Gruber
2016-03-21 20:01             ` Junio C Hamano
2016-03-22 10:00               ` Michael J Gruber
2016-03-22 17:43                 ` Junio C Hamano
2016-03-15 16:42   ` Jiang Xin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2296423d1c46365f1fdeaa12cd1917bc859ff8d9.1458227678.git.git@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pclouds@gmail.com \
    --cc=worldhello.net@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).