Browse Source

Adapt to KF5

master
Andrius Štikonas 4 years ago
parent
commit
a6add14fdc
12 changed files with 77 additions and 283 deletions
  1. 3
    14
      autotranslate
  2. 4
    4
      backport
  3. 35
    145
      checkout
  4. 3
    3
      init-po-files
  5. 3
    8
      obsolete
  6. 3
    8
      pack-po-files
  7. 3
    15
      pocompare
  8. 3
    15
      pocompare-kdiff3
  9. 2
    14
      potopot
  10. 11
    24
      poupdate
  11. 2
    14
      stripfuzzy
  12. 5
    19
      ths-variables

+ 3
- 14
autotranslate View File

@@ -20,17 +20,6 @@
20 20
 
21 21
 source "`dirname $0`/ths-variables"
22 22
 
23
-if [ ! $MSGINIT ]; then
24
-	echo -e $RED"This program needs the msginit utility."$ENDCOLOR
25
-	exit 1
26
-fi
27
-
28
-if [ ! $MSGMERGE ]; then
29
-	echo -e $RED"This program needs the msgmerge utility."$ENDCOLOR
30
-	exit 1
31
-fi
32
-
33
-
34 23
 function usage() {
35 24
 	echo "Usage `basename $0` [options] <translation-files> <template-files>"
36 25
         echo
@@ -123,9 +112,9 @@ else
123 112
 			echo
124 113
 		else
125 114
 				if [ ! $option_verbose ]; then
126
-					$MSGINIT $option_no_wrap --locale=$option_locale --no-translator -i $templates/$pot -o $new/$directory/$filename 2>&1 | egrep -v "^Created"
115
+					msginit $option_no_wrap --locale=$option_locale --no-translator -i $templates/$pot -o $new/$directory/$filename 2>&1 | egrep -v "^Created"
127 116
 				else
128
-					$MSGINIT $option_no_wrap --locale=$option_locale --no-translator -i $templates/$pot -o $new/$directory/$filename
117
+					msginit $option_no_wrap --locale=$option_locale --no-translator -i $templates/$pot -o $new/$directory/$filename
129 118
 				fi
130 119
 	
131 120
 		fi
@@ -136,5 +125,5 @@ echo "** Updating files against templates (optionally with compendium)... **"
136 125
 for po in `cd $new ; find . -name "*.po" | sort`
137 126
 do
138 127
 	[ $option_verbose ] && echo -n $new/$po
139
-	$MSGMERGE $option_verbose_msgmerge $option_no_fuzzy_matching $option_no_wrap $option_use_own_compendium --backup=off --update $new/$po $templates/${po}t
128
+	msgmerge $option_verbose_msgmerge $option_no_fuzzy_matching $option_no_wrap $option_use_own_compendium --backup=off --update $new/$po $templates/${po}t
140 129
 done

+ 4
- 4
backport View File

@@ -14,10 +14,10 @@ function jobidfromstring()
14 14
 }
15 15
 
16 16
 echo -e $BLUE"Running poupdate..."$ENDCOLOR
17
-./poupdate -NS --silent trunk stable pot-stable &
17
+./poupdate -NS --silent trunk-kf5/$lcode/messages stable-kf5/$lcode/messages stable-kf5/templates/messages &
18 18
 LASTJOB=`jobidfromstring $(jobs %%)`
19 19
 JOBLIST="$LASTJOB"
20
-./poupdate -NS --silent doc-trunk doc-stable doc-pot-stable &
20
+./poupdate -NS --silent trunk-kf5/$lcode/docmessages stable-kf5/$lcode/docmessages stable-kf5/templates/docmessages &
21 21
 LASTJOB=`jobidfromstring $(jobs %%)`
22 22
 JOBLIST="$JOBLIST $LASTJOB"
23 23
 
@@ -25,5 +25,5 @@ for JOB in $JOBLIST ; do
25 25
         wait %$JOB
26 26
 done
