summaryrefslogtreecommitdiffstats
path: root/translate
blob: 232c2c0476b1c197fc33e67e94851b195945b862 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/sh

# Update this path if necessary
KDEL10N=$PWD/../kde-l10n

export LC_ALL=C
export CDPATH=

# Fix up the script
if ! grep -q Language-Team admin/cvs.sh; then
  patch admin/cvs.sh < cvs.sh.diff
fi

test -L po || ( rm -f po ; ln -s ../kde-l10n/templates/messages/kdepim po )

# I tried setting podir to get the output directly into kde-l10n but then
# we run old code in cvs.sh; scripty doesn't use that anymore, but the scripts in l10n.
# However those are harder to reduce to kdepim only, so let's keep the old way
# of doing it: with a po subdir, like a 3rd-party app and not like a real kde module.
#export podir="$KDEL10N/templates/messages/kdepim"
if ! test -d "po"; then
  echo "po doesn't exist"
  exit 1
fi

if test -z "$XGETTEXT"; then
  if test -f /usr/bin/kde-xgettext; then
    xgettext=kde-xgettext
    export XGETTEXT=kde-xgettext
  elif test -f /opt/kde3/bin/kde-xgettext; then
    xgettext=/opt/kde3/bin/kde-xgettext
    export XGETTEXT=$xgettext
  else
    xgettext=xgettext
  fi
else
  xgettext="$XGETTEXT"
fi
gettext_version=`$xgettext --version | grep 0.10.35`
if test -z "$gettext_version"; then
    echo "No xgettext installed or wrong xgettext version: "`$xgettext --version | head -n1`
    exit 1
fi

kdepim="$PWD"

# I assume kdepim is uptodate, but kde-l10n is probably not
cd "$KDEL10N" || exit 1
svn update

cd "$kdepim"
make -f admin/Makefile.common package-messages || exit 1
# ? make -f admin/Makefile.common package-merge || exit 1

cd "$KDEL10N" || exit 1

scripts/merge_all.sh

svn diff

for i in `tqfind -name kdepim`; do
  cd $i || exit 1

  for t in `svn status 2>&1 | grep '^M' | gawk '{print $2}'`; do
    diff=`diff -u -I'^#' -I'^"POT-Creation-Date:' .svn/text-base/$t.svn-base $t`
    if test -n "$diff"; then
      echo "$t: changed"
    else
      #echo "$t: no change"
      svn revert $t
    fi
  done
  # New files are not added automatically; do those by hand.

  # To see what changed in a .pot file:  svn di kmail.pot | grep '^[-+][^#]'

  cd "$KDEL10N"
done

scripts/check_po_files

echo "Now go to $KDEL10N and commit templates/ and de/"