3 # Little shell script to display some basic statistics about Geany's translation
4 # files. It also checks the menu accelerators.
6 # Copyright 2007-2008 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
7 # Copyright 2007-2008 Frank Lanitz <enrico(dot)troeger(at)uvena(dot)de>
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
31 echo "usage: $me [OPTION] [languages...]"
34 echo "-h --help this help screen"
35 echo "-a --accelerators check also for menu accelerators"
36 echo "languages list of language codes which should be tested"
38 echo "example: $me -a de fr hu"
42 # parse cmd line arguments
47 check_accelerators
="--check-accelerators=_"
50 check_accelerators
="--check-accelerators=_"
69 # if no languages where specified on the command line, take all listed languages in LINGUAS
72 linguas
=`sed -e '/^#/d' po/LINGUAS`
75 # dash and zsh don't need the -e switch to echo, bash does
76 # maybe there is a better way to detect whether we are running on a bash
84 if [ $check_accelerators ]
88 msgfmt
--check --statistics $check_accelerators po
/$lang.po
;
93 # maybe the regexp can be optimized, regexps are not my best friends
94 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/'`
95 printf "%s %s\t(%s):\t" "$eswitch" "$lang" "$creationdate"
96 msgfmt
--check --statistics po
/$lang.po
;