summaryrefslogtreecommitdiffstats
path: root/util/scripts/mac-binary/install/translations/create_package.sh
blob: b8b2b7808a638dc997b995b5ef86ed3b20bd21da (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
#!/bin/sh

#options parsing
BINDIR=
SRCDIR=
OUTDIR=
DO_DEBUG=yes
while [ -n "$1" ]; do
   echo "$1" | grep '^--*=*' >/dev/null 2>&1 || break
   OPTION=`echo $1 | sed 's,^--\([^=]*\)=\(.*\),\1,'`
   ARG=`echo $1 | sed 's,^--\([^=]*\)=\(.*\),\2,'`
   shift
   case "$OPTION" in
   debug) DO_DEBUG="$ARG" ;;
   qtsrc) SRCDIR="$ARG" ;;
   qtbin) BINDIR="$ARG" ;;
   outdir) OUTDIR="$ARG" ;;
   *) ;;
   esac
done
[ -z "$OUTDIR" ] && exit 1

#copy translation
TRANSLATIONDEST="$OUTDIR/Developer/Applications/Qt/translations"
mkdir -p "$TRANSLATIONDEST"
for translation in `find $BINDIR/translations/ -name '*.qm'`; do
    cp "$translation" "$TRANSLATIONDEST"
done

# Copy the untranslated, so there's a starting point for them as well.
for translation in `find $BINDIR/translations/ -name '*_untranslated.ts'`; do
    cp "$translation" "$TRANSLATIONDEST"
done

exit 0