|
|
878a2b |
#!/bin/bash
|
|
|
878a2b |
#
|
|
|
878a2b |
# locale_updateMessages.sh -- This function extracts translatable
|
|
|
878a2b |
# strings from both XML-based files (using xml2po) and shell scripts
|
|
|
878a2b |
# (using xgettext). Translatable strings are initially stored in
|
|
|
878a2b |
# portable objects templates (.pot) which are later merged into
|
|
|
878a2b |
# portable objects (.po) in order to be optionally converted as
|
|
|
878a2b |
# machine objects (.mo).
|
|
|
878a2b |
#
|
|
|
03486a |
# Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project
|
|
|
878a2b |
#
|
|
|
878a2b |
# This program is free software; you can redistribute it and/or modify
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
#
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
# General Public License for more details.
|
|
|
878a2b |
#
|
|
|
878a2b |
|
|
|
878a2b |
# along with this program; if not, write to the Free Software
|
|
|
878a2b |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
878a2b |
#
|
|
|
878a2b |
# ----------------------------------------------------------------------
|
|
|
878a2b |
# $Id$
|
|
|
878a2b |
# ----------------------------------------------------------------------
|
|
|
878a2b |
|
|
|
878a2b |
function locale_updateMessages {
|
|
|
878a2b |
|
|
|
28f046 |
|
|
|
28f046 |
|
|
|
28f046 |
|
|
|
026926 |
if [[ ${CLI_LANG_LC} =~ '^en' ]];then
|
|
|
28f046 |
cli_printMessage "`gettext "The English language cannot be localized to itself."`" --as-error-line
|
|
|
28f046 |
fi
|
|
|
878a2b |
|
|
|
fa14ca |
|
|
|
fa14ca |
|
|
|
fa14ca |
locale_isLocalizable "${ACTIONVAL}"
|
|
|
fa14ca |
if [[ $? -ne 0 ]];then
|
|
|
fa14ca |
cli_printMessage "`gettext "The path provided does not support localization."`"
|
|
|
fa14ca |
fi
|
|
|
fa14ca |
|
|
|
940556 |
|
|
|
00513b |
locale_prepareWorkingDirectory ${L10N_WORKDIR}
|
|
|
940556 |
|
|
|
fa14ca |
# Syncronize changes between repository and working copy. At this
|
|
|
fa14ca |
|
|
|
fa14ca |
|
|
|
f8f4c7 |
cli_synchronizeRepoChanges "${L10N_WORKDIR}"
|
|
|
fa14ca |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
026926 |
if [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/trunk/(Documentation/Models/Docbook|Identity/Models)/.*$" ]];then
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
locale_updateMessageXml
|
|
|
878a2b |
|
|
|
026926 |
elif [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/trunk/Scripts/Bash$" ]];then
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
|
|
|
878a2b |
locale_updateMessageShell
|
|
|
878a2b |
|
|
|
878a2b |
else
|
|
|
878a2b |
cli_printMessage "`gettext "The path provided doesn't support localization."`" --as-error-line
|
|
|
878a2b |
fi
|
|
|
878a2b |
|
|
|
fa14ca |
# Syncronize changes between repository and working copy. At this
|
|
|
fa14ca |
|
|
|
fa14ca |
|
|
|
f8f4c7 |
cli_synchronizeRepoChanges "${L10N_WORKDIR}"
|
|
|
fa14ca |
|
|
|
878a2b |
}
|