Use the English catalog files to avoid problems with pre-translated

entities.  Tested by rene@ and RayCherng Yu <raycherng@gmail.com>.
Well, and me, obviously.

Reviewed by:	rene
This commit is contained in:
Warren Block 2015-10-31 17:45:11 +00:00
parent 7c1ecbebf1
commit 9f1fd7d856
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=47714

View file

@ -278,9 +278,17 @@ TRAN_DIR?= ${MASTERDOC:H}
EN_DIR?= ${TRAN_DIR:S/${LANGCODE}/en_US.ISO8859-1/}
PO_LANG?= ${LANGCODE:C/\..*$//}
PO_CHARSET?= ${LANGCODE:tl:C/^.*\.//:S/^iso/iso-/:S/utf-8/UTF-8/}
EN_XMLLINT?= ${XMLLINT:S/${PO_LANG}/en_US/g}
CLEANFILES+= ${DOC}.translate.xml ${PO_LANG}.mo
PO_CATALOG_FILES= file://${EN_DIR}/catalog-cwd.xml \
file://${EN_DIR:H:H}/share/xml/catalog.xml \
file://${DOC_PREFIX}/share/xml/catalog.xml \
file://${LOCALBASE}/share/xml/catalog
.if defined(EXTRA_CATALOGS)
PO_CATALOG_FILES+= ${EXTRA_CATALOGS}
.endif
PO_XMLLINT= env XML_CATALOG_FILES="${PO_CATALOG_FILES}" ${PREFIX}/bin/xmllint
# fix settings in PO file
POSET_CMD= ${SED} -i '' -e '1s,^,\#$$FreeBSD$$\${.newline},' \
-e 's,^\(\"Language-Team:.*\\n\"\),\1\${.newline}\"Language: ${PO_LANG}\\n\",' \
@ -297,9 +305,9 @@ ${DOC}.translate.xml: ${EN_SRCS}
exit 1 ; \
fi
# normalize the English original into a single file
@${EN_XMLLINT} --nonet --noent --valid --xinclude ${MASTERDOC_EN} > ${.TARGET}.tmp
@${PO_XMLLINT} --nonet --noent --valid --xinclude ${MASTERDOC_EN} > ${.TARGET}.tmp
# remove redundant namespace attributes
@${EN_XMLLINT} --nsclean ${.TARGET}.tmp > ${.TARGET}
@${PO_XMLLINT} --nsclean ${.TARGET}.tmp > ${.TARGET}
@${RM} ${.TARGET}.tmp
po: ${PO_LANG}.po