[Groonga-commit] groonga/groonga at 077e7ca [master] doc: maintain po with no-location

Back to archive index

HAYASHI Kentaro null+****@clear*****
Thu Jan 23 16:44:34 JST 2014


HAYASHI Kentaro	2013-12-25 16:25:00 +0900 (Wed, 25 Dec 2013)

  New Revision: 077e7ca97cf6d7ed9e640bffbf7495bc86197dc3
  https://github.com/groonga/groonga/commit/077e7ca97cf6d7ed9e640bffbf7495bc86197dc3

  Merged 202d4b9: Merge pull request #135 from kenhys/po-with-no-location

  Message:
    doc: maintain po with no-location
    
    see http://www.clear-code.com/blog/2013/11/14.html

  Modified files:
    build/makefiles/gettext.am
    doc/update-files.sh

  Modified: build/makefiles/gettext.am (+22 -9)
===================================================================
--- build/makefiles/gettext.am    2014-01-23 12:10:35 +0900 (c397e1e)
+++ build/makefiles/gettext.am    2013-12-25 16:25:00 +0900 (39320ef)
@@ -14,18 +14,20 @@ BUILT_SOURCES +=				\
 	$(mo_files)
 endif
 
-SUFFIXES += .pot .po .mo
+SUFFIXES += .pot .edit .po .mo 
 
 .PHONY: gettext update build
 
 all:
 
-.pot.po:
-	msgmerge --quiet --update --sort-by-file $@ $<
+.pot.edit:
+	msgmerge --quiet --sort-by-file --output-file=$@ $*.po $<
+.edit.po:
+	msgcat --no-location --output $@ $*.edit
 .po.mo:
 	msgfmt -o $@ $<
 
-update: pot-build-stamp $(po_files)
+update: pot-build-stamp $(edit_po_files) $(po_files)
 
 if DOCUMENT_BUILDABLE
 build: $(mo_files)
@@ -43,11 +45,22 @@ gettext: sphinx-ensure-updated
 	xgettext --language Python --output conf.pot ../../../source/conf.py
 
 init: gettext
-	for pot in *.pot; do							\
-	  po=`basename $${pot} | sed -e 's,pot$$,po,g'`;			\
-	  test "$(FORCE_INIT)" = "yes" -o ! -f $${po} &&			\
-	    msginit --input=$${pot} --output-file=$${po} --locale=$(LOCALE);	\
-	  :;									\
+	for pot in *.pot; do								\
+	  edit_po=`basename $${pot} | sed -e 's,pot$$,edit,g'`;				\
+	  test "$(FORCE_INIT)" = "yes" -o ! -f $${edit_po} &&				\
+	    msginit --input=$${pot} --output-file=$${edit_po} --locale=$(LOCALE);	\
+	  :;										\
+	done
+
+edit:
+	for pot in *.pot; do								\
+	  edit_po=`basename $${pot} | sed -e 's,pot$$,edit,g'`;				\
+	  po=`basename $${pot} | sed -e 's,pot$$,po,g'`;				\
+	  test ! -f $${edit_po} && test -f $${po} &&					\
+	    msgmerge --quiet --sort-by-file --output-file=$${edit_po} $${po} $${pot};	\
+	  test ! -f $${edit_po} && test ! -f $${po} &&					\
+	    msginit --input=$${pot} --output-file=$${edit_po} --locale=$(LOCALE);	\
+	  :;										\
 	done
 
 reinit:

  Modified: doc/update-files.sh (+14 -0)
===================================================================
--- doc/update-files.sh    2014-01-23 12:10:35 +0900 (d9ed640)
+++ doc/update-files.sh    2013-12-25 16:25:00 +0900 (aaa0d73)
@@ -46,6 +46,20 @@ find "themes" -type f | \
       -e 's,pot$,po,' | \
     list_paths "po_files_relative_from_locale_dir"
 
+## edit file base paths
+(cd locale/en/LC_MESSAGES; find . -type f -name '*.pot') | \
+    sed \
+      -e 's,^\./,,' \
+      -e 's,pot$,edit,' | \
+    list_paths "edit_po_files"
+
+## edit file paths relative from locale/$LANG/ dir.
+(cd locale/en/LC_MESSAGES; find . -type f -name '*.pot') | \
+    sed \
+      -e 's,^\.,LC_MESSAGES,' \
+      -e 's,pot$,edit,' | \
+    list_paths "edit_po_files_relative_from_locale_dir"
+
 ## mo file paths relative from locale/$LANG/ dir.
 (cd locale/en/LC_MESSAGES; find . -type f -name '*.pot') | \
     sed \
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index