| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function render_doTranslation { |
| |
| |
| |
| |
| local COMMAND="/bin/cat" |
| if [[ $(file -b -i $TEMPLATE) =~ '^application/x-gzip$' ]];then |
| COMMAND="/bin/zcat" |
| fi |
| |
| |
| |
| |
| |
| |
| |
| |
| pushd $(dirname $TEMPLATE) > /dev/null |
| |
| |
| |
| if [[ -f ${TRANSLATION} ]];then |
| |
| |
| cli_printMessage "${TRANSLATION}" --as-translation-line |
| |
| |
| |
| local TRANSLATION_INSTANCE=$(cli_getTemporalFile ${TRANSLATION}) |
| |
| if [[ ${TEMPLATE} =~ "${TCAR_WORKDIR}/trunk/Documentation/.+$" ]];then |
| |
| |
| |
| |
| |
| |
| |
| |
| cli_exportFunctions "Locale/locale_combineLicenseMessages" |
| locale_combineLicenseMessages ${TRANSLATION_INSTANCE} ${TRANSLATION} |
| |
| else |
| |
| |
| |
| |
| cp ${TRANSLATION} ${TRANSLATION_INSTANCE} |
| |
| fi |
| |
| |
| ${COMMAND} ${TEMPLATE} | xml2po -a -l ${CLI_LANG_LL} \ |
| -p ${TRANSLATION_INSTANCE} -o ${INSTANCE} - |
| |
| |
| if [[ -f ${PWD}/.xml2po.mo ]];then |
| rm ${PWD}/.xml2po.mo |
| fi |
| |
| |
| |
| if [[ -f ${TRANSLATION_INSTANCE} ]];then |
| rm ${TRANSLATION_INSTANCE} |
| fi |
| |
| else |
| |
| |
| ${COMMAND} ${TEMPLATE} > ${INSTANCE} |
| |
| fi |
| |
| |
| popd > /dev/null |
| |
| |
| cli_checkFiles -e $INSTANCE |
| |
| } |