-
-
Save gatespace/5393942 to your computer and use it in GitHub Desktop.
自分用に改変。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ja |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# パッケージ名 | |
PACKAGE = _s | |
# パッケージのタイプ。plugin または theme | |
PROJECT = theme | |
# 本家 (url) より入手してインストールしておいたもの | |
MAKEPOT = $(HOME)/wordpress-i18n-tools/makepot.php | |
PHP = /usr/bin/php | |
MSGMERGE = /usr/local/bin/msgmerge | |
MSGFMT = /usr/local/bin/msgfmt | |
srcdir = .. | |
langdir = . | |
GENPOT=$(PHP) $(MAKEPOT) wp-$(PROJECT) $(srcdir) | |
POT=$(PACKAGE).pot | |
ALL_LINGUAS = | |
PO_LINGUAS=$(shell if test -r $(langdir)/LINGUAS; then grep -v "^\#" $(langdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi) | |
ifeq ($(PROJECT),plugin) | |
PO_PREFIX=$(PACKAGE)- | |
endif | |
POFILES=$(shell LINGUAS="$(PO_LINGUAS)"; for lang in $$LINGUAS; do printf "$(PO_PREFIX)$$lang.po "; done) | |
MOFILES=$(POFILES:%.po=%.mo) | |
.SUFFIXES: | |
.SUFFIXES: .po .mo | |
.po.mo: | |
$(MSGFMT) -o $@ $< | |
mo: $(MOFILES) | |
po: $(POFILES) | |
$(POFILES): $(POT) | |
tmpdir=`pwd`; \ | |
echo "$*:"; \ | |
result="`$(MSGMERGE) -o $$tmpdir/$*.new.po $(langdir)/$@ $(POT)`"; \ | |
if $$result; then \ | |
if cmp $(langdir)/$@ $$tmpdir/$*.new.po >/dev/null 2>&1; then \ | |
rm -f $$tmpdir/$*.new.po; \ | |
else \ | |
if mv -f $$tmpdir/$*.new.po $@; then \ | |
:; \ | |
else \ | |
echo "msgmerge for $@ failed: cannot move $$tmpdir/$*.new.po to @" 1>&2; \ | |
rm -f $$tmpdir/$*.new.po; \ | |
exit 1; \ | |
fi; \ | |
fi; \ | |
else \ | |
echo "msgmerge for $@ failed!"; \ | |
rm -f $$tmpdir/$*.new.po; \ | |
fi; \ | |
pot: | |
$(GENPOT) $(POT) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment