[gimp-help-2: 2/3] Add Makefile feature: use gimp po files as libraries



commit 9a485bfebaffaa3876057043e116b25ad3060a68
Author: Ulf-D. Ehlert <ulfehlert svn gnome org>
Date:   Thu Jul 9 20:32:15 2009 +0200

    Add Makefile feature: use gimp po files as libraries
    
    If make is called with GIMP_PO_ROOT set to the gimp repository
    directory (where the po directories are), the 'pot2po' routine
    will use po*/LANG.po files as libraries of message translations
    (see msgmerge(1), --compendium option).

 Makefile.GNU |   12 +++++++++++-
 Makefile.am  |   12 +++++++++++-
 2 files changed, 22 insertions(+), 2 deletions(-)
---
diff --git a/Makefile.GNU b/Makefile.GNU
index 07b5921..6ac00a7 100644
--- a/Makefile.GNU
+++ b/Makefile.GNU
@@ -180,7 +180,8 @@ xml2pot = ($(XML2PO) --output='-' $(1) \
 #     $1 - input POT file
 #     $2 - translation language
 #     $3 - output PO file
-pot2po = with_compendium="$(shell $(call get_compendium,$3))"; \
+pot2po = with_compendium="$(shell $(call get_compendium,$3)) \
+                          $(shell $(call use_gimp_po_files,$2))"; \
          tmpfile=$(3).tmp; \
          if [ -s $(3) ]; then \
              $(MSGMERGE) $(MSGMERGEFLAGS) $${with_compendium} \
@@ -251,6 +252,15 @@ else
 get_compendium =
 endif
 
+ifneq ($(GIMP_PO_ROOT),"")
+use_gimp_po_files = \
+	for po in $(GIMP_PO_ROOT)/po*/$(1).po; do \
+		test -f "$${po}" && echo '--compendium'="$${po}"; \
+	done
+else
+use_gimp_po_files =
+endif
+
 
 ########################################################################
 ####            Main targets                                        ####
diff --git a/Makefile.am b/Makefile.am
index f0d85a9..1affa4d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -260,7 +260,8 @@ xml2pot = ($(XML2PO) --output='-' $(1) \
 #     $1 - input POT file
 #     $2 - translation language
 #     $3 - output PO file
-pot2po = with_compendium="$(shell $(call get_compendium,$3))"; \
+pot2po = with_compendium="$(shell $(call get_compendium,$3)) \
+                          $(shell $(call use_gimp_po_files,$2))"; \
          tmpfile=$(3).tmp; \
          if [ -s $(3) ]; then \
              $(MSGMERGE) $(MSGMERGEFLAGS) $${with_compendium} \
@@ -326,6 +327,15 @@ copy = $(LN_S) $(abs_srcdir)/$(1) $(2)
 # HIDE FROM AUTOMAKE #get_compendium =
 # HIDE FROM AUTOMAKE #endif
 
+# HIDE FROM AUTOMAKE #ifneq ($(GIMP_PO_ROOT),"")
+# HIDE FROM AUTOMAKE #use_gimp_po_files = \
+# HIDE FROM AUTOMAKE #	for po in $(GIMP_PO_ROOT)/po*/$(1).po; do \
+# HIDE FROM AUTOMAKE #		test -f "$${po}" && echo '--compendium'="$${po}"; \
+# HIDE FROM AUTOMAKE #	done
+# HIDE FROM AUTOMAKE #else
+# HIDE FROM AUTOMAKE #use_gimp_po_files =
+# HIDE FROM AUTOMAKE #endif
+
 
 ########################################################################
 ####            Make pot files:  XML(en) --> POT                    ####



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]