Blame Scripts/Bash/Functions/Locale/locale_updateMessageXmlSvg.sh

fc7fa6
#!/bin/bash
fc7fa6
#
fc7fa6
#
fc7fa6
fc7fa6
function locale_updateMessageXmlSvg {
fc7fa6
819c26
    # Inside `Identity/Models', design models can be compressed or
fc7fa6
    # uncompressed. Because of this we cannot process all the design
fc7fa6
    # models in one unique way. Instead, we need to treat them
fc7fa6
    # individually based on their file type.
fc7fa6
fc7fa6
    # Initialize name of temporal files.
fc7fa6
    local TEMPFILE=''
fc7fa6
    local TEMPFILES=''
fc7fa6
fc7fa6
    for FILE in $FILES;do
fc7fa6
fc7fa6
        # Redefine temporal file based on file been processed.
fc7fa6
        TEMPFILE=$(cli_getTemporalFile $(basename ${FILE} ))
fc7fa6
fc7fa6
        # Update the command used to read content of XML files.
fc7fa6
        if [[ $(file -b -i $FILE) =~ '^application/x-gzip$' ]];then
fc7fa6
        
fc7fa6
            # Create uncompressed copy of file.
fc7fa6
            /bin/zcat $FILE > $TEMPFILE
fc7fa6
fc7fa6
        else
fc7fa6
                
fc7fa6
            # Create uncompressed copy of file.
fc7fa6
            /bin/cat $FILE > $TEMFILE
fc7fa6
fc7fa6
        fi
fc7fa6
fc7fa6
        # Concatenate temporal files into a list so we can process
fc7fa6
        # them later through xml2po.
fc7fa6
        TEMPFILES="${TEMPFILE} ${TEMPFILES}"
fc7fa6
fc7fa6
    done
fc7fa6
fc7fa6
    # Create the portable object template.
fc7fa6
    xml2po -a $TEMPFILES \
fc7fa6
        | msgcat --output=${MESSAGES}.pot --width=70 --no-location -
fc7fa6
fc7fa6
    # Remove list of temporal files. They are no longer needed.
fc7fa6
    rm $TEMPFILES
fc7fa6
fc7fa6
}