From 0d4faa304642e63e3f3d5bef2df9fc78ca5811b3 Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Feb 10 2011 22:33:09 +0000 Subject: Update files inside `locale' functionality. --- diff --git a/Scripts/Bash/Functions/Locale/locale.sh b/Scripts/Bash/Functions/Locale/locale.sh index a1427e2..ec3ecd2 100644 --- a/Scripts/Bash/Functions/Locale/locale.sh +++ b/Scripts/Bash/Functions/Locale/locale.sh @@ -30,7 +30,7 @@ function locale { # The machine object flag (--create-mo) controls whether # centos-art.sh script creates/updates the machine object related # to portable object or not. - local FLAG_DONT_MODIFY_MO='false' + local FLAG_DONT_CREATE_MO='false' # Define the command-line interface. locale_getActions diff --git a/Scripts/Bash/Functions/Locale/locale_getActions.sh b/Scripts/Bash/Functions/Locale/locale_getActions.sh index 2581275..24f12e1 100644 --- a/Scripts/Bash/Functions/Locale/locale_getActions.sh +++ b/Scripts/Bash/Functions/Locale/locale_getActions.sh @@ -30,7 +30,7 @@ function locale_getActions { local ARGSS="" # Define long options we want to support. - local ARGSL="update:,edit:,report:,dont-modify-mo" + local ARGSL="update:,edit:,report:,dont-create-mo" # Parse arguments using getopt(1) command parser. cli_doParseArguments @@ -79,10 +79,10 @@ function locale_getActions { shift 2 ;; - --dont-modify-mo ) + --dont-create-mo ) # Redefine create machine object flag. - FLAG_DONT_MODIFY_MO="true" + FLAG_DONT_CREATE_MO="true" # Break while loop. shift 1 diff --git a/Scripts/Bash/Functions/Locale/locale_updateMessageBinary.sh b/Scripts/Bash/Functions/Locale/locale_updateMessageBinary.sh index cc5c960..77f61fc 100755 --- a/Scripts/Bash/Functions/Locale/locale_updateMessageBinary.sh +++ b/Scripts/Bash/Functions/Locale/locale_updateMessageBinary.sh @@ -27,7 +27,7 @@ function locale_updateMessageBinary { # Verify machine object creation flag. - if [[ ${FLAG_DONT_MODIFY_MO} == 'true' ]];then + if [[ ${FLAG_DONT_CREATE_MO} == 'true' ]];then return fi diff --git a/Scripts/Bash/Functions/Locale/locale_updateMessageXml.sh b/Scripts/Bash/Functions/Locale/locale_updateMessageXml.sh index 74b01e0..339d787 100755 --- a/Scripts/Bash/Functions/Locale/locale_updateMessageXml.sh +++ b/Scripts/Bash/Functions/Locale/locale_updateMessageXml.sh @@ -1,8 +1,8 @@ #!/bin/bash # -# locale_updateMessageXml.sh -- This function parses scalable vector -# graphics files, retrives translatable strings and creates/update -# portable object templates for each one of them. +# locale_updateMessageXml.sh -- This function parses XML-based files +# (e.g., scalable vector graphics), retrives translatable strings and +# creates/update portable objects. # # Copyright (C) 2009-2011 Alain Reguera Delgado # @@ -27,25 +27,19 @@ function locale_updateMessageXml { - # Redefine filter pattern in order to reduce match to scalable - # vector graphics only. - local FLAG_FILTER="${FLAG_FILTER}.*\.(xml|svg)" - - # Define location where XML-based files (e.g., scalable vector - # graphics), we want to have translation for, are place in. - local LOCATION="${ACTIONVAL}" - # Define name of file used to create both portable object # templates (.pot) and portable objects (.po) files. local FILE="${ACTIONVAL}/$(cli_getCurrentLocale)" + # Redefine filter pattern in order to reduce match to scalable + # vector graphics only. + local FLAG_FILTER="${FLAG_FILTER}.*\.(xml|svg)" + # Build list of XML-base files which we want retrive translatable # strings from. - cli_getFilesList "${LOCATION}" + cli_getFilesList - # Print out action preamble. Since the `--filter' option can be - # supplied, it is useful to know which files we are getting - # translatable strings from. + # Print action preamble. cli_printActionPreamble "${FILES}" "doLocale" 'AsResponseLine' # Print action message. diff --git a/Scripts/Bash/Functions/Locale/locale_updateMessages.sh b/Scripts/Bash/Functions/Locale/locale_updateMessages.sh index 5cd4d6e..bbb982c 100755 --- a/Scripts/Bash/Functions/Locale/locale_updateMessages.sh +++ b/Scripts/Bash/Functions/Locale/locale_updateMessages.sh @@ -36,23 +36,29 @@ function locale_updateMessages { # Syncronize changes between the working copy and the central # repository. - cli_commitRepoChanges "${ACTIONDIR}" + cli_commitRepoChanges # Evaluate action value to determine whether to use xml2po to # extract translatable strings from XML-based files or to use # xgettext to extract translatable strings from shell script # files. if [[ $ACTIONVAL =~ "^${ACTIONDIR}/(Identity|Manuals)/.+$" ]];then + # Update translatable strings inside portable object templates # for XML-based files (e.g., scalable vector graphics). ACTIONNAM="${FUNCNAM}_updateMessageXml" + elif [[ $ACTIONVAL =~ "^${ACTIONDIR}/Scripts/.+$" ]];then + # Update translatable strings inside portable object templates # for shell scripts (e.g., centos-art.sh script). ACTIONNAM="${FUNCNAM}_updateMessageShell" + else + cli_printMessage "`gettext "The path provided can't be processed."`" 'AsErrorLine' cli_printMessage "$(caller)" 'AsToKnowMoreLine' + fi # Execute action name. @@ -62,6 +68,6 @@ function locale_updateMessages { # Syncronize changes between the working copy and the central # repository. - cli_commitRepoChanges "${ACTIONDIR}" + cli_commitRepoChanges }