create_qm_files 2.1 KB
Newer Older
Joachim Eibl's avatar
Joachim Eibl committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Copyright (C) 2009 by Joachim Eibl
# Licence: GPL V2
#   GNU GENERAL PUBLIC LICENSE, Version 2, June 1991
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program; if not, write to the Free Software
#   Foundation, Inc., 51 Franklin Steet, Fifth Floor, Boston, MA  02111-1307  USA
#
#   For details see file "COPYING".

# create_qm_files: 
# Create translation files needed by qt-only version.
22
23
24
# Requirements: lconvert from qt4 (Thanks to Richard Hoyle for that tip)
#               (previously: msg2qm from qt3-devel-tools)
export LANG=en_US.UTF-8
Joachim Eibl's avatar
Joachim Eibl committed
25
26
echo "Create qm files (KDiff3 translation files for the qt-only version)"
if [ "$1" = "local" ]; then
27
28
29
30
31
32
33
34
   if ["$2" = ""]; then
      path=.
   else
      path=$2
   fi
   echo "destination: $path"

   for i in `ls ` ; do
Joachim Eibl's avatar
Joachim Eibl committed
35
36
37
      if [ -s $i/kdiff3.po ]; then
         # (msg2qm is from "qt3-devel-tools"-package.)
         echo Creating ./kdiff3_$i.qm
38
         #/usr/lib/qt3/bin/msg2qm $i/kdiff3.po kdiff3_$i.qm
39
         lconvert -if po -of qm -o $path/kdiff3_$i.qm $i/kdiff3.po
Joachim Eibl's avatar
Joachim Eibl committed
40
41
42
43
44
45
46
      fi
   done
elif [ "$1" = "install" ]; then
   for i in `ls` ; do
      if [ -s $i/kdiff3.po ]; then
         # (msg2qm is from "qt3-devel-tools"-package.)
         echo Installing /usr/share/locale/$i/LC_MESSAGES/kdiff3.qm
47
48
         #sudo /usr/lib/qt3/bin/msg2qm $i/kdiff3.po /usr/share/locale/$i/LC_MESSAGES/kdiff3.qm
         sudo lconvert -if po -of qm -o /usr/share/locale/$i/LC_MESSAGES/kdiff3.qm $i/kdiff3.po
Joachim Eibl's avatar
Joachim Eibl committed
49
50
51
      fi
   done
else
52
53
   echo "Usage 1: sh create_qm_files local <destination> (if empty current is used)"
   echo "Usage 2: sh create_qm_files install"
Joachim Eibl's avatar
Joachim Eibl committed
54
55
fi