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

[PATCH] gitk.git: Add Makefile with rules for po file creation.

From
Christian Stimming <stimming@tuhh.de>
Date
Jul 28, 2007, 12:52 UTC
Message-ID
<200707281452.17560.stimming@tuhh.de>
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
Previous: Christian Stimming
Message 4 of 4 in “Re: [PATCH 2/2] gitk: Markup many strings for translation.”
  1. Brett SchwarzJul 27, 2007
  2. Paul MackerrasJul 28, 2007
  3. Christian StimmingJul 28, 2007
  4. gitk.git: Add Makefile with rules for po file creation.Christian Stimming, Jul 28, 2007

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.