~ubuntu-branches/ubuntu/vivid/krusader/vivid-proposed

« back to all changes in this revision

Viewing changes to messages-extract

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-05-05 22:26:37 UTC
  • mfrom: (3.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100505222637-ydv3cwjwy365on2r
Tags: 1:2.1.0~beta1-1ubuntu1
* Merge from Debian Unstable.  Remaining changes:
  - Retain Kubuntu doc path

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/bash
2
 
 
3
 
# modified version of file from http://websvn.kde.org/trunk/l10n-kde4/scripts/extract-messages.sh
4
 
 
5
 
podir="${PWD}"/po
6
 
srcdir="${PWD}"
7
 
dirs="krusader krArc tar iso"
8
 
EXTRACTRC="${EXTRACTRC:-${PWD}/extractrc}"
9
 
EXTRACTATTR=${EXTRACTATTR:-extractattr}
10
 
PREPARETIPS=${PREPARETIPS:-preparetips}
11
 
export EXTRACTRC EXTRACTATTR PREPARETIPS
12
 
XGETTEXT_FLAGS="--copyright-holder=This_file_is_part_of_the_Krusader --from-code=UTF-8 -C --kde -ci18n -ki18n -ki18nc:1c,2 -ki18np:1,2 -ki18ncp:1c,2,3 -ktr2i18n:1 -kI18N_NOOP:1 -kI18N_NOOP2:1c,2 -kaliasLocale -kki18n:1 -kki18nc:1c,2 -kki18np:1,2 -kki18ncp:1c,2,3 --flag=i18n:1:kde-format --flag=i18nc:2:kde-format --flag=i18np:2:kde-format --flag=i18ncp:3:kde-format  --msgid-bugs-address=krusader-i18n@googlegroups.com"
13
 
export XGETTEXT_FLAGS
14
 
 
15
 
> ${podir}/krusader.pot 
16
 
 
17
 
for subdir in $dirs; do
18
 
  echo "Making messages in $subdir"
19
 
  (
20
 
    cd $srcdir/$subdir
21
 
    find . -name .svn -prune -o -regex '.*[.]\(rc\|ui[34]?\|kcfg\)' -print 2> /dev/null | xargs --no-run-if-empty $EXTRACTRC > rc.cpp
22
 
    files=$
23
 
    if find . -name \*.c\* -o -name \*.h\* | fgrep -v ".svn" | xargs fgrep -s -q KAboutData
24
 
    then
25
 
      echo 'i18nc("NAME OF TRANSLATORS","Your names");' >> rc.cpp
26
 
      echo 'i18nc("EMAIL OF TRANSLATORS","Your emails");' >> rc.cpp
27
 
    fi
28
 
  )
29
 
 
30
 
  for i in $srcdir/$subdir
31
 
  do
32
 
    test -d $i || continue
33
 
    cd $i
34
 
    find . -name \*.c\* -o -name \*.h\* | fgrep -v ".svn" \
35
 
    | xargs "${XGETTEXT:-xgettext}" $XGETTEXT_FLAGS -j -o ${podir}/krusader.pot 
36
 
    exit_code=$?
37
 
    if test "$exit_code" -ne 0; then
38
 
      echo "Bash exit code: $exit_code"
39
 
    else
40
 
      true
41
 
      rm -f rc.cpp
42
 
    fi
43
 
  done
44
 
done 2>&1
45