[rfc] make uptrans target to merge translations (and rm powertop.pot)

Benjamin Pineau benjamin_pineau at zouh.org
Fri May 25 04:07:35 PDT 2007


Hi,
Do you think this the way to go ? (patch attached) :

This uses a make target to update your po/$LG.po translation file 
with all new strings freshly extracted from the actual source code. 
This won't overwrite already translated strings in the po file.
So translators don't have to wonder how to do it anymore, and may 
work with latest strings from svn HEAD. Just 

  svn up
  make uptrans LG=de     # or es, it, ...

And edit you po/de.po file.

Also, obsoletes any need for the confusing and sometimes out of 
date powertop.pot file in svn, please remove it.


-------------- next part --------------
Index: Makefile
===================================================================
--- Makefile	(r??vision 105)
+++ Makefile	(copie de travail)
@@ -18,12 +18,14 @@
 	mkdir -p ${DESTDIR}${MANDIR}
 	cp powertop.1.gz ${DESTDIR}${MANDIR}
 	@(cd po/ && env LOCALESDIR=$(LOCALESDIR) DESTDIR=$(DESTDIR) $(MAKE) $@)
-	
-retranslate:
-	xgettext -C -s -k_ -o powertop.pot *.c *.h
-		
 
+# This is for translators. To update your po with new strings, do :
+# svn up ; make uptrans LG=fr # or de, ru, hu, it, ...
+uptrans:
+	xgettext -C -s -k_ -o po/powertop.pot *.c *.h
+	@(cd po/ && env LG=$(LG) $(MAKE) $@)
+
 clean:
-	rm -f *~ powertop powertop.1.gz
+	rm -f *~ powertop powertop.1.gz po/powertop.pot
 	@(cd po/ && $(MAKE) $@)
 
Index: po/Makefile
===================================================================
--- po/Makefile	(r??vision 105)
+++ po/Makefile	(copie de travail)
@@ -18,3 +18,13 @@
 	mkdir -p $(DESTDIR)$(LOCALESDIR)/$*/LC_MESSAGES/
 	-cp -f $< $(DESTDIR)$(LOCALESDIR)/$*/LC_MESSAGES/powertop.mo
 
+uptrans: $(LG).po
+
+$(LG).po: powertop.pot
+ifdef LG
+	msgmerge -U $@ $<
+else
+	@echo "Usage : make uptrans LG=xx # with xx = de, es, fi ..."
+	@exit 1
+endif
+


More information about the Power mailing list