Blame Scripts/Bash/Functions/Locale/locale_updateMessageXml.sh

878a2b
#!/bin/bash
878a2b
#
878a2b
# locale_updateMessageXml.sh -- This function parses XML-based files
78487b
# (e.g., Scalable Vector Graphics and Docbook files), retrieves
78487b
# translatable strings and creates/update gettext portable objects.
878a2b
#
e6bbbf
# Copyright (C) 2009-2013 The CentOS Project
878a2b
#
878a2b
# This program is free software; you can redistribute it and/or modify
878a2b
# it under the terms of the GNU General Public License as published by
878a2b
# the Free Software Foundation; either version 2 of the License, or (at
878a2b
# your option) any later version.
878a2b
#
878a2b
# This program is distributed in the hope that it will be useful, but
878a2b
# WITHOUT ANY WARRANTY; without even the implied warranty of
878a2b
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
878a2b
# General Public License for more details.
878a2b
#
878a2b
# You should have received a copy of the GNU General Public License
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_updateMessageXml {
878a2b
819c26
    # Define what kind of XML file we are generating translation
f6f5b4
    # messages for. This is relevant because scalable vector graphics
f6f5b4
    # (SVG) files are not using entity expansion while DocBook files
f6f5b4
    # do.
819c26
    if [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/Documentation/Models/Docbook/[[:alnum:]-]+$" ]];then
878a2b
f6f5b4
        locale_updateMessageXmlDocbook
878a2b
f6f5b4
        # Combine template messages and licenses messages so when
f6f5b4
        # template be merged into the final portable object the
f6f5b4
        # translations be there. If we cannot treat licenses as
819c26
        # independent documents (e.g., through XInclude), then lets
819c26
        # keep translation messages as synchronized as possible.
878a2b
78487b
    elif [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/Identity/Models/.+$" ]] \
78487b
        || [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/Documentation/Models/Svg/.+$" ]];then
878a2b
f6f5b4
        locale_updateMessageXmlSvg
878a2b
78487b
    else
878a2b
78487b
        cli_printMessage "`gettext "The path provided doesn't support localization."`" --as-error-line
78487b
78487b
    fi
878a2b
878a2b
}