From 649cc5b02343211595d1ed7c1c7b319491fe1b24 Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Feb 18 2011 19:56:00 +0000 Subject: Update `locale' functionality. --- diff --git a/Scripts/Bash/Functions/Locale/locale_editMessages.sh b/Scripts/Bash/Functions/Locale/locale_editMessages.sh index 4e06c6a..2dfbdf7 100755 --- a/Scripts/Bash/Functions/Locale/locale_editMessages.sh +++ b/Scripts/Bash/Functions/Locale/locale_editMessages.sh @@ -26,25 +26,21 @@ function locale_editMessages { - local FILE='' local FILES='' - # Redefine filter flag to specify the extension of files - # translator guys need to edit. By default the current locale - # information is used to determine which portable object to edit. - # If filter flag is set to something different but its default - # value (i.e., it was specified in the command line), the value - # entered is used instead. + # Define list of files to process. In order to make edition + # easier for translators, the current locale information is used + # to determine which portable object to edit. If filter flag is + # set to something else but its default value (i.e., it was + # specified in the command line), the value entered is used + # instead. if [[ $FLAG_FILTER == '.+' ]];then - FLAG_FILTER=".*$(cli_getCurrentLocale).*\.po" + FILES=$(cli_getFilesList "${WORKDIR}" "$(cli_getCurrentLocale).*\.po") else - FLAG_FILTER=".*${FLAG_FILTER}.*\.po" + FILES=$(cli_getFilesList "${WORKDIR}" "${FLAG_FILTER}.*\.po") fi - # Define list of files to process. - cli_getFilesList "${WORKDIR}" - - # Print action preamble. + # Set action preamble. cli_printActionPreamble "${FILES}" "doEdit" 'AsResponseLine' # Use default text editor to edit files. diff --git a/Scripts/Bash/Functions/Locale/locale_updateMessageShell.sh b/Scripts/Bash/Functions/Locale/locale_updateMessageShell.sh index c1a3be4..1de815d 100755 --- a/Scripts/Bash/Functions/Locale/locale_updateMessageShell.sh +++ b/Scripts/Bash/Functions/Locale/locale_updateMessageShell.sh @@ -42,22 +42,15 @@ function locale_updateMessageShell { mkdir -p $(dirname ${FILE}) fi - # Redefine filter flag to specify the extension of files the - # translatable messages are retrived from and so limiting the - # list of files to process to the number of files we want to - # retrive translatable messages from. Use action value as - # reference to find out different shell files. + # Build list of files to process. if [[ $ACTIONVAL =~ "^$(cli_getRepoTLDir)/Scripts/Bash" ]];then - FLAG_FILTER=".*${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' fi - # Build list of files to process. - cli_getFilesList - - # Print action preamble. + # Set action preamble. cli_printActionPreamble "${FILES}" "doLocale" 'AsResponseLine' # Print action message. diff --git a/Scripts/Bash/Functions/Locale/locale_updateMessageXml.sh b/Scripts/Bash/Functions/Locale/locale_updateMessageXml.sh index 9e77c7f..d2ce040 100755 --- a/Scripts/Bash/Functions/Locale/locale_updateMessageXml.sh +++ b/Scripts/Bash/Functions/Locale/locale_updateMessageXml.sh @@ -34,24 +34,17 @@ function locale_updateMessageXml { # (.pot) and portable objects (.po) files. FILE="${WORKDIR}/$(cli_getCurrentLocale)" - # Redefine filter flag to specify the extension of files the - # translatable messages are retrived from and so limiting the - # list of files to process to the number of files we want to - # retrive translatable messages from. Use action value as - # reference to find out different shell files. + # Build list of files to process. if [[ $ACTIONVAL =~ "^$(cli_getRepoTLDir)/Identity/.+" ]];then - FLAG_FILTER=".*${FLAG_FILTER}.*\.svg" + FILES=$(cli_getFilesList "$ACTIONVAL" "${FLAG_FILTER}.*\.svg") elif [[ $ACTIONVAL =~ "^$(cli_getRepoTLDir)/Manuals/.+" ]];then - FLAG_FILTER=".*${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' fi - # Build list of files to process. - cli_getFilesList - - # Print action preamble. + # Set action preamble. cli_printActionPreamble "${FILES}" "doLocale" 'AsResponseLine' # Print action message.