27 27
 echo -e $BLUE"Removing obsolete entries..."$ENDCOLOR
28
-./obsolete stable
29
-./obsolete doc-stable
28
+./obsolete stable-kf5/$lcode/messages
29
+./obsolete stable-kf5/$lcode/docmessages

+ 35
- 145
checkout View File

@@ -16,159 +16,49 @@
16 16
 
17 17
 source "`dirname $0`/ths-variables"
18 18
 
19
-if [ ! -f $THS ]; then
20
-    echo "Please enter your language code (Default: lt):"
21
-    read lcode
22
-    if [ ! "$lcode" ]; then
23
-	lcode="lt"
24
-    fi
25
-    echo lcode="$lcode" >> $THS
26
-
27
-    echo "Enter path for stable templates (Default: `pwd`/pot-stable/):"
28
-    read potstable
29
-    if [ ! "$potstable" ]; then
30
-	potstable="pot-stable/"
31
-    fi
32
-    echo potstable="$potstable" >> $THS
33
-
34
-    echo "Enter path for trunk templates (Default: `pwd`/pot-trunk/):"
35
-    read pottrunk
36
-    if [ ! "$pottrunk" ]; then
37
-	pottrunk="pot-trunk/"
38
-    fi
39
-    echo pottrunk="$pottrunk" >> $THS
40
-
41
-    echo "Enter path for stable messages (Default: `pwd`/stable/):"
42
-    read postable
43
-    if [ ! "$postable" ]; then
44
-	postable="stable/"
45
-    fi
46
-    echo postable="$postable" >> $THS
47
-
48
-    echo "Enter path for trunk messages (Default: `pwd`/pot-trunk/):"
49
-    read potrunk
50
-    if [ ! "$potrunk" ]; then
51
-	potrunk="trunk/"
52
-    fi
53
-    echo potrunk="$potrunk" >> $THS
54
-
55
-    while [ ! "$documentation" = "n" ] && [ ! "$documentation" = "y" ]; do
56
-	echo "Do you want to checkout documentation messages and templates? [y/N]"
57
-	read documentation
58
-	documentation=`echo $documentation | tr YN yn`
59
-	if [ ! $documentation ]; then
60
-	    documentation="n"
61
-	fi
62
-	done
63
-	echo documentation="$documentation" >> $THS
64
-
65
-	if [ "$documentation" = "y" ]; then
66
-	    echo "Enter path for documentation stable templates (Default: `pwd`/doc-pot-stable/):"
67
-	    read docpotstable
68
-		if [ ! "$docpotstable" ]; then
69
-		    docpotstable="doc-pot-stable/"
70
-		fi
71
-		echo docpotstable="$docpotstable" >> $THS
72
-
73
-		echo "Enter path for documentation trunk templates (Default: `pwd`/doc-pot-trunk/):"
74
-		read docpottrunk
75
-		if [ ! "$docpottrunk" ]; then
76
-		    docpottrunk="doc-pot-trunk/"
77
-		fi
78
-		echo docpottrunk="$docpottrunk" >> $THS
79
-
80
-		echo "Enter path for documentation stable messages (Default: `pwd`/doc-stable/):"
81
-		read docstable
82
-		if [ ! "$docstable" ]; then
83
-		    docstable="doc-stable/"
84
-		fi
85
-		echo docstable="$docstable" >> $THS
86
-
87
-		echo "Enter path for documentation trunk messages (Default: `pwd`/doc-trunk/):"
88
-		read doctrunk
89
-		if [ ! "$doctrunk" ]; then
90
-		    doctrunk="doc-trunk/"
91
-		fi
92
-		echo doctrunk="$doctrunk" >> $THS
19
+if [ ! -f ".ths" ]; then
20
+	echo "Please enter your language code (Default: lt):"
21
+	read lcode
22
+	if [ ! "$lcode" ]; then
23
+		lcode="lt"
93 24
 	fi
25
+	echo lcode="$lcode" >> ".ths"
94 26
 
