|
|
4e4b4d |
#!/bin/bash
|
|
|
4e4b4d |
#
|
|
|
bf6bff |
# locale_updateMessages.sh -- This function extracts translatable
|
|
|
bf6bff |
# strings from both XML-based files (using xml2po) and shell scripts
|
|
|
bf6bff |
# (using xgettext). Translatable strings are initially stored in
|
|
|
bf6bff |
# portable objects templates (.pot) which are later merged into
|
|
|
bf6bff |
# portable objects (.po) in order to be optionally converted as
|
|
|
bf6bff |
# machine objects (.mo).
|
|
|
4e4b4d |
#
|
|
|
4e4b4d |
# Copyright (C) 2009-2011 Alain Reguera Delgado
|
|
|
4e4b4d |
#
|
|
|
4e4b4d |
# This program is free software; you can redistribute it and/or
|
|
|
4e4b4d |
|
|
|
4e4b4d |
|
|
|
4e4b4d |
|
|
|
4e4b4d |
#
|
|
|
4e4b4d |
|
|
|
4e4b4d |
|
|
|
4e4b4d |
|
|
|
4e4b4d |
# General Public License for more details.
|
|
|
4e4b4d |
#
|
|
|
4e4b4d |
|
|
|
4e4b4d |
# along with this program; if not, write to the Free Software
|
|
|
4e4b4d |
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
4e4b4d |
# USA.
|
|
|
4e4b4d |
#
|
|
|
4e4b4d |
# ----------------------------------------------------------------------
|
|
|
4e4b4d |
# $Id$
|
|
|
4e4b4d |
# ----------------------------------------------------------------------
|
|
|
4e4b4d |
|
|
|
4e4b4d |
function locale_updateMessages {
|
|
|
4e4b4d |
|
|
|
4e4b4d |
local ACTIONNAM=''
|
|
|
4e4b4d |
|
|
|
3cdabe |
|
|
|
4e4b4d |
|
|
|
4e4b4d |
|
|
|
4e4b4d |
|
|
|
420da9 |
if [[ $WORKDIR =~ "^${BASEDIR}/(Identity|Manual)" ]];then
|
|
|
0d4faa |
|
|
|
4e4b4d |
|
|
|
4e4b4d |
|
|
|
3cdabe |
ACTIONNAM="${FUNCNAM}_updateMessageXml"
|
|
|
0d4faa |
|
|
|
420da9 |
elif [[ $WORKDIR =~ "^${BASEDIR}/Scripts" ]];then
|
|
|
0d4faa |
|
|
|
4e4b4d |
|
|
|
4e4b4d |
# for shell scripts (e.g., centos-art.sh script).
|
|
|
4e4b4d |
ACTIONNAM="${FUNCNAM}_updateMessageShell"
|
|
|
0d4faa |
|
|
|
4e4b4d |
else
|
|
|
3cdabe |
cli_printMessage "`gettext "The path provided doesn't support localization."`" 'AsErrorLine'
|
|
|
eee226 |
cli_printMessage "${FUNCDIRNAM}" 'AsToKnowMoreLine'
|
|
|
4e4b4d |
fi
|
|
|
4e4b4d |
|
|
|
4e4b4d |
|
|
|
3cdabe |
if [[ $ACTIONNAM =~ "^${FUNCNAM}_[A-Za-z]+$" ]];then
|
|
|
4e4b4d |
eval $ACTIONNAM
|
|
|
3cdabe |
else
|
|
|
3cdabe |
cli_printMessage "`gettext "A valid action is required."`" 'AsErrorLine'
|
|
|
eee226 |
cli_printMessage "${FUNCDIRNAM}" 'AsToKnowMoreLine'
|
|
|
4e4b4d |
fi
|
|
|
4e4b4d |
|
|
|
4e4b4d |
}
|