3 # Little shell script to display some basic statistics about Geany's translation
4 # files. It also checks the menu accelerators.
6 # Copyright 2007 The Geany contributors
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
30 echo "usage: $me [OPTION] [languages...]"
33 echo "-h --help this help screen"
34 echo "-a --accelerators check also for menu accelerators"
35 echo "languages list of language codes which should be tested"
37 echo "example: $me -a de fr hu"
41 # parse cmd line arguments
46 check_accelerators
="--check-accelerators=_"
49 check_accelerators
="--check-accelerators=_"
68 # if no languages where specified on the command line, take all listed languages in LINGUAS
71 linguas
=`sed -e '/^#/d' po/LINGUAS`
74 # dash and zsh don't need the -e switch to echo, bash does
75 # maybe there is a better way to detect whether we are running on a bash
83 if [ $check_accelerators ]
87 msgfmt
--check --statistics $check_accelerators po
/$lang.po
;
92 # maybe the regexp can be optimized, regexps are not my best friends
93 creationdate
=`grep "PO-Revision-Date:" po/$lang.po | sed 's/.*: \([0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\} [0-9]\{2\}:[0-9]\{2\}[+|-][0-9]\{4\}\).*/\1/'`
94 printf "%s %s\t(%s):\t" "$eswitch" "$lang" "$creationdate"
95 msgfmt
--check --statistics po
/$lang.po
;