95 27
 	while [ ! "$svnwrite" = "n" ] && [ ! "$svnwrite" = "y" ]; do
96
-	    echo "Do you have write access to KDE svn repository? [y/N]"
97
-	    read svnwrite
98
-	    svnwrite=`echo $svnwrite | tr YN yn`
99
-	    if [ ! $svnwrite ]; then
100
-		svnwrite="n"
101
-	    fi
28
+		echo "Do you have write access to KDE svn repository? [y/N]"
29
+		read svnwrite
30
+		svnwrite=`echo $svnwrite | tr YN yn`
31
+		if [ ! $svnwrite ]; then
32
+			svnwrite="n"
33
+		fi
102 34
 	done
103
-	echo svnwrite="$svnwrite" >> $THS
104
-
105
-	if [ "$svnwrite" = "y" ]; then
106
-	    while [ ! "$username" ]; do
107
-		echo "Please enter your username for KDE svn repository:"
108
-		read username
109
-	    done
110
-	    echo username="$username" >> $THS
111
-	fi
35
+	echo svnwrite="$svnwrite" >> ".ths"
112 36
 
113 37
 	# Checkout repositories.
38
+	mkdir trunk-kf5 stable-kf5
114 39
 	if [ "$svnwrite" = "y" ]; then
115
-	    $SVN co svn+ssh://$username@svn.kde.org/home/kde/branches/stable/l10n-kde4/templates/messages $potstable
40
+		cd trunk-kf5
41
+		svn co svn+ssh://svn@svn.kde.org/home/kde/trunk/l10n-kf5/templates
42
+		svn co svn+ssh://svn@svn.kde.org/home/kde/trunk/l10n-kf5/scripts
43
+		svn co svn+ssh://svn@svn.kde.org/home/kde/trunk/l10n-kf5/$lcode
44
+		cd ../stable-kf5
45
+		svn co svn+ssh://svn@svn.kde.org/home/kde/branches/stable/l10n-kf5/templates
46
+		svn co svn+ssh://svn@svn.kde.org/home/kde/branches/stable/l10n-kf5/scripts
47
+		svn co svn+ssh://svn@svn.kde.org/home/kde/branches/stable/l10n-kf5/$lcode
116 48
 	else
117
-	    $SVN co svn://anonsvn.kde.org/home/kde/branches/stable/l10n-kde4/templates/messages $potstable
49
+		svn co svn://anonsvn.kde.org/home/kde/trunk/l10n-kf5/templates
50
+		svn co svn://anonsvn.kde.org/home/kde/trunk/l10n-kf5/scripts
51
+		svn co svn://anonsvn.kde.org/home/kde/trunk/l10n-kf5/$lcode
52
+		svn co svn://anonsvn.kde.org/home/kde/branches/stable/l10n-kf5/templates
53
+		svn co svn://anonsvn.kde.org/home/kde/branches/stable/l10n-kf5/scripts
54
+		svn co svn://anonsvn.kde.org/home/kde/branches/stable/l10n-kf5/$lcode
118 55
 	fi
