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

0bd190
#!/bin/bash
0bd190
#
814e83
# locale_updateMessageXmlDocbook.sh -- This function retrieves
0bd190
# translation messages from Docbook files and creates related portable
0bd190
# object template for them.
0bd190
#
e6bbbf
# Copyright (C) 2009-2013 The CentOS Project
0bd190
#
0bd190
# This program is free software; you can redistribute it and/or modify
0bd190
# it under the terms of the GNU General Public License as published by
0bd190
# the Free Software Foundation; either version 2 of the License, or (at
0bd190
# your option) any later version.
0bd190
#
0bd190
# This program is distributed in the hope that it will be useful, but
0bd190
# WITHOUT ANY WARRANTY; without even the implied warranty of
0bd190
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0bd190
# General Public License for more details.
0bd190
#
0bd190
# You should have received a copy of the GNU General Public License
0bd190
# along with this program; if not, write to the Free Software
0bd190
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
0bd190
#
0bd190
# ----------------------------------------------------------------------
e94a3a
# $Id$
0bd190
# ----------------------------------------------------------------------
0bd190
0bd190
function locale_updateMessageXmlDocbook {
0bd190
78487b
    # Define location where translation files will be stored in.
78487b
    local L10N_WORKDIR=$(cli_getLocalizationDir ${ACTIONVAL})
78487b
096bac
    # Define regular expression to match extensions of shell scripts
096bac
    # we use inside the repository.
096bac
    local EXTENSION='docbook'
096bac
096bac
    # Define absolute paths to Docbook main file.
096bac
    local TEMPLATE=$(cli_getFilesList ${ACTIONVAL} \
096bac
        --maxdepth=1 --mindepth=1 --type='f' \
08b3a3
        --pattern=".+/$(cli_getRepoName ${ACTIONVAL} -f)\.${EXTENSION}$")
0bd190
814e83
    # Process Docbook template files based on whether it is empty or
814e83
    # not. When it is empty, it is because there is not a Docbook main
814e83
    # file in the location provided to centos-art.sh script
814e83
    # command-line. In this case, we try to create one POT file to all
814e83
    # docbook files inside the location provided but without expanding
814e83
    # entities. When Docbook template file is not empty, expand
814e83
    # entities and create the POT file from a Docbook main file
814e83
    # instance, with all entities expanded. 
814e83
    if [[ -z ${TEMPLATE} ]];then
814e83
        locale_updateMessageXmlDocbookNoEntities
814e83
    else
814e83
        locale_updateMessageXmlDocbookWithEntities
814e83
    fi
78487b
0bd190
}