Skip to content
Snippets Groups Projects
Verified Commit 15ba1ac2 authored by Benny Baumann's avatar Benny Baumann
Browse files

chg: Use templating magic to generate rules to create .po files for each language

parent eb320294
No related branches found
No related tags found
No related merge requests found
Pipeline #1527 failed
...@@ -78,12 +78,11 @@ ${POTDIR}/%.pot: ${SRCDIR}/%.c ...@@ -78,12 +78,11 @@ ${POTDIR}/%.pot: ${SRCDIR}/%.c
${POTDIR}/%.pot: ${SRCDIR}/%.cpp ${POTDIR}/%.pot: ${SRCDIR}/%.cpp
${MKDIR} ${@D} && ${XGETTEXT} ${XGETTEXT_FLAGS} $( [ -r $@ ] && echo -- -j ) -o $@ $< ${MKDIR} ${@D} && ${XGETTEXT} ${XGETTEXT_FLAGS} $( [ -r $@ ] && echo -- -j ) -o $@ $<
$(foreach POFILE,${POLANGS},${PODIR}/${POFILE}/%.po): ${POTDIR}/%.pot define genlangporules
for POLANG in ${POLANGS}; do \ ${PODIR}/$(1)/%.po: ${POTDIR}/%.pot
${MKDIR} ${PODIR}/$${POLANG}/${*D} && \ $${MKDIR} $${@D} && ( [ -r $$< ] && $${MSGINIT} --no-translator --input=$$< --locale=$$(patsubst $${PODIR}/%/$$(patsubst $${POTDIR}/%.pot,%.po,$$<),%,$$@) --output=$$@ ) && ( $${MSGMERGE} --update $$@ $$< )
( [ ! -r ${PODIR}/$${POLANG}/$*.po ] && ${MSGINIT} --no-translator --input=${POTDIR}/$*.pot --locale=${POLANG} --output=${PODIR}/$${POLANG}/$*.po ) && \ endef
( ${MSGMERGE} --update ${PODIR}/$${POLANG}/$*.po ${POTDIR}/$*.pot ) \ $(foreach POLANG,${POLANGS},$(eval $(call genlangporules,$${POLANG})))
done
${MODIR}/%.mo: ${PODIR}/%.po ${MODIR}/%.mo: ${PODIR}/%.po
${MKDIR} ${@D} && ${MSGFMT} --output-file=$@ $< ${MKDIR} ${@D} && ${MSGFMT} --output-file=$@ $<
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment