Blame Scripts/Bash/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
348bf4
# 
348bf4
# This program is free software; you can redistribute it and/or
348bf4
# modify it under the terms of the GNU General Public License as
348bf4
# published by the Free Software Foundation; either version 2 of the
348bf4
# License, or (at your option) any later version.
348bf4
# 
348bf4
# This program is distributed in the hope that it will be useful, but
348bf4
# 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
348bf4
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
348bf4
# USA.
348bf4
# 
348bf4
# ----------------------------------------------------------------------
348bf4
# $Id$
348bf4
# ----------------------------------------------------------------------
348bf4
348bf4
function locale_editMessages {
348bf4
4aff3a
    local FILE=''
4aff3a
    local FILES=''
348bf4
4aff3a
    # Redefine filter flag to specify the extension of files
4aff3a
    # translator guys need to edit. By default the current locale
4aff3a
    # information is used to determine which portable object to edit.
4aff3a
    # If filter flag is set to something different but its default
4aff3a
    # value (i.e., it was specified in the command line), the value
4aff3a
    # entered is used instead.
4aff3a
    if [[ $FLAG_FILTER == '.+' ]];then
4aff3a
        FLAG_FILTER=".*$(cli_getCurrentLocale).*\.po"
4aff3a
    else
4aff3a
        FLAG_FILTER=".*${FLAG_FILTER}.*\.po"
4aff3a
    fi
4aff3a
4aff3a
    # Define list of files to process.
bf6bff
    cli_getFilesList "${WORKDIR}"
348bf4
4aff3a
    # Print 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
}