Commit 3b562b0e authored by Franco Fichtner's avatar Franco Fichtner

lang: move translation glue into its own subdir

parent 797df667
......@@ -14,17 +14,18 @@ umount: force
/sbin/umount -f "<above>:${.CURDIR}/src"
install: force
# invoke pkg(8) bootstraping
@make -C ${.CURDIR}/pkg install
# move all sources to their destination
@mkdir -p ${DESTDIR}/usr/local
@cp -r ${.CURDIR}/src/* ${DESTDIR}/usr/local
# disable warnings for production systems
@sed -i '' -e 's/E_STRICT/E_STRICT | E_WARNING/g' \
${DESTDIR}/usr/local/etc/rc.php_ini_setup
# invoke pkg(8) bootstraping
@make -C ${.CURDIR}/pkg install
# invoke translation glue
@make -C ${.CURDIR}/lang install
# finally pretty-print a list of files present
@(cd ${.CURDIR}/src; find * -type f \
! -name "*.po" ! -name "*.pot") | \
@(cd ${.CURDIR}/src; find * -type f) | \
xargs -n1 printf "/usr/local/%s\n"
lint: force
......@@ -40,6 +41,8 @@ sweep: force
xargs -0 -n1 scripts/cleanfile
find ${.CURDIR}/pkg -type f -print0 | \
xargs -0 -n1 scripts/cleanfile
find ${.CURDIR}/lang -type f -print0 | \
xargs -0 -n1 scripts/cleanfile
find ${.CURDIR}/scripts -type f -print0 | \
xargs -0 -n1 scripts/cleanfile
......@@ -63,25 +66,6 @@ health: force
# check test script output and advertise a failure...
[ "`${.CURDIR}/src/etc/rc.php_test_run`" == "FCGI-PASSED PASSED" ]
# translation glue
XGETTEXT= xgettext -L PHP --from-code=UTF-8 -F --strict --debug
MSGFMT= msgfmt --strict
LOCALEDIR= ${.CURDIR}/src/share/locale
POT= ${LOCALEDIR}/en_US/LC_MESSAGES/OPNsense.pot
PO!= ls ${LOCALEDIR}/*/LC_MESSAGES/OPNsense.po
.SUFFIXES: .po .mo
.po.mo: force
${MSGFMT} -o ${.TARGET} ${.IMPSRC}
bootstrap: ${PO:S/.po/.mo/g}
translate: force
@: > ${POT}
scripts/translate/collect.py
find src | xargs ${XGETTEXT} -j -o ${POT}
clean:
git reset --hard HEAD && git clean -xdqf .
......
all:
XGETTEXT= xgettext -L PHP --from-code=UTF-8 -F --strict --debug
MSGFMT= msgfmt --strict
LOCALEDIR= /usr/local/share/locale/%%LANG%%/LC_MESSAGES
LANGUAGES= zh_CN ja_JP
TEMPLATE= en_US
.for LANG in ${LANGUAGES}
${LANG}DIR= ${LOCALEDIR:S/%%LANG%%/${LANG}/g}
${LANG}:
@mkdir -p ${DESTDIR}${${LANG}DIR}
@${MSGFMT} -o ${DESTDIR}${${LANG}DIR}/OPNsense.mo ${LANG}.po
@echo ${${LANG}DIR}/OPNsense.mo
.endfor
${TEMPLATE}:
@: > ${TEMPLATE}.pot
# XXX bring this back
#${.CURDIR}/../scripts/translate/collect.py
cd ${.CURDIR}/.. && find src | \
xargs ${XGETTEXT} -j -o ${.CURDIR}/${TEMPLATE}.pot
install: ${LANGUAGES}
template: ${TEMPLATE}
.PHONY: ${LANGUAGES} ${TEMPLATE}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment