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

878a2b
#!/bin/bash
878a2b
#
878a2b
# locale_updateMessageXml.sh -- This function parses XML-based files
878a2b
# (e.g., scalable vector graphics), retrives translatable strings and
878a2b
# creates/update gettext portable objects.
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
# 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
878a2b
    # Print separator line.
878a2b
    cli_printMessage '-' --as-separator-line
878a2b
878a2b
    # Define filename used to create both portable object templates
878a2b
    # (.pot) and portable objects (.po) files.
878a2b
    local MESSAGES="${L10N_WORKDIR}/messages"
878a2b
f6f5b4
    # Define what kind of XML file we are generatin translation
f6f5b4
    # messages for. This is relevant because scalable vector graphics
f6f5b4
    # (SVG) files are not using entity expansion while DocBook files
f6f5b4
    # do.
d74a59
    if [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/trunk/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
f6f5b4
        # idependent documents (e.g., through XInclude), then lets
f6f5b4
        # keep translation messages as syncronized as possible.
f6f5b4
        locale_combineLicenseMessages ${MESSAGES}.po
878a2b
f6f5b4
    elif [[ $ACTIONVAL =~ "^${TCAR_WORKDIR}/trunk/Identity/Models/.+$" ]];then
878a2b
f6f5b4
        locale_updateMessageXmlSvg
878a2b
878a2b
    fi
878a2b
f6f5b4
    # Verify, initialize or merge portable objects from portable
f6f5b4
    # object templates.
f6f5b4
    locale_updateMessagePObjects "${MESSAGES}"
878a2b
878a2b
}