Blame Scripts/Functions/Locale/locale_editMessages.sh

348bf4
#!/bin/bash
348bf4
#
348bf4
# locale_editMessages.sh -- This function edits portable objects (.po)
348bf4
# using default text editor.
348bf4
#
348bf4
# Copyright (C) 2009-2011 Alain Reguera Delgado
fa95b1
#
fa95b1
# This program is free software; you can redistribute it and/or modify
fa95b1
# it under the terms of the GNU General Public License as published by
dcd347
# the Free Software Foundation; either version 2 of the License, or (at
dcd347
# your option) any later version.
fa95b1
#
74a058
# This program is distributed in the hope that it will be useful, but
74a058
# WITHOUT ANY WARRANTY; without even the implied warranty of
348bf4
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
348bf4
# General Public License for more details.
348bf4
#
348bf4
# You should have received a copy of the GNU General Public License
348bf4
# along with this program; if not, write to the Free Software
dcd347
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
348bf4
# ----------------------------------------------------------------------
348bf4
# $Id$
348bf4
# ----------------------------------------------------------------------
348bf4
348bf4
function locale_editMessages {
348bf4
4aff3a
    local FILES=''
348bf4
b0fdbc
    # Define list of locale files to process using action value as
b0fdbc
    # reference.
7483e2
    if [[ $ACTIONVAL =~ "^$(cli_getRepoTLDir)/Identity/(Models|Manual|Themes/Models)/.+$" ]];then
477096
        FILES=$(cli_getFilesList "${WORKDIR}" ".*/messages\.po")
b0fdbc
    elif [[ $ACTIONVAL =~ "^$(cli_getRepoTLDir)/Scripts$" ]];then
b0fdbc
        FILES=$(cli_getFilesList "${WORKDIR}" ".*/${TEXTDOMAIN}\.po")
e89926
    else
e89926
        cli_printMessage "`gettext "The path provided doesn't support localization."`" 'AsErrorLine'
eee226
        cli_printMessage "${FUNCDIRNAM}" 'AsToKnowMoreLine'
4aff3a
    fi
4aff3a
649cc5
    # Set action preamble.
348bf4
    cli_printActionPreamble "${FILES}" "doEdit" 'AsResponseLine'
348bf4
4aff3a
    # Use default text editor to edit files.
348bf4
    eval ${EDITOR} ${FILES}
348bf4
348bf4
    # Update machine object (.mo) from portable object (.po).
348bf4
    locale_updateMessageBinary ${FILES}
348bf4
348bf4
}