summaryrefslogtreecommitdiff
path: root/website/Makefile
diff options
context:
space:
mode:
authorHenri Herscher <henri@oreka.org>2005-10-27 15:08:39 +0000
committerHenri Herscher <henri@oreka.org>2005-10-27 15:08:39 +0000
commite76fa0b3e203a5eeebc15eed92be79933bd94457 (patch)
tree6b007edae582fb67b69393c35544ed8bd96274ec /website/Makefile
parent0fd6bacf4e3cf06208d3d0327672d9446094e0a6 (diff)
First checkin
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@18 09dcff7a-b715-0410-9601-b79a96267cd0
Diffstat (limited to 'website/Makefile')
-rw-r--r--website/Makefile39
1 files changed, 39 insertions, 0 deletions
diff --git a/website/Makefile b/website/Makefile
new file mode 100644
index 0000000..5211b3c
--- /dev/null
+++ b/website/Makefile
@@ -0,0 +1,39 @@
+POT_FILE=locale/audacity_website.pot
+PO_FILES_ORIG := $(wildcard locale/*.po)
+PO_FILES := $(PO_FILES_ORIG:%.po=%/LC_MESSAGES/audacity_website.po)
+MO_FILES := $(PO_FILES:%.po=%.mo)
+
+all: $(MO_FILES)
+
+clean:
+ rm -f $(MO_FILES) $(PO_FILES) $(POT_FILE)
+ rm -f $(PO_FILES:%=%~)
+
+# Build the POT file (message catalog template).
+SOURCES := $(wildcard *.php */*.php)
+XGETTEXT=xgettext
+XGETTEXT_ARGS=-L php --add-comments="i18n-hint" --from-code="UTF-8"
+
+$(POT_FILE): $(SOURCES)
+ find . -name '*.php' ! -path './old/*' \
+ | xargs $(XGETTEXT) $(XGETTEXT_ARGS) -o $@
+ chmod go+r $@
+
+# Update the PO files (translated message catalogs).
+MSGMERGE=msgmerge
+MSGMERGE_ARGS=-U --backup=none
+
+%/LC_MESSAGES/audacity_website.po: %.po $(POT_FILE)
+ mkdir -p $(@:%/audacity_website.po=%)
+ cp -f $< $@
+ $(MSGMERGE) $(MSGMERGE_ARGS) $@ $(POT_FILE)
+ touch $@
+
+# Compile the PO files into MO files.
+MSGFMT=msgfmt
+MSGFMT_ARGS=-fv
+
+%.mo: %.po
+ $(MSGFMT) $(MSGFMT_ARGS) -o $@ $<
+
+.PHONY: clean all