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

47a39e
#!/bin/bash
47a39e
#
47a39e
# locale_combineLicenseMessages.sh -- This function combines template
47a39e
# messages with license messages.
47a39e
#
47a39e
# Copyright (C) 2009-2012 The CentOS Project
47a39e
#
47a39e
# This program is free software; you can redistribute it and/or modify
47a39e
# it under the terms of the GNU General Public License as published by
47a39e
# the Free Software Foundation; either version 2 of the License, or (at
47a39e
# your option) any later version.
47a39e
#
47a39e
# This program is distributed in the hope that it will be useful, but
47a39e
# WITHOUT ANY WARRANTY; without even the implied warranty of
47a39e
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
47a39e
# General Public License for more details.
47a39e
#
47a39e
# You should have received a copy of the GNU General Public License
47a39e
# along with this program; if not, write to the Free Software
47a39e
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
47a39e
#
47a39e
# ----------------------------------------------------------------------
47a39e
# $Id$
47a39e
# ----------------------------------------------------------------------
47a39e
47a39e
function locale_combineLicenseMessages {
47a39e
47a39e
    local TRANSLATION_INSTANCE=$1
47a39e
    local TRANSLATION_TEMPLATE=$2
47a39e
47a39e
    if [[ $# -lt 1 ]];then
47a39e
        cli_printMessage "`gettext "One argument is required."`" --as-error-message
47a39e
    fi
47a39e
47a39e
    # Define list of all files you want to combine.
47a39e
    local FILES="${DOCBOOK_MODELS_LOCALES_DIR}/Gpl/$(cli_getCurrentLocale)/messages.po \
47a39e
        ${DOCBOOK_MODELS_LOCALES_DIR}/Gfdl/$(cli_getCurrentLocale)/messages.po \
47a39e
        ${TRANSLATION_TEMPLATE}"
47a39e
47a39e
    # Be sure the files we want to combine do exist.
47a39e
    cli_checkFiles ${FILES}
47a39e
47a39e
    # Combine files.
47a39e
    msgcat --output=${TRANSLATION_INSTANCE} \
47a39e
        --width=70 --no-location --use-first ${FILES}
47a39e
47a39e
}