git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Stimming <stimming@tuhh.de>
To: Paul Mackerras <paulus@samba.org>
Cc: Brett Schwarz <brett_schwarz@yahoo.com>,
	git@vger.kernel.org, Junio Hamano <gitster@pobox.com>
Subject: [PATCH] gitk.git: Add Makefile with rules for po file creation.
Date: Sat, 28 Jul 2007 14:52:17 +0200	[thread overview]
Message-ID: <200707281452.17560.stimming@tuhh.de> (raw)
In-Reply-To: <200707281440.26660.stimming@tuhh.de>

Signed-off-by: Christian Stimming <stimming@tuhh.de>
---
Similar to the previous patch with the message markup, this one has also been created against the kernel.org gitk.git. These would be the necessary Makefile rules for string extraction by gettext.

 Makefile |   39 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 39 insertions(+), 0 deletions(-)
 create mode 100644 Makefile

diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..d7b75fb
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,39 @@
+# Set the installation directories; this section is needed only in
+# gitk.git but not in git.git.
+ifndef gitexecdir
+	gitexecdir := $(shell git --exec-path)
+endif
+ifndef sharedir
+	sharedir := $(dir $(gitexecdir))share
+endif
+
+# From here on, all is needed in git.git/Makefile.
+libdir   ?= $(sharedir)/gitk/lib
+msgsdir    ?= $(libdir)/msgs
+msgsdir_SQ  = $(subst ','\'',$(msgsdir))
+
+## Beginning of po-file creation rules
+XGETTEXT   ?= xgettext
+PO_TEMPLATE = po/gitk.pot
+ALL_POFILES = $(wildcard po/*.po)
+ALL_MSGFILES = $(subst .po,.msg,$(ALL_POFILES))
+
+$(PO_TEMPLATE): gitk
+	$(XGETTEXT) -kmc -LTcl -o $@ gitk
+update-po:: $(PO_TEMPLATE)
+	$(foreach p, $(ALL_POFILES), echo Updating $p ; msgmerge -U $p $(PO_TEMPLATE) ; )
+$(ALL_MSGFILES): %.msg : %.po
+	@echo Generating catalog $@
+	msgfmt --statistics --tcl $< -l $(basename $(notdir $<)) -d $(dir $@)
+
+all:: $(ALL_MSGFILES)
+
+clean::
+	rm -f $(ALL_PROGRAMS) po/*.msg
+## End of po-file creation rules
+
+# Install rules for po-files
+install: all
+	$(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(msgsdir_SQ)' $(INSTALL_D1)
+	$(QUIET)$(foreach p,$(ALL_MSGFILES), $(INSTALL_R0)$p $(INSTALL_R1) '$(DESTDIR_SQ)$(msgsdir_SQ)' &&) true
+
-- 
1.5.2

      reply	other threads:[~2007-07-28 12:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-27 20:19 [PATCH 2/2] gitk: Markup many strings for translation Brett Schwarz
2007-07-28  2:40 ` Paul Mackerras
2007-07-28 12:40   ` Christian Stimming
2007-07-28 12:52     ` Christian Stimming [this message]

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

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

  git send-email \
    --in-reply-to=200707281452.17560.stimming@tuhh.de \
    --to=stimming@tuhh.de \
    --cc=brett_schwarz@yahoo.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=paulus@samba.org \
    /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.
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 NNTP newsgroup(s).