~ubuntu-branches/debian/sid/djvusmooth/sid

« back to all changes in this revision

Viewing changes to private/check-po

  • Committer: Package Import Robot
  • Author(s): Daniel Stender
  • Date: 2015-09-15 15:34:11 UTC
  • mfrom: (1.1.12)
  • Revision ID: package-import@ubuntu.com-20150915153411-zlz201vxr4wk5d3p
Tags: 0.2.16-1
* New upstream release (Closes: #799017).
* deb/control:
  + added dh-python to build deps.
  + put python-djvu and python-wxgtk3.0 also into build-deps (needed by the
    tests).
  + dropped Depends: against python-xdg (Closes: #793364).
* deb/copyright: updated.
* deb/watch: watch pypi.debian.net.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
# Copyright © 2015 Jakub Wilk <jwilk@jwilk.net>
 
4
#
 
5
# This file is part of djvusmooth.
 
6
#
 
7
# djvusmooth is free software; you can redistribute it and/or modify it
 
8
# under the terms of the GNU General Public License version 2 as published
 
9
# by the Free Software Foundation.
 
10
#
 
11
# djvusmooth is distributed in the hope that it will be useful, but WITHOUT
 
12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 
13
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 
14
# more details.
 
15
 
 
16
color()
 
17
{
 
18
    sed -e 's/^/  /' \
 
19
    | grep --color=auto '.*'
 
20
}
 
21
 
 
22
color_msgid()
 
23
{
 
24
    sed -n -e '/^msgid/ { s/^/  /; p }' \
 
25
    | grep --color=auto ' "[^"].*'
 
26
}
 
27
 
 
28
set -e
 
29
rc=0
 
30
for po in "$@"
 
31
do
 
32
    ok=yes
 
33
    m=$(msgfmt --check -o /dev/null "$po" 2>&1 || true)
 
34
    if [ -n "$m" ]
 
35
    then
 
36
        [ -z "$ok" ] || printf '%s:\n' "$po"
 
37
        printf '%s:\n' '- errors from msgfmt --check'
 
38
        printf '%s' "$m" | color
 
39
        ok=
 
40
    fi
 
41
    if command -v i18nspector > /dev/null
 
42
    then
 
43
        m=$(i18nspector "$po")
 
44
        if [ -n "$m" ]
 
45
        then
 
46
            [ -z "$ok" ] || printf '%s:\n' "$po"
 
47
            printf '%s:\n' '- warnings from i18nspector'
 
48
            printf '%s' "$m" | color
 
49
            ok=
 
50
        fi
 
51
    fi
 
52
    m=$(msgattrib --no-wrap --only-fuzzy "$po")
 
53
    if [ -n "$m" ]
 
54
    then
 
55
        [ -z "$ok" ] || printf '%s:\n' "$po"
 
56
        printf '%s:\n' '- fuzzy messages'
 
57
        printf '%s' "$m" | color_msgid
 
58
        ok=
 
59
    fi
 
60
    m=$(msgattrib --no-wrap --untranslated "$po")
 
61
    if [ -n "$m" ]
 
62
    then
 
63
        [ -z "$ok" ] || printf '%s:\n' "$po"
 
64
        printf '%s:\n' '- untranslated messages'
 
65
        printf '%s' "$m" | color_msgid
 
66
        ok=
 
67
    fi
 
68
    if [ -z "$ok" ]
 
69
    then
 
70
        printf '\n'
 
71
        rc=1
 
72
    fi
 
73
done
 
74
exit $rc
 
75
 
 
76
# vim:ts=4 sts=4 sw=4 et