From fc7fa6ad6516f5b50fb8d717115a78da90981dc5 Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Sep 13 2012 19:49:58 +0000 Subject: Add `Functions/Locale/locale_updateMessageXmlSvg.sh' file. --- diff --git a/Scripts/Bash/Functions/Locale/locale_updateMessageXmlSvg.sh b/Scripts/Bash/Functions/Locale/locale_updateMessageXmlSvg.sh new file mode 100755 index 0000000..ef75881 --- /dev/null +++ b/Scripts/Bash/Functions/Locale/locale_updateMessageXmlSvg.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# +# + +function locale_updateMessageXmlSvg { + + # Inside trunk/Identity/Models, design models can be compressed or + # uncompressed. Because of this we cannot process all the design + # models in one unique way. Instead, we need to treat them + # individually based on their file type. + + # Initialize name of temporal files. + local TEMPFILE='' + local TEMPFILES='' + + for FILE in $FILES;do + + # Redefine temporal file based on file been processed. + TEMPFILE=$(cli_getTemporalFile $(basename ${FILE} )) + + # Update the command used to read content of XML files. + if [[ $(file -b -i $FILE) =~ '^application/x-gzip$' ]];then + + # Create uncompressed copy of file. + /bin/zcat $FILE > $TEMPFILE + + else + + # Create uncompressed copy of file. + /bin/cat $FILE > $TEMFILE + + fi + + # Concatenate temporal files into a list so we can process + # them later through xml2po. + TEMPFILES="${TEMPFILE} ${TEMPFILES}" + + done + + # Create the portable object template. + xml2po -a $TEMPFILES \ + | msgcat --output=${MESSAGES}.pot --width=70 --no-location - + + # Remove list of temporal files. They are no longer needed. + rm $TEMPFILES + +}