Blame Automation/Modules/Locale/locale.sh

Alain Reguera Delgado 8f60cb
#!/bin/bash
Alain Reguera Delgado 5f643d
######################################################################
Alain Reguera Delgado 5f643d
#
Alain Reguera Delgado 5f643d
#   locale.sh -- This module standardizes localization inside the
Alain Reguera Delgado 5f643d
#   repository.
Alain Reguera Delgado 5f643d
#
Alain Reguera Delgado 5f643d
#   Written by:
Alain Reguera Delgado 5f643d
#   * Alain Reguera Delgado <al@centos.org.cu>, 2009-2013
Alain Reguera Delgado 5f643d
#
Alain Reguera Delgado 5f643d
# Copyright (C) 2009-2013 The CentOS Project
Alain Reguera Delgado 5f643d
#
Alain Reguera Delgado 5f643d
# This program is free software; you can redistribute it and/or modify
Alain Reguera Delgado 5f643d
# it under the terms of the GNU General Public License as published by
Alain Reguera Delgado 5f643d
# the Free Software Foundation; either version 2 of the License, or
Alain Reguera Delgado 5f643d
# (at your option) any later version.
Alain Reguera Delgado 5f643d
#
Alain Reguera Delgado 5f643d
# This program is distributed in the hope that it will be useful, but
Alain Reguera Delgado 5f643d
# WITHOUT ANY WARRANTY; without even the implied warranty of
Alain Reguera Delgado 5f643d
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Alain Reguera Delgado 5f643d
# General Public License for more details.
Alain Reguera Delgado 5f643d
#
Alain Reguera Delgado 5f643d
# You should have received a copy of the GNU General Public License
Alain Reguera Delgado 5f643d
# along with this program; if not, write to the Free Software
Alain Reguera Delgado 5f643d
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Alain Reguera Delgado 5f643d
#
Alain Reguera Delgado 5f643d
######################################################################
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
function locale {
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 52ee2e
    locale_getOptions "${@}"
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 52ee2e
    eval set -- "${TCAR_ARGUMENTS}"
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 52ee2e
    if [[ ${TCAR_SCRIPT_LANG_LC} =~ '^en' ]];then
Alain Reguera Delgado 52ee2e
        tcar_printMessage "`gettext "The English language cannot be localized to itself."`" --as-error-line
Alain Reguera Delgado 52ee2e
    fi
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 786ac0
    for ARGUMENT in ${@};do
Alain Reguera Delgado 786ac0
        ARGUMENT=$(tcar_checkRepoDirSource "${ARGUMENT}")
Alain Reguera Delgado 786ac0
        if [[ -f ${ARGUMENT} ]];then
Alain Reguera Delgado bd3978
            tcar_setModuleEnvironment "file" "${@}"
Alain Reguera Delgado 786ac0
        elif [[ -d ${ARGUMENT} ]];then
Alain Reguera Delgado bd3978
            tcar_setModuleEnvironment "directory" "${@}"
Alain Reguera Delgado 786ac0
        else
Alain Reguera Delgado 786ac0
            tcar_printMessage "`gettext "The argument provided isn't valid."`" --as-error-line
Alain Reguera Delgado 786ac0
        fi
Alain Reguera Delgado 8f60cb
    done
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
}