diff --git a/Scripts/Bash/Functions/Locale/locale_updateMessagePObjects.sh b/Scripts/Bash/Functions/Locale/locale_updateMessagePObjects.sh index 8deacb0..2c8182a 100755 --- a/Scripts/Bash/Functions/Locale/locale_updateMessagePObjects.sh +++ b/Scripts/Bash/Functions/Locale/locale_updateMessagePObjects.sh @@ -31,7 +31,7 @@ function locale_updateMessagePObjects { # Verify the portable object template. The portable object # template is used to create the portable object. - cli_checkFiles "${FILE}.pot" + cli_checkFiles "${FILE}.pot" 'f' # Verify existence of portable object. The portable object is the # file translators edit in order to make translation works. diff --git a/Scripts/Bash/Functions/Locale/locale_updateMessageShell.sh b/Scripts/Bash/Functions/Locale/locale_updateMessageShell.sh index 1de815d..055475e 100755 --- a/Scripts/Bash/Functions/Locale/locale_updateMessageShell.sh +++ b/Scripts/Bash/Functions/Locale/locale_updateMessageShell.sh @@ -44,7 +44,7 @@ function locale_updateMessageShell { # Build list of files to process. if [[ $ACTIONVAL =~ "^$(cli_getRepoTLDir)/Scripts/Bash" ]];then - FILES=$(cli_getFilesList "$ACTIONVAL" "${FLAG_FILTER}.*\.sh") + FILES=$(cli_getFilesList "$ACTIONVAL" "${FLAG_FILTER}\.sh") else cli_printMessage "`gettext "The path provided can't be processed."`" 'AsErrorLine' cli_printMessage "$(caller)" 'AsToKnowMoreLine' @@ -56,6 +56,11 @@ function locale_updateMessageShell { # Print action message. cli_printMessage "${FILE}.pot" 'AsUpdatingLine' + # Prepare directory structure to receive .po files. + if [[ ! -d $(dirname ${FILE}) ]];then + mkdir -p $(dirname ${FILE}) + fi + # Retrive translatable strings from shell script files and create # the portable object template (.pot) from them. /usr/bin/xgettext --output=${FILE}.pot \ diff --git a/Scripts/Bash/Functions/Locale/locale_updateMessageXml.sh b/Scripts/Bash/Functions/Locale/locale_updateMessageXml.sh index d2ce040..68e8b3c 100755 --- a/Scripts/Bash/Functions/Locale/locale_updateMessageXml.sh +++ b/Scripts/Bash/Functions/Locale/locale_updateMessageXml.sh @@ -36,9 +36,9 @@ function locale_updateMessageXml { # Build list of files to process. if [[ $ACTIONVAL =~ "^$(cli_getRepoTLDir)/Identity/.+" ]];then - FILES=$(cli_getFilesList "$ACTIONVAL" "${FLAG_FILTER}.*\.svg") + FILES=$(cli_getFilesList "$ACTIONVAL" "${FLAG_FILTER}\.svg") elif [[ $ACTIONVAL =~ "^$(cli_getRepoTLDir)/Manuals/.+" ]];then - FILES=$(cli_getFilesList "$ACTIONVAL" "${FLAG_FILTER}.*\.xml") + FILES=$(cli_getFilesList "$ACTIONVAL" "${FLAG_FILTER}\.xml") else cli_printMessage "`gettext "The path provided can't be processed."`" 'AsErrorLine' cli_printMessage "$(caller)" 'AsToKnowMoreLine' @@ -46,10 +46,15 @@ function locale_updateMessageXml { # Set action preamble. cli_printActionPreamble "${FILES}" "doLocale" 'AsResponseLine' - + # Print action message. cli_printMessage "${FILE}.pot" 'AsUpdatingLine' + # Prepare directory structure to receive .po files. + if [[ ! -d $(dirname ${FILE}) ]];then + mkdir -p $(dirname ${FILE}) + fi + # Retrive translatable strings from XML-based files and # create the portable object template (.pot) from them. /usr/bin/xml2po ${FILES} | msgcat --output=${FILE}.pot --width=70 --sort-by-file -