Commit ac1019df authored by Franco Fichtner's avatar Franco Fichtner

add a test target to check if msgfmt runs ok

parent 8a6f7b7b
...@@ -27,7 +27,7 @@ XGETTEXT= xgettext -L PHP --from-code=UTF-8 -F --strict --debug ...@@ -27,7 +27,7 @@ XGETTEXT= xgettext -L PHP --from-code=UTF-8 -F --strict --debug
XGETTEXT_PL= xgettext.pl -P Locale::Maketext::Extract::Plugin::Volt \ XGETTEXT_PL= xgettext.pl -P Locale::Maketext::Extract::Plugin::Volt \
-u -w -W -u -w -W
MSGMERGE= msgmerge -U -N --backup=off MSGMERGE= msgmerge -U -N --backup=off
MSGFMT= msgfmt --strict MSGFMT= msgfmt
PERL_DIR= /usr/local/lib/perl5/site_perl PERL_DIR= /usr/local/lib/perl5/site_perl
PERL_NAME= Locale/Maketext/Extract/Plugin PERL_NAME= Locale/Maketext/Extract/Plugin
...@@ -44,6 +44,7 @@ LANGDIR?= /usr/lang ...@@ -44,6 +44,7 @@ LANGDIR?= /usr/lang
TEMPLATE= en_US TEMPLATE= en_US
INSTALL= INSTALL=
MERGE= MERGE=
TEST=
PAGER?= less PAGER?= less
...@@ -52,9 +53,10 @@ all: ...@@ -52,9 +53,10 @@ all:
.for LANG in ${LANGUAGES} .for LANG in ${LANGUAGES}
${LANG}DIR= ${LOCALEDIR:S/%%LANG%%/${LANG}/g} ${LANG}DIR= ${LOCALEDIR:S/%%LANG%%/${LANG}/g}
install-${LANG}: install-${LANG}:
@mkdir -p ${DESTDIR}${${LANG}DIR} @mkdir -p ${DESTDIR}${${LANG}DIR}
${MSGFMT} -o ${DESTDIR}${${LANG}DIR}/OPNsense.mo ${LANG}.po ${MSGFMT} --strict -o ${DESTDIR}${${LANG}DIR}/OPNsense.mo ${LANG}.po
clean-${LANG}: clean-${LANG}:
@rm -f ${DESTDIR}${${LANG}DIR}/OPNsense.mo @rm -f ${DESTDIR}${${LANG}DIR}/OPNsense.mo
...@@ -64,9 +66,13 @@ merge-${LANG}: ...@@ -64,9 +66,13 @@ merge-${LANG}:
# strip stale translations # strip stale translations
sed -i '' -e '/^#~.*/d' ${LANG}.po sed -i '' -e '/^#~.*/d' ${LANG}.po
test-${LANG}:
${MSGFMT} -o /dev/null ${LANG}.po
INSTALL+= install-${LANG} INSTALL+= install-${LANG}
CLEAN+= clean-${LANG} CLEAN+= clean-${LANG}
MERGE+= merge-${LANG} MERGE+= merge-${LANG}
TEST+= test-${LANG}
.endfor .endfor
_PLUGINSDIRS!= ${MAKE} -C ${PLUGINSDIR} list _PLUGINSDIRS!= ${MAKE} -C ${PLUGINSDIR} list
...@@ -85,6 +91,7 @@ template: ${TEMPLATE} ...@@ -85,6 +91,7 @@ template: ${TEMPLATE}
install: ${INSTALL} install: ${INSTALL}
clean: ${CLEAN} clean: ${CLEAN}
merge: ${MERGE} merge: ${MERGE}
test: ${TEST}
src: src:
@${.CURDIR}/scripts/collect.py ${PLUGINSDIRS} ${COREDIR} @${.CURDIR}/scripts/collect.py ${PLUGINSDIRS} ${COREDIR}
......
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