| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function identity_renderBase { |
| |
| local -a FILES |
| local FILE='' |
| local OUTPUT='' |
| local TEMPLATE='' |
| local PARENTDIR='' |
| local EXTENSION='' |
| local TRANSLATION='' |
| local EXTERNALFILE='' |
| local EXTERNALFILES='' |
| local THIS_FILE_DIR='' |
| local NEXT_FILE_DIR='' |
| local COUNT=0 |
| |
| |
| |
| |
| |
| EXTENSION='\.(svgz|svg|docbook)' |
| |
| |
| PARENTDIR=$(basename "${ACTIONVAL}") |
| |
| |
| identity_getDirTemplate |
| |
| |
| |
| |
| |
| |
| |
| |
| for FILE in $(cli_getFilesList "${TEMPLATE}" "${FLAG_FILTER}.*${EXTENSION}");do |
| FILES[$COUNT]=$FILE |
| COUNT=$(($COUNT + 1)) |
| done |
| |
| |
| cli_printActionPreamble "${FILES[@]}" |
| |
| |
| COUNT=0 |
| |
| |
| |
| while [[ $COUNT -lt ${#FILES[*]} ]];do |
| |
| |
| FILE=${FILES[$COUNT]} |
| |
| |
| |
| THIS_FILE_DIR=$(dirname ${FILES[$COUNT]}) |
| |
| |
| |
| if [[ $(($COUNT + 1)) -lt ${#FILES[*]} ]];then |
| NEXT_FILE_DIR=$(dirname ${FILES[$(($COUNT + 1))]}) |
| else |
| NEXT_FILE_DIR='' |
| fi |
| |
| |
| cli_printMessage '-' 'AsSeparatorLine' |
| |
| |
| TRANSLATION=$(dirname $FILE \ |
| | sed -r 's!/trunk/(Identity/)!/trunk/Locales/\1!')/$(cli_getCurrentLocale).po |
| |
| |
| if [[ ! -f "$TRANSLATION" ]];then |
| cli_printMessage "`gettext "None"`" "AsTranslationLine" |
| else |
| cli_printMessage "$TRANSLATION" 'AsTranslationLine' |
| fi |
| |
| |
| TEMPLATE=${FILE} |
| |
| |
| if [[ ! -f "$TEMPLATE" ]];then |
| cli_printMessage "`gettext "None"`" "AsDesignLine" |
| else |
| cli_printMessage "$TEMPLATE" 'AsDesignLine' |
| fi |
| |
| |
| identity_getDirOutput |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| FILE=$(echo ${FILE} \ |
| | sed -r "s!.*${PARENTDIR}/!!" \ |
| | sed -r "s/${EXTENSION}$//") |
| |
| |
| FILE=${OUTPUT}/$(basename "${FILE}") |
| |
| |
| INSTANCE=$(cli_getTemporalFile ${TEMPLATE}) |
| |
| |
| |
| if [[ -f ${TRANSLATION} ]];then |
| |
| |
| /usr/bin/xml2po -p ${TRANSLATION} ${TEMPLATE} > ${INSTANCE} |
| |
| |
| if [[ -f ${PWD}/.xml2po.mo ]];then |
| rm ${PWD}/.xml2po.mo |
| fi |
| |
| else |
| |
| /bin/cp ${TEMPLATE} ${INSTANCE} |
| fi |
| |
| |
| cli_replaceTMarkers ${INSTANCE} |
| |
| |
| |
| if [[ $INSTANCE =~ '\.(svgz|svg)$' ]];then |
| |
| |
| identity_renderSvg |
| |
| |
| identity_renderSvgPostActions |
| |
| |
| identity_renderSvgLastActions |
| |
| elif [[ $INSTANCE =~ '\.docbook$' ]];then |
| |
| |
| identity_renderDocbook |
| |
| |
| |
| |
| |
| |
| |
| else |
| cli_printMessage "`gettext "The template extension you try to render is not supported yet."`" 'AsErrorLine' |
| cli_printMessage "$(caller)" 'AsToKnowMoreLine' |
| fi |
| |
| |
| if [[ -f $INSTANCE ]];then |
| rm $INSTANCE |
| fi |
| |
| |
| identity_renderPostActions |
| |
| |
| identity_renderLastActions |
| |
| |
| COUNT=$(($COUNT + 1)) |
| |
| done |
| |
| } |