|
|
4c79b5 |
#!/bin/bash
|
|
|
4c79b5 |
#
|
|
|
7655b2 |
# locale_doReport.sh -- This function outputs the centos-art.sh
|
|
|
7655b2 |
# translations table. Use this function to know how many languages the
|
|
|
7655b2 |
# centos-art.sh script is available in, the last translators and
|
|
|
7655b2 |
# revision dates.
|
|
|
4c79b5 |
#
|
|
|
9f5f2e |
# Copyright (C) 2009-2011 Alain Reguera Delgado
|
|
|
4c79b5 |
#
|
|
|
7cd8e9 |
# This program is free software; you can redistribute it and/or
|
|
|
7cd8e9 |
# modify it under the terms of the GNU General Public License as
|
|
|
7cd8e9 |
# published by the Free Software Foundation; either version 2 of the
|
|
|
7cd8e9 |
# License, or (at your option) any later version.
|
|
|
4c79b5 |
#
|
|
|
4c79b5 |
# This program is distributed in the hope that it will be useful, but
|
|
|
4c79b5 |
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
4c79b5 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
4c79b5 |
# General Public License for more details.
|
|
|
4c79b5 |
#
|
|
|
4c79b5 |
# You should have received a copy of the GNU General Public License
|
|
|
4c79b5 |
# along with this program; if not, write to the Free Software
|
|
|
4c79b5 |
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
4c79b5 |
# USA.
|
|
|
4c79b5 |
#
|
|
|
4c79b5 |
# ----------------------------------------------------------------------
|
|
|
418249 |
# $Id$
|
|
|
4c79b5 |
# ----------------------------------------------------------------------
|
|
|
4c79b5 |
|
|
|
7655b2 |
function locale_doReport {
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# Define variables as local to avoid conflicts outside.
|
|
|
4c79b5 |
local LOCALESLIST=''
|
|
|
4c79b5 |
local LANG_NAME=''
|
|
|
4c79b5 |
local LANG_COUNTRY=''
|
|
|
4c79b5 |
local PO_LASTAUTHOR=''
|
|
|
4c79b5 |
local PO_REVDATE=''
|
|
|
4c79b5 |
local PO_STATUS=''
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# Define list of locale codes.
|
|
|
4c79b5 |
LOCALESLIST=$(cli_getLocales)
|
|
|
4c79b5 |
|
|
|
4c79b5 |
for LOCALECODE in $LOCALESLIST;do
|
|
|
4c79b5 |
|
|
|
4c79b5 |
LANG_NAME=$(cli_getLangName $LOCALECODE)
|
|
|
4c79b5 |
LANG_COUNTRY=$(cli_getCountryName $LOCALECODE)
|
|
|
4c79b5 |
|
|
|
4c79b5 |
if [[ -f $TEXTDOMAINDIR/$LOCALECODE/$TEXTDOMAIN.po ]] \
|
|
|
4c79b5 |
&& [[ -f $TEXTDOMAINDIR/$LOCALECODE/LC_MESSAGES/$TEXTDOMAIN.mo ]];then
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# Re-define translation's status.
|
|
|
4c79b5 |
PO_STATUS="`gettext "Available"`"
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# Re-define translation's last update.
|
|
|
4c79b5 |
PO_REVDATE=$(egrep '^"PO-Revision-Date:' $TEXTDOMAINDIR/$LOCALECODE/$TEXTDOMAIN.po \
|
|
|
4c79b5 |
| cut -d: -f2- | sed -r 's!\\n"!!' | sed -r 's!^[[:space:]]+!!' | cut -d ' ' -f1)
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# Re-define translation's last author.
|
|
|
4c79b5 |
PO_LASTAUTHOR=$(egrep '^"Last-Translator:' $TEXTDOMAINDIR/$LOCALECODE/$TEXTDOMAIN.po \
|
|
|
4c79b5 |
| cut -d: -f2 | sed -r 's!\\n"!!' | sed -r 's!^[[:space:]]+!!')
|
|
|
4c79b5 |
|
|
|
4c79b5 |
else
|
|
|
4c79b5 |
|
|
|
4c79b5 |
LANGCOUNTRY=""
|
|
|
4c79b5 |
PO_LASTAUTHOR=""
|
|
|
4c79b5 |
PO_REVDATE=""
|
|
|
4c79b5 |
PO_STATUS=""
|
|
|
4c79b5 |
|
|
|
4c79b5 |
fi
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# Output information line.
|
|
|
4c79b5 |
echo "$LOCALECODE | $LANG_NAME | $LANG_COUNTRY | $PO_STATUS | $PO_REVDATE | $PO_LASTAUTHOR"
|
|
|
4c79b5 |
|
|
|
4c79b5 |
done \
|
|
|
2666db |
| egrep -i "$FLAG_FILTER" \
|
|
|
4c79b5 |
| awk 'BEGIN {FS="|"; format ="%7s\t%-15s\t%-15s\t%-12s\t%-12s\t%-s\n"
|
|
|
4c79b5 |
printf "--------------------------------------------------------------------------------\n"
|
|
|
4c79b5 |
printf format, "'`gettext "Code"`'", " '`gettext "Language"`'", " '`gettext "Country"`'",\
|
|
|
4c79b5 |
" '`gettext "Status"`'", " '`gettext "LastRev"`'", " '`gettext "Author"`'"
|
|
|
4c79b5 |
printf "--------------------------------------------------------------------------------\n"}
|
|
|
4c79b5 |
{printf format, substr($1,0,7), substr($2,0,15), substr($3,0,15), $4, $5, $6}
|
|
|
4c79b5 |
END {printf "--------------------------------------------------------------------------------\n"}'
|
|
|
4c79b5 |
}
|