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

[PATCH 02/15] Makefile rules for translation catalog generation and installation.

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Sep 2, 2007, 16:25 UTC
Message-ID
<Pine.LNX.4.64.0709021725080.28586@racer.site>
In-Reply-To
<Pine.LNX.4.64.0709021719380.28586@racer.site>
[jes: with fixes by the i18n team.]
Signed-off-by: Christian Stimming <stimming@tuhh.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 Makefile |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 1bac6fe..559e65e 100644
--- a/Makefile
+++ b/Makefile
@@ -103,6 +103,21 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
 $(GITGUI_BUILT_INS): git-gui
 	$(QUIET_BUILT_IN)rm -f $@ && ln git-gui $@
 
+XGETTEXT   ?= xgettext
+msgsdir    ?= $(libdir)/msgs
+msgsdir_SQ  = $(subst ','\'',$(msgsdir))
+PO_TEMPLATE = po/git-gui.pot
+ALL_POFILES = $(wildcard po/*.po)
+ALL_MSGFILES = $(subst .po,.msg,$(ALL_POFILES))
+
+$(PO_TEMPLATE): $(SCRIPT_SH) $(ALL_LIBFILES)
+	$(XGETTEXT) -kmc -LTcl -o $@ $(SCRIPT_SH) $(ALL_LIBFILES)
+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 $@)
+
 lib/tclIndex: $(ALL_LIBFILES)
 	$(QUIET_INDEX)if echo \
 	  $(foreach p,$(PRELOAD_FILES),source $p\;) \
@@ -136,7 +151,7 @@ GIT-GUI-VARS: .FORCE-GIT-GUI-VARS
 		echo 1>$@ "$$VARS"; \
 	fi
 
-all:: $(ALL_PROGRAMS) lib/tclIndex
+all:: $(ALL_PROGRAMS) lib/tclIndex $(ALL_MSGFILES)
 
 install: all
 	$(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(gitexecdir_SQ)' $(INSTALL_D1)
@@ -145,13 +160,15 @@ install: all
 	$(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(libdir_SQ)' $(INSTALL_D1)
 	$(QUIET)$(INSTALL_R0)lib/tclIndex $(INSTALL_R1) '$(DESTDIR_SQ)$(libdir_SQ)'
 	$(QUIET)$(foreach p,$(ALL_LIBFILES), $(INSTALL_R0)$p $(INSTALL_R1) '$(DESTDIR_SQ)$(libdir_SQ)' &&) true
+	$(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(msgsdir_SQ)' $(INSTALL_D1)
+	$(QUIET)$(foreach p,$(ALL_MSGFILES), $(INSTALL_R0)$p $(INSTALL_R1) '$(DESTDIR_SQ)$(msgsdir_SQ)' &&) true
 
 dist-version:
 	@mkdir -p $(TARDIR)
 	@echo $(GITGUI_VERSION) > $(TARDIR)/version
 
 clean::
-	rm -f $(ALL_PROGRAMS) lib/tclIndex
+	rm -f $(ALL_PROGRAMS) lib/tclIndex po/*.msg
 	rm -f GIT-VERSION-FILE GIT-GUI-VARS
 
 .PHONY: all install dist-version clean
-- 
1.5.3.2.g46909
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 4 of 21 in “i18n support for git-gui”
  1. 00/15 i18n support for git-guiJohannes Schindelin, Sep 2, 2007
  2. 01/15 Mark strings for translation.Johannes Schindelin, Sep 2, 2007
  3. Johannes SchindelinSep 2, 2007
  4. 02/15 Makefile rules for translation catalog generation and installation.Johannes Schindelin, Sep 2, 2007
  5. 02/15 Makefile rules for translation catalog generation and installation.Johannes Schindelin, Sep 2, 2007
  6. 03/15 git-gui po/README: Guide to translatorsJohannes Schindelin, Sep 2, 2007
  7. 04/15 Add po/git-gui.potJohannes Schindelin, Sep 2, 2007
  8. 05/15 Ignore po/*.msgJohannes Schindelin, Sep 2, 2007
  9. 06/15 Add glossary that can be converted into a po file for each language.Johannes Schindelin, Sep 2, 2007
  10. 07/15 Add glossary translation template into git.Johannes Schindelin, Sep 2, 2007
  11. 08/15 German translation for git-guiJohannes Schindelin, Sep 2, 2007
  12. 09/15 Initial Chinese translation for git-guiJohannes Schindelin, Sep 2, 2007
  13. 10/15 Japanese translation of git-guiJohannes Schindelin, Sep 2, 2007
  14. 11/15 Italian translation of git-guiJohannes Schindelin, Sep 2, 2007
  15. 12/15 git-gui: initial version of russian translationJohannes Schindelin, Sep 2, 2007
  16. 13/15 Hungarian translation of git-guiJohannes Schindelin, Sep 2, 2007
  17. 14/15 German glossary for translationJohannes Schindelin, Sep 2, 2007
  18. 15/15 git-gui: Added initial version of po/glossary/zh_cn.poJohannes Schindelin, Sep 2, 2007
  19. Johannes SchindelinSep 2, 2007
  20. Shawn O. PearceSep 3, 2007
  21. Johannes SchindelinSep 3, 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.