Makefile 708 Bytes
Newer Older
1 2 3 4 5 6 7
all:

XGETTEXT=	xgettext -L PHP --from-code=UTF-8 -F --strict --debug
MSGFMT=		msgfmt --strict

LOCALEDIR=	/usr/local/share/locale/%%LANG%%/LC_MESSAGES

8
LANGUAGES=	es_CO ja_JP zh_CN
9 10 11 12 13 14 15 16 17 18 19 20
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
21
	cd ${.CURDIR}/.. && find src lang/dynamic/helpers | \
22 23 24 25 26
	    xargs ${XGETTEXT} -j -o ${.CURDIR}/${TEMPLATE}.pot

install: ${LANGUAGES}
template: ${TEMPLATE}

27 28 29 30
dynamic:
	@${.CURDIR}/dynamic/collect.py ${.CURDIR}/..

.PHONY: ${LANGUAGES} ${TEMPLATE} dynamic