119
-
120
-	if [ "$svnwrite" = "y" ]; then
121
-	    $SVN  co svn+ssh://$username@svn.kde.org/home/kde/trunk/l10n-kde4/templates/messages $pottrunk
122
-	else
123
-	    $SVN co svn://anonsvn.kde.org/home/kde/trunk/l10n-kde4/templates/messages $pottrunk
124
-	fi
125
-
126
-	if [ "$svnwrite" = "y" ]; then
127
-	    $SVN co svn+ssh://$username@svn.kde.org/home/kde/branches/stable/l10n-kde4/$lcode/messages $postable
128
-	else
129
-	    $SVN co svn://anonsvn.kde.org/home/kde/branches/stable/l10n-kde4/$lcode/messages $postable
130
-	fi
131
-
132
-	if [ "$svnwrite" = "y" ]; then
133
-	    $SVN co svn+ssh://$username@svn.kde.org/home/kde/trunk/l10n-kde4/$lcode/messages $potrunk
134
-	else
135
-	    $SVN co svn://anonsvn.kde.org/home/kde/trunk/l10n-kde4/$lcode/messages $potrunk
136
-	fi
137
-
138
-	if [ "$documentation" = "y" ]; then
139
-	    if [ "$svnwrite" = "y" ]; then
140
-		$SVN co svn+ssh://$username@svn.kde.org/home/kde/branches/stable/l10n-kde4/templates/docmessages $docpotstable
141
-	    else
142
-		$SVN co svn://anonsvn.kde.org/home/kde/branches/stable/l10n-kde4/templates/docmessages $docpotstable
143
-	    fi
144
-
145
-	    if [ "$svnwrite" = "y" ]; then
146
-		$SVN co svn+ssh://$username@svn.kde.org/home/kde/trunk/l10n-kde4/templates/docmessages $docpottrunk
147
-	    else
148
-		$SVN co svn://anonsvn.kde.org/home/kde/trunk/l10n-kde4/templates/docmessages $docpottrunk
149
-	    fi
150
-
151
-	    if [ "$svnwrite" = "y" ]; then
152
-		$SVN co svn+ssh://$username@svn.kde.org/home/kde/branches/stable/l10n-kde4/$lcode/docmessages $docstable
153
-	    else
154
-		$SVN co svn://anonsvn.kde.org/home/kde/branches/stable/l10n-kde4/$lcode/docmessages $docstable
155
-	    fi
156
-
157
-	    if [ "$svnwrite" = "y" ]; then
158
-		$SVN co svn+ssh://$username@svn.kde.org/home/kde/trunk/l10n-kde4/$lcode/docmessages $doctrunk
159
-	    else
160
-		$SVN co svn://anonsvn.kde.org/home/kde/trunk/l10n-kde4/$lcode/docmessages $doctrunk
161
-	    fi
162
-	fi
163
-
164 56
 else
165
-	source $THS
166
-	$SVN up all-trunk/$lcode
167
-	$SVN up all-stable/$lcode
168
-	$SVN up all-trunk/templates
169
-	$SVN up all-stable/templates
170
-        $SVN up all-trunk/scripts
171
-	$SVN up all-trunk/templates
172
-        $SVN up all-stable/scripts
173
-	$SVN up all-stable/templates
57
+	source ".ths"
58
+	svn up trunk-kf5/templates
59
+	svn up trunk-kf5/$lcode
60
+	svn up trunk-kf5/scripts
61
+	svn up stable-kf5/templates
62
+	svn up stable-kf5/$lcode
63
+	svn up stable-kf5/scripts
174 64
 fi

+ 3
- 3
init-po-files View File

@@ -15,7 +15,7 @@
15 15
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 16
 
17 17
 source "`dirname $0`/ths-variables"
18
-source $THS
18
+source ".ths"
19 19
 
20 20
 if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
21 21
     echo "Usage `basename $0` <messages-tree> <pot-tree>"
