[go: up one dir, main page]

File: gen-potable

package info (click to toggle)
slrn 1.0.0~pre18-1.3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 6,396 kB
  • sloc: ansic: 39,706; sh: 3,665; perl: 467; makefile: 289; sed: 24
file content (23 lines) | stat: -rwxr-xr-x 823 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

# Copyright 2002  Thomas Schultz <tststs@gmx.de>
# For internal use only (not packaged)
# Generate HTML table from po files

unset LANG

for i in *.po; do
  code=`echo "$i" | cut -c1,2`
  lang=`grep '^"Language-Team:' $i | cut -d ' ' -f 2`
  translator=`grep '^"Last-Translator:' $i | cut -d ' ' -f 2- | cut -d '<' -f 1`
  revision=`grep '^"PO-Revision-Date:' $i | cut -d ' ' -f 2`
  stats=`msgfmt -o /dev/null --statistics $i 2>&1`
  t=`echo $stats | rgrep -H '[0-9]* trans' | cut -d ' ' -f 1`
  test -z $t && t=0
  f=`echo $stats | rgrep -H '[0-9]* fuz' | cut -d ' ' -f 1`
  test -z $f && f=0
  u=`echo $stats | rgrep -H '[0-9]* unt' | cut -d ' ' -f 1`
  test -z $u && u=0
  echo "<tr><td><kbd>$code</kbd> $lang</td><td>$translator</td>"\
       "<td>$revision</td><td>$t</td><td>$f</td><td>$u</td></tr>"
done