@@ -26,8 +26,8 @@ if [ $# -eq 2 ]; then
26 26
     messages="$1"
27 27
     pot="$2"
28 28
 else
29
-    messages="$potrunk"
30
-    pot="$pottrunk"
29
+    messages="trunk-kf5/$lcode/messages"
30
+    pot="trunk-kf5/templates"
31 31
 fi
32 32
 
33 33
 wdir="`pwd`"

+ 3
- 8
obsolete View File

@@ -18,17 +18,12 @@
18 18
 # # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 19
 # obsolete - remove obsolete gettext entries
20 20
 
21
-
22
-source "`dirname $0`/ths-variables"
21
+source ".ths"
23 22
 
24 23
 if [ $# -eq 1 ]; then
25 24
     folder="$1"
26 25
 else
27
-    folder="trunk"
26
+    folder="trunk-kf5/$lcode/messages"
28 27
 fi
29 28
 
30
-# posieve remove-obsolete $folder
31
-for po in `find -L "$folder" -name "*.po"`; do
32
-	msgattrib --no-obsolete "$po" > "$po".temp
33
-	mv "$po".temp "$po"
34
-done
29
+posieve remove-obsolete $folder

+ 3
- 8
pack-po-files View File

@@ -14,12 +14,7 @@
14 14
 # You should have received a copy of the GNU General Public License
15 15
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 16
 
17
-source "`dirname $0`/ths-variables"
18
-source "$THS"
17
+source ".ths"
19 18
 
20
-tar cfvj trunk.tar.bz2 `svn status $potrunk | awk '{print $2}'`
21
-tar cfvj stable.tar.bz2 `svn status $postable | awk '{print $2}'`
22
-if [ "$documentation" = "y" ]; then
23
-    tar cfvj doc-trunk.tar.bz2 `svn status $doctrunk | awk '{print $2}'` 
24
-    tar cfvj doc-stable.tar.bz2 `svn status $docstable | awk '{print $2}'`
25
-fi
19
+tar cfvj trunk.tar.bz2 `svn status trunk-kf5/$lcode | awk '{print $2}'`
20
+tar cfvj stable.tar.bz2 `svn status trunk-kf5/$lcode | awk '{print $2}'`

+ 3
- 15
pocompare View File

@@ -19,18 +19,6 @@
19 19
 # ths-pocompare.sh - compare two translation files using diff, unwrapps first 
20 20
 # for best comparison.
21 21
 
22
-source "`dirname $0`/ths-variables"
23
-
24
-if [ ! $MSGMERGE ]; then
25
-	echo -e $RED"This program needs the msgmerge utility."$ENDCOLOR
26
-	exit 1
27
-fi
28
-
29
-if [ ! $DIFF ]; then
30
-	echo -e $RED"This program needs the diff utility."$ENDCOLOR
31
-	exit 1
32
-fi
33
-
34 22
 if [ $# -ne 2 ]; then
35 23
 	echo "Usage `basename $0` <file1> <file2>"
36 24
 	exit 1
@@ -39,7 +27,7 @@ fi
39 27
 file1=$1
40 28
 file2=$2
41 29
 
42
-$MSGMERGE --no-wrap $file1 $file1 -o ${file1}.for.diff
43
-$MSGMERGE --no-wrap $file2 $file2 -o ${file2}.for.diff
44
-$DIFF ${file1}.for.diff ${file2}.for.diff
30
+msgmerge --no-wrap $file1 $file1 -o ${file1}.for.diff
31
+msgmerge --no-wrap $file2 $file2 -o ${file2}.for.diff
32
+diff ${file1}.for.diff ${file2}.for.diff
45 33
 rm ${file1}.for.diff ${file2}.for.diff

+ 3
- 15
pocompare-kdiff3 View File

@@ -19,18 +19,6 @@
19 19
 # ths-pocompare-kdiff3.sh - compare two translation files using kdiff3, 
20 20
 # unwrapps first for best comparison.
21 21
 
22
-source "`dirname $0`/ths-variables"
23
-
24
-if [ ! $MSGMERGE ]; then
25
-	echo -e $RED"This program needs the msgmerge utility."$ENDCOLOR
26
-	exit 1
27
-fi
28
-
29
-if [ ! $KDIFF3 ]; then
30
-	echo -e $RED"This program needs the kdiff3 utility."$ENDCOLOR
31
-	exit 1
32
-fi
33
-
34 22
 if [ $# -ne 2 ]; then
35 23
 	echo "Usage `basename $0` <file1> <file2>"
36 24
 	exit 1
@@ -39,7 +27,7 @@ fi
39 27
 file1=$1
40 28
 file2=$2
41 29
 
42
-$MSGMERGE --no-wrap $file1 $file1 -o ${file1}.for.diff
43
-$MSGMERGE --no-wrap $file2 $file2 -o ${file2}.for.diff
44
-$KDIFF3 ${file1}.for.diff ${file2}.for.diff
30
+msgmerge --no-wrap $file1 $file1 -o ${file1}.for.diff
31
+msgmerge --no-wrap $file2 $file2 -o ${file2}.for.diff
32
+kdiff3 ${file1}.for.diff ${file2}.for.diff
45 33
 rm ${file1}.for.diff ${file2}.for.diff

+ 2
- 14
potopot View File

@@ -19,18 +19,6 @@
19 19
 # ths-potopot.sh - converts po files to pot (template) files (basically 
20 20
 # strips all the translation).
21 21
 
22
-source "`dirname $0`/ths-variables"
23
-
24
-if [ ! $MSGMERGE ]; then
25
-	echo -e $RED"This program needs the msgmerge utility."$ENDCOLOR
26
-	exit 1
27
-fi
28
-
29
-if [ ! $MSGFILTER ]; then
30
-	echo -e $RED"This program needs the msgfilter utility."$ENDCOLOR
31
-	exit 1
32
-fi
33
-
34 22
 if [ $# -ne 1 ]; then
35 23
 	echo "Usage: `basename $0` </directory/with/pofiles/>"
36 24
 	exit 1
@@ -52,10 +40,10 @@ for file in `cd $pofiles; find . -name "*.po"`
52 40
 do
53 41
 	echo -n "Working on ${file}. Unwrapping..."
54 42
 	# unwrap messages for cleaner operation
55
-	$MSGMERGE --no-wrap  ${pofiles}/$file $pofiles/$file -o $pofiles/$file
43
+	msgmerge --no-wrap  ${pofiles}/$file $pofiles/$file -o $pofiles/$file
56 44
 	# remove the translations and creating pot files
57 45
 	echo "Cleaning up translations..."	
58
-	$MSGFILTER --input=$pofiles/$file --output-file=$pofiles/templates/${file}t --keep-header sed --expression='s/.*//' ; echo "done."
46
+	msgfilter --input=$pofiles/$file --output-file=$pofiles/templates/${file}t --keep-header sed --expression='s/.*//' ; echo "done."
59 47
 	# applying some more filters via sed: remove remaining \n signs (sed 1 and 2), removing the fuzzy headers (3), removing the empty "" (4), removing the extra empty lines (5)
60 48
 	echo "Applying additional filter..."
61 49
 	cat $pofiles/templates/${file}t | sed -e 's/msgstr \"\\n\"/msgstr \"\"/' | \

+ 11
- 24
poupdate View File

@@ -1,7 +1,7 @@
1 1
 #!/bin/bash
2 2
 #
3 3
 # Copyright 2007, Donatas Glodenis <dgvirtual@akl.lt>
4
-# Copyright 2009, Andrius Štikonas <stikonas@gmail.com>
4
+# Copyright 2009, Andrius Štikonas <andrius@stikonas.eu>
5 5
 #
6 6
 # #
7 7
 # # This script is free software; you can redistribute it and/or modify
@@ -24,19 +24,6 @@
24 24
 
25 25
 source "`dirname $0`/ths-variables"
26 26
 
27
-if [ ! $MSGMERGE ]; then
28
-	echo -e $RED"This program needs the msgmerge utility."$ENDCOLOR
29
-	exit 1
30
-fi
31
-
32
-if [ ! $DIFF ]; then
33
-	echo -e $RED"This program suggests the diff utility."$ENDCOLOR
34
-fi
35
-
36
-if [ ! $SVN ]; then
37
-	echo -e $RED"This program suggests the svn utility."$ENDCOLOR
38
-fi
39
-
40 27
 ## Declaring Functions
41 28
 function usage() {
42 29
 	echo "Usage `basename $0` [options] <updated-file-dir> <translations-file-tree> <translations-template-tree>"
@@ -152,8 +139,8 @@ if [  `cd "$tra_tree"; find ${updfile}  2> /dev/null | wc -l` -lt 1 ]; then
152 139
 	tplfile=`cd "$tpl_tree"; find ${updfile}t`
153 140
 	secdir=`dirname "$tplfile"`
154 141
 	cp "$upd_dir/$updfile" "$tra_tree/$updfile"
155
-	if [ $SVN ]; then
156
-	$SVN add "$tra_tree/$updfile"
142
+	if [ svn ]; then
143
+	svn add "$tra_tree/$updfile"
157 144
 	fi
158 145
 fi
159 146
 
@@ -166,25 +153,25 @@ if [ ! "$option_new_as_secondary" = "Y" ]; then
166 153
 	if [ "$option_verbose" = "Y" ]; then
167 154
 		echo
168 155
 		echo "UPDATING $trafile using translations from $upd_dir/$updfile as SECONDARY translations"
169
-		$MSGMERGE -N -v --compendium=$upd_dir/$updfile -o $tra_tree/${trafile}.new $tra_tree/${trafile}.old $tpl_tree/$tplfile
156
+		msgmerge -N -v --compendium=$upd_dir/$updfile -o $tra_tree/${trafile}.new $tra_tree/${trafile}.old $tpl_tree/$tplfile
170 157
 	else
171
-		$MSGMERGE -N -v --compendium=$upd_dir/$updfile -o $tra_tree/${trafile}.new $tra_tree/${trafile}.old $tpl_tree/$tplfile 2> /dev/null
158
+		msgmerge -N -v --compendium=$upd_dir/$updfile -o $tra_tree/${trafile}.new $tra_tree/${trafile}.old $tpl_tree/$tplfile 2> /dev/null
172 159
 	fi
173 160
 else
174 161
 	if [ "$option_verbose" = "Y" ]; then
175 162
 		echo
176 163
 		echo "UPDATING $trafile using translations from $upd_dir/$updfile as PRIMARY translations"
177
-		$MSGMERGE -N -v --compendium=$tra_tree/${trafile}.old -o $tra_tree/${trafile}.new $upd_dir/$updfile $tpl_tree/$tplfile
164
+		msgmerge -N -v --compendium=$tra_tree/${trafile}.old -o $tra_tree/${trafile}.new $upd_dir/$updfile $tpl_tree/$tplfile
178 165
 	else
179
-		$MSGMERGE -N -v --compendium=$tra_tree/${trafile}.old -o $tra_tree/${trafile}.new $upd_dir/$updfile $tpl_tree/$tplfile 2> /dev/null
166
+		msgmerge -N -v --compendium=$tra_tree/${trafile}.old -o $tra_tree/${trafile}.new $upd_dir/$updfile $tpl_tree/$tplfile 2> /dev/null
180 167
 	fi
181 168
 fi
182 169
 
183 170
 # delete the Rosetta/Launchpad headers, only needed if the file was imported from Rosetta
184 171
 cat $tra_tree/${trafile}.new | sed '/X-Rosetta-Export-Date/d' > $tra_tree/$trafile
185 172
 
186
-if [ $DIFF ]; then
187
-if [ "`$DIFF $tra_tree/${trafile}.old $tra_tree/${trafile}.new`" ]; then
173
+if [ $diff ]; then
174
+if [ "`$diff $tra_tree/${trafile}.old $tra_tree/${trafile}.new`" ]; then
188 175
 	changed_files=$(($changed_files+1))
189 176
 fi
190 177
 fi
@@ -194,7 +181,7 @@ rm $tra_tree/${trafile}.old $tra_tree/${trafile}.new
194 181
 processed_files=$(($processed_files+1))
195 182
 if [ ! "$option_verbose" = "Y" ] && [ ! "$option_silent" = "Y" ]; then
196 183
 	echo -ne "\r$processed_files/$total_files processed"
197
-	if [ $DIFF ] && [ ! $changed_files -eq 0 ]; then
184
+	if [ $diff ] && [ ! $changed_files -eq 0 ]; then
198 185
 		echo -ne ", $changed_files changed"
199 186
 	fi
200 187
 	if [ ! $skipped_files -eq 0 ]; then
@@ -205,7 +192,7 @@ fi
205 192
 done
206 193
 
207 194
 echo -ne $BLUE"\r$processed_files/$total_files processed"$ENDCOLOR
208
-if [ $DIFF ] && [ ! $changed_files -eq 0 ]; then
195
+if [ $diff ] && [ ! $changed_files -eq 0 ]; then
209 196
 	echo -ne $BLUE", $changed_files changed"$ENDCOLOR
210 197
 fi
211 198
 

+ 2
- 14
stripfuzzy View File

@@ -18,18 +18,6 @@
18 18
 # 
19 19
 # ths-stripfuzzy.sh - makes all fuzzy strings non-fuzzy in a translation project.
20 20
 
21
-source "`dirname $0`/ths-variables"
22
-
23
-if [ ! $MSGMERGE ]; then
24
-	echo -e $RED"This program needs the msgmerge utility."$ENDCOLOR
25
-	exit 1
26
-fi
27
-
28
-if [ ! $MSGATTRIB ]; then
29
-	echo -e $RED"This program needs the msgattrib utility."$ENDCOLOR
30
-	exit 1
31
-fi
32
-
33 21
 if [ $# -ne 2 ]; then
34 22
 	echo "Usage `basename $0` <pofile directory> <templates directory>"
35 23
 	exit 1
@@ -42,7 +30,7 @@ echo "Completely removing the fuzzy strings from the pofiles..."
42 30
 for po in `cd $pofiles ; find . -name "*.po"`
43 31
 	do
44 32
 		echo -n $pofiles/$po
45
-		$MSGATTRIB -o $pofiles/$po --no-fuzzy $pofiles/$po
33
+		msgattrib -o $pofiles/$po --no-fuzzy $pofiles/$po
46 34
 	done
47 35
 
48 36
 
@@ -50,5 +38,5 @@ echo "Restoring the previously fuzzy as untranslated strings..."
50 38
 for po in `cd $pofiles ; find . -name "*.po"`
51 39
 do
52 40
 	echo -n $pofiles/$po
53
-	$MSGMERGE --no-fuzzy-matching --backup=off --update $pofiles/$po $templates/${po}t
41
+	msgmerge --no-fuzzy-matching --backup=off --update $pofiles/$po $templates/${po}t
54 42
 done

+ 5
- 19
ths-variables View File

@@ -1,6 +1,6 @@
1 1
 #!/bin/bash
2 2
 # You would probably need to make some adjustments to variables.
3
-# Copyright (C) 2009  Andrius Štikonas <stikonas@gmail.com>
3
+# Copyright (C) 2009  Andrius Štikonas <andrius@stikonas.eu>
4 4
 #
5 5
 # This program is free software: you can redistribute it and/or modify
6 6
 # it under the terms of the GNU General Public License as published by
@@ -15,21 +15,7 @@
15 15
 # You should have received a copy of the GNU General Public License
16 16
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 17
 
18
-# Settings file
19
-THS=".ths"
20
-
21
-# Binaries
22
-SVN=`which svn 2> /dev/null`
23
-DIFF=`which diff 2> /dev/null`
24
-MSGATTRIB=`which msgattrib 2> /dev/null`
25
-MSGFILTER=`which msgfilter 2> /dev/null`
26
-MSGFMT=`which msgfmt 2> /dev/null`
27
-MSGINIT=`which msginit 2> /dev/null`
28
-MSGMERGE=`which msgmerge 2> /dev/null`
29
-KDIFF3=`which kdiff3 2> /dev/null`
30
-
31
-# Colors
32
-RED="\033[1;31m"
33
-GREEN="\033[1;32m"
34
-BLUE="\033[1;34m"
35
-ENDCOLOR="\033[0m"
18
+RED="\e[1;31m"
19
+GREEN="\e[1;32m"
20
+BLUE="\e[1;34m"
21
+ENDCOLOR="\e[0m"

Loading…
Cancel
Save