DEB: removed kubuntu-desktop-i18n folder in tdelibs (not used).

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/18/head
Michele Calgaro 4 years ago
parent cb2eb4a925
commit 65fe1b6b6a
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -1,98 +0,0 @@
#! /usr/bin/env perl
use strict;
use warnings;
use Getopt::Long;
sub printdate
{
printf ( "%04i", ( $_[5] + 1900 ) );
print "-";
printf ( "%02i", $_[4] + 1);
print "-";
printf ( "%02i", $_[3] );
print " ";
printf ( "%02i", $_[2] );
print ":";
printf ( "%02i", $_[1] );
print "+0000";
}
sub prepare
{
#warn "Running on Perl V5.8.x" if $^V ge v5.8.0;
binmode( STDOUT, ":utf8" ) if $^V ge v5.8.0;
my @now = gmtime();
print "#, fuzzy\n";
print "msgid \"\"\n";
print "msgstr \"\"\n";
print "\"Project-Id-Version: desktop files\\n\"\n";
print "\"Report-Msgid-Bugs-To: http://bugs.trinitydesktop.org\\n\"\n";
print "\"POT-Creation-Date: "; printdate( @now ); print "\\n\"\n";
print "\"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\\n\"\n";
print "\"Last-Translator: FULL NAME <EMAIL\@ADDRESS>\\n\"\n";
print "\"Language-Team: LANGUAGE <kde-i18n-doc\@kde.org>\\n\"\n";
print "\"MIME-Version: 1.0\\n\"\n";
print "\"Content-Type: text/plain; charset=UTF-8\\n\"\n";
print "\"Content-Transfer-Encoding: 8bit\\n\"\n";
print "\n\n";
}
sub processfiles
{
my ( $files, $basedir) = ( @_ );
for my $filename ( @$files )
{
chomp( $filename );
open( FH, "<", $filename ) or warn "Cannot open file $filename";
binmode( FH, ":utf8" ) if $^V ge v5.8.0;
#warn("Using $filename");
#my $regexp = qr{^(Name|Comment|Language|Keywords|About|Description|GenericName)=};
my $regexp = qr{^(Name|Comment|Language|Keywords|About|Description|GenericName|Query|ExtraNames|X-TDE-Submenu)=};
while( <FH> )
{
if ( m/$regexp/o )
{
my $msgid = $_;
chomp( $msgid );
$msgid =~ s/\\/\\\\/g;
$msgid =~ s/\"/\\\"/g;
if ($msgid =~ m/ +$/) {
$msgid =~ s/ +$//; # remove trailing spaces
print STDERR "ERROR: white space at the end of $msgid in $filename\n";
}
if ($msgid =~ m/\r+$/) {
$msgid =~ s/\r+$//; # remove trailing CR (Carriage Return)
print STDERR "ERROR: CR at the end of $msgid in $filename\n";
}
$filename =~ s,^$basedir/,,;
print "#: $filename:$.\n";
print "msgid \"$msgid\"\n";
print "msgstr \"\"\n";
print "\n";
}
}
close( FH );
}
}
my $onefilelist;
my $basedir;
GetOptions ( "file-list=s" => \$onefilelist,
"base-dir=s" => \$basedir
);
prepare;
open( FILELIST, $onefilelist ) or warn ( "Cannot open file list: $onefilelist" );
my @thislist = <FILELIST>;
processfiles( \@thislist, $basedir );
close( FILELIST );

@ -1,44 +0,0 @@
#! /usr/bin/env bash
filelist=$1
rm -f "$filelist"_* $filelist
touch $filelist
dir=.
find $dir -name "*.directory" -print | grep -v debian >> $filelist
find $dir -name "*.kdelnk" -print | grep -v debian >> $filelist
find $dir -name "*.desktop" -print | grep -v debian >> $filelist
find $dir -name "*.kimap" -print | grep -v debian >> $filelist
find $dir -name "*.themerc" -print | grep -v debian >> $filelist
find $dir -name "*.kcsrc" -print | grep -v debian >> $filelist
find $dir -name "*.setdlg" -print | grep -v debian >> $filelist
find $dir -name "index.theme" -print | grep -v debian >> $filelist
find $dir -name "eventsrc" -print | grep -v debian >> $filelist
find $dir -name "*.protocol" -print | grep -v debian >> $filelist
### TEMPORARY START: we do not have TDE modules
if true; then
find ./konqueror -name .svn -prune , -name "directory.*" -type f 2>/dev/null | grep -v debian >> $filelist
find ./kdesktop -name .svn -prune , -name "directory.*" -type f 2>/dev/null | grep -v debian >> $filelist
find ./drkonqi -name "*rc" -print 2>/dev/null | grep -v debian >> $filelist
find ./kimgio -name \*.kimgio -print 2>/dev/null | grep -v debian >> $filelist
find ./noatun -name \*.plugin -print 2>/dev/null | grep -v debian >> $filelist
find ./noatun-plugins -name \*.plugin -print 2>/dev/null | grep -v debian >> $filelist
for file in `cat ./kolf/courses.list 2>/dev/null`; do
cat ./kolf/$file 2>/dev/null | grep -v debian >> $filelist
done
find ./amor/data -name \*rc -print 2>/dev/null | grep -v debian >> $filelist
find ./tdeprint -name \*.print -print 2>/dev/null | grep -v debian >> $filelist
find . -name \*.kksrc -print 2>/dev/null | grep -v debian >> $filelist
find ./kopete -name \*.plugin -print 2>/dev/null | grep -v debian >> $filelist
find . -name \*.kdevtemplate -print 2>/dev/null | grep -v debian >> $filelist
fi
### TEMPORARY END: we do not have TDE modules
# Extract .directory files in template directories of KOffice
find . -name .directory|fgrep templates >> $filelist
sort -o $filelist -u $filelist

@ -1,168 +0,0 @@
#! /usr/bin/env python
import sys, string, codecs, os
# TODO: currently the 78 chars are *without* the quotes, while for Gettext it is *with* the quotes
# FIXME: it seems possible to get lines bigger than 80 characters.
max_length = 78
wrap_before = ['<h1>', '<h2>', '<h3>', '<h4>', '<h5>', '<h6>', '<p>', '<br>', '<br/>',
'<ol>', '<ul>', '<li>', '<table>', '<th>', '<tr>', '<td>', '<center>',
'<blockquote>', '<pre>', '<hr>', '<hr/>']
### TODO: try to support any charset, not only UTF-8 (so that it can be used outside TDE)
def splitit( start, message, outfile ):
# print start+"\""+message+"\"" # DEBUG
if len(start):
if len(message) + len(start) < max_length and \
string.find(message, '\\n') == -1:
outstr = '%s"%s"\n' % (start, message)
outfile.write(outstr.encode('utf-8'))
return
outfile.write(start)
outfile.write(u'""\n')
index = 0
mlen = len(message)
last_brace = 0
last_space = 0
last_comma = 0
while index < mlen:
if message[index] == r'n' and (index > 0 and message[index-1] == '\\') \
and (index < 2 or message[index-2] != '\\'):
outstr = '"%s"\n' % message[:index+1]
outfile.write(outstr.encode('utf-8'))
message = message[index+1:]
mlen -= index + 1
index = 0
last_brace = 0
last_space = 0
last_comma = 0
continue
elif message[index] == u'>':
last_brace = index
elif message[index] == u' ':
last_space = index
elif message[index] == u',':
last_comma = index
elif message[index] == u'<':
for s in wrap_before:
if index > 0 and message[index:].startswith(s):
outstr = '"%s"\n' % message[:index]
outfile.write(outstr.encode('utf-8'))
message = message[index:]
mlen -= index
index = 0
last_brace = 0
last_space = 0
last_comma = 0
continue
if index > max_length:
if last_brace > 50:
index = last_brace
while index < mlen - 1 and message[index+1] == ' ':
index += 1
elif last_space != 0:
index = last_space
elif last_comma != 0:
index = last_comma
else:
while index > 0 and message[index] == u'\\':
index = index - 1
outstr = '"%s"\n' % message[:index+1]
outfile.write(outstr.encode('utf-8'))
message = message[index+1:]
mlen -= index + 1
index = 0
last_brace = 0
last_space = 0
last_comma = 0
continue
index += 1
if len(message):
outstr = '"%s"\n' % message
outfile.write(outstr.encode('utf-8'))
if sys.hexversion >= 0x02030000:
# We have Python 2.3 or better
open_type="rU" # Open for read with "Universal Newline Support"
else:
# We have a Python older than 2.3
open_type="r" # Normal open for read
### TODO: even in the case of a parse error, the script could try to process the next file(s) instead of exiting.
for file in sys.argv[1:]:
orig_file = open(file, open_type)
new_file = open(file + ".new", 'w')
last=''
start=''
index=0
line=' '
while 1: # python 2.1 has no True ;)
line = orig_file.readline()
index += 1
if not line:
break
if line == '\n' or line[0] == '#':
splitit(start, last, new_file)
start = ''
last = ''
new_file.write(line)
continue
try:
line = string.strip(unicode(line, 'utf-8'))
except UnicodeError:
print file
if line[0] == '"' and line[-1:] == '"':
last += line[1:-1]
continue
# new message
splitit(start, last, new_file)
if line.startswith("msgid "):
start = "msgid "
last = string.lstrip(line[6:-1])[1:]
elif line.startswith("msgstr "):
start = "msgstr "
last = string.lstrip(line[7:-1])[1:]
elif line.startswith("msgctxt "):
start = "msgctxt "
last = string.lstrip(line[8:-1])[1:]
elif line.startswith("msgid_plural "):
start = "msgid_plural "
last = string.lstrip(line[13:-1])[1:]
elif line.startswith("msgstr["):
# For most languages, there will be only one digit
if line[8] == "]" and line[9] == " ":
if line[7].isdigit():
start = line[:10]
last = string.lstrip(line[10:-1])[1:]
else:
print file, "not-a-digit error for mgstr[] in line", index
orig_file.close()
new_file.close()
sys.exit(1)
else:
posdigit = 7 # The first digit is at position 7
while line[posdigit].isdigit():
posdigit += 1
if posdigit > 7 and line[posdigit] == "]" and line[posdigit+1] == " ":
posdigit += 2 # skip ] and the space
start = line[:posdigit]
last = string.lstrip(line[posdigit:-1])[1:]
else:
print file, "parse error after msgstr[ in line", index
orig_file.close()
new_file.close()
sys.exit(1)
else:
print file, "parsing error in line", index
orig_file.close()
new_file.close()
sys.exit(1)
splitit(start, last, new_file)
orig_file.close()
new_file.close()
os.rename(file + ".new", file)
# kate: space-indent off; indent-width 8; replace-tabs off;

@ -1,98 +0,0 @@
#! /usr/bin/env perl
use strict;
use warnings;
use Getopt::Long;
sub printdate
{
printf ( "%04i", ( $_[5] + 1900 ) );
print "-";
printf ( "%02i", $_[4] + 1);
print "-";
printf ( "%02i", $_[3] );
print " ";
printf ( "%02i", $_[2] );
print ":";
printf ( "%02i", $_[1] );
print "+0000";
}
sub prepare
{
#warn "Running on Perl V5.8.x" if $^V ge v5.8.0;
binmode( STDOUT, ":utf8" ) if $^V ge v5.8.0;
my @now = gmtime();
print "#, fuzzy\n";
print "msgid \"\"\n";
print "msgstr \"\"\n";
print "\"Project-Id-Version: desktop files\\n\"\n";
print "\"Report-Msgid-Bugs-To: http://bugs.trinitydesktop.org\\n\"\n";
print "\"POT-Creation-Date: "; printdate( @now ); print "\\n\"\n";
print "\"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\\n\"\n";
print "\"Last-Translator: FULL NAME <EMAIL\@ADDRESS>\\n\"\n";
print "\"Language-Team: LANGUAGE <kde-i18n-doc\@kde.org>\\n\"\n";
print "\"MIME-Version: 1.0\\n\"\n";
print "\"Content-Type: text/plain; charset=UTF-8\\n\"\n";
print "\"Content-Transfer-Encoding: 8bit\\n\"\n";
print "\n\n";
}
sub processfiles
{
my ( $files, $basedir) = ( @_ );
for my $filename ( @$files )
{
chomp( $filename );
open( FH, "<", $filename ) or warn "Cannot open file $filename";
binmode( FH, ":utf8" ) if $^V ge v5.8.0;
#warn("Using $filename");
#my $regexp = qr{^(Name|Comment|Language|Keywords|About|Description|GenericName)=};
my $regexp = qr{^(Name|Comment|Language|Keywords|About|Description|GenericName|Query|ExtraNames|X-TDE-Submenu)=};
while( <FH> )
{
if ( m/$regexp/o )
{
my $msgid = $_;
chomp( $msgid );
$msgid =~ s/\\/\\\\/g;
$msgid =~ s/\"/\\\"/g;
if ($msgid =~ m/ +$/) {
$msgid =~ s/ +$//; # remove trailing spaces
print STDERR "ERROR: white space at the end of $msgid in $filename\n";
}
if ($msgid =~ m/\r+$/) {
$msgid =~ s/\r+$//; # remove trailing CR (Carriage Return)
print STDERR "ERROR: CR at the end of $msgid in $filename\n";
}
$filename =~ s,^$basedir/,,;
print "#: $filename:$.\n";
print "msgid \"$msgid\"\n";
print "msgstr \"\"\n";
print "\n";
}
}
close( FH );
}
}
my $onefilelist;
my $basedir;
GetOptions ( "file-list=s" => \$onefilelist,
"base-dir=s" => \$basedir
);
prepare;
open( FILELIST, $onefilelist ) or warn ( "Cannot open file list: $onefilelist" );
my @thislist = <FILELIST>;
processfiles( \@thislist, $basedir );
close( FILELIST );

@ -1,44 +0,0 @@
#! /usr/bin/env bash
filelist=$1
rm -f "$filelist"_* $filelist
touch $filelist
dir=.
find $dir -name "*.directory" -print | grep -v debian >> $filelist
find $dir -name "*.kdelnk" -print | grep -v debian >> $filelist
find $dir -name "*.desktop" -print | grep -v debian >> $filelist
find $dir -name "*.kimap" -print | grep -v debian >> $filelist
find $dir -name "*.themerc" -print | grep -v debian >> $filelist
find $dir -name "*.kcsrc" -print | grep -v debian >> $filelist
find $dir -name "*.setdlg" -print | grep -v debian >> $filelist
find $dir -name "index.theme" -print | grep -v debian >> $filelist
find $dir -name "eventsrc" -print | grep -v debian >> $filelist
find $dir -name "*.protocol" -print | grep -v debian >> $filelist
### TEMPORARY START: we do not have TDE modules
if true; then
find ./konqueror -name .svn -prune , -name "directory.*" -type f 2>/dev/null | grep -v debian >> $filelist
find ./kdesktop -name .svn -prune , -name "directory.*" -type f 2>/dev/null | grep -v debian >> $filelist
find ./drkonqi -name "*rc" -print 2>/dev/null | grep -v debian >> $filelist
find ./kimgio -name \*.kimgio -print 2>/dev/null | grep -v debian >> $filelist
find ./noatun -name \*.plugin -print 2>/dev/null | grep -v debian >> $filelist
find ./noatun-plugins -name \*.plugin -print 2>/dev/null | grep -v debian >> $filelist
for file in `cat ./kolf/courses.list 2>/dev/null`; do
cat ./kolf/$file 2>/dev/null | grep -v debian >> $filelist
done
find ./amor/data -name \*rc -print 2>/dev/null | grep -v debian >> $filelist
find ./tdeprint -name \*.print -print 2>/dev/null | grep -v debian >> $filelist
find . -name \*.kksrc -print 2>/dev/null | grep -v debian >> $filelist
find ./kopete -name \*.plugin -print 2>/dev/null | grep -v debian >> $filelist
find . -name \*.kdevtemplate -print 2>/dev/null | grep -v debian >> $filelist
fi
### TEMPORARY END: we do not have TDE modules
# Extract .directory files in template directories of KOffice
find . -name .directory|fgrep templates >> $filelist
sort -o $filelist -u $filelist

@ -1,168 +0,0 @@
#! /usr/bin/env python
import sys, string, codecs, os
# TODO: currently the 78 chars are *without* the quotes, while for Gettext it is *with* the quotes
# FIXME: it seems possible to get lines bigger than 80 characters.
max_length = 78
wrap_before = ['<h1>', '<h2>', '<h3>', '<h4>', '<h5>', '<h6>', '<p>', '<br>', '<br/>',
'<ol>', '<ul>', '<li>', '<table>', '<th>', '<tr>', '<td>', '<center>',
'<blockquote>', '<pre>', '<hr>', '<hr/>']
### TODO: try to support any charset, not only UTF-8 (so that it can be used outside TDE)
def splitit( start, message, outfile ):
# print start+"\""+message+"\"" # DEBUG
if len(start):
if len(message) + len(start) < max_length and \
string.find(message, '\\n') == -1:
outstr = '%s"%s"\n' % (start, message)
outfile.write(outstr.encode('utf-8'))
return
outfile.write(start)
outfile.write(u'""\n')
index = 0
mlen = len(message)
last_brace = 0
last_space = 0
last_comma = 0
while index < mlen:
if message[index] == r'n' and (index > 0 and message[index-1] == '\\') \
and (index < 2 or message[index-2] != '\\'):
outstr = '"%s"\n' % message[:index+1]
outfile.write(outstr.encode('utf-8'))
message = message[index+1:]
mlen -= index + 1
index = 0
last_brace = 0
last_space = 0
last_comma = 0
continue
elif message[index] == u'>':
last_brace = index
elif message[index] == u' ':
last_space = index
elif message[index] == u',':
last_comma = index
elif message[index] == u'<':
for s in wrap_before:
if index > 0 and message[index:].startswith(s):
outstr = '"%s"\n' % message[:index]
outfile.write(outstr.encode('utf-8'))
message = message[index:]
mlen -= index
index = 0
last_brace = 0
last_space = 0
last_comma = 0
continue
if index > max_length:
if last_brace > 50:
index = last_brace
while index < mlen - 1 and message[index+1] == ' ':
index += 1
elif last_space != 0:
index = last_space
elif last_comma != 0:
index = last_comma
else:
while index > 0 and message[index] == u'\\':
index = index - 1
outstr = '"%s"\n' % message[:index+1]
outfile.write(outstr.encode('utf-8'))
message = message[index+1:]
mlen -= index + 1
index = 0
last_brace = 0
last_space = 0
last_comma = 0
continue
index += 1
if len(message):
outstr = '"%s"\n' % message
outfile.write(outstr.encode('utf-8'))
if sys.hexversion >= 0x02030000:
# We have Python 2.3 or better
open_type="rU" # Open for read with "Universal Newline Support"
else:
# We have a Python older than 2.3
open_type="r" # Normal open for read
### TODO: even in the case of a parse error, the script could try to process the next file(s) instead of exiting.
for file in sys.argv[1:]:
orig_file = open(file, open_type)
new_file = open(file + ".new", 'w')
last=''
start=''
index=0
line=' '
while 1: # python 2.1 has no True ;)
line = orig_file.readline()
index += 1
if not line:
break
if line == '\n' or line[0] == '#':
splitit(start, last, new_file)
start = ''
last = ''
new_file.write(line)
continue
try:
line = string.strip(unicode(line, 'utf-8'))
except UnicodeError:
print file
if line[0] == '"' and line[-1:] == '"':
last += line[1:-1]
continue
# new message
splitit(start, last, new_file)
if line.startswith("msgid "):
start = "msgid "
last = string.lstrip(line[6:-1])[1:]
elif line.startswith("msgstr "):
start = "msgstr "
last = string.lstrip(line[7:-1])[1:]
elif line.startswith("msgctxt "):
start = "msgctxt "
last = string.lstrip(line[8:-1])[1:]
elif line.startswith("msgid_plural "):
start = "msgid_plural "
last = string.lstrip(line[13:-1])[1:]
elif line.startswith("msgstr["):
# For most languages, there will be only one digit
if line[8] == "]" and line[9] == " ":
if line[7].isdigit():
start = line[:10]
last = string.lstrip(line[10:-1])[1:]
else:
print file, "not-a-digit error for mgstr[] in line", index
orig_file.close()
new_file.close()
sys.exit(1)
else:
posdigit = 7 # The first digit is at position 7
while line[posdigit].isdigit():
posdigit += 1
if posdigit > 7 and line[posdigit] == "]" and line[posdigit+1] == " ":
posdigit += 2 # skip ] and the space
start = line[:posdigit]
last = string.lstrip(line[posdigit:-1])[1:]
else:
print file, "parse error after msgstr[ in line", index
orig_file.close()
new_file.close()
sys.exit(1)
else:
print file, "parsing error in line", index
orig_file.close()
new_file.close()
sys.exit(1)
splitit(start, last, new_file)
orig_file.close()
new_file.close()
os.rename(file + ".new", file)
# kate: space-indent off; indent-width 8; replace-tabs off;

@ -1,98 +0,0 @@
#! /usr/bin/env perl
use strict;
use warnings;
use Getopt::Long;
sub printdate
{
printf ( "%04i", ( $_[5] + 1900 ) );
print "-";
printf ( "%02i", $_[4] + 1);
print "-";
printf ( "%02i", $_[3] );
print " ";
printf ( "%02i", $_[2] );
print ":";
printf ( "%02i", $_[1] );
print "+0000";
}
sub prepare
{
#warn "Running on Perl V5.8.x" if $^V ge v5.8.0;
binmode( STDOUT, ":utf8" ) if $^V ge v5.8.0;
my @now = gmtime();
print "#, fuzzy\n";
print "msgid \"\"\n";
print "msgstr \"\"\n";
print "\"Project-Id-Version: desktop files\\n\"\n";
print "\"Report-Msgid-Bugs-To: http://bugs.trinitydesktop.org\\n\"\n";
print "\"POT-Creation-Date: "; printdate( @now ); print "\\n\"\n";
print "\"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\\n\"\n";
print "\"Last-Translator: FULL NAME <EMAIL\@ADDRESS>\\n\"\n";
print "\"Language-Team: LANGUAGE <kde-i18n-doc\@kde.org>\\n\"\n";
print "\"MIME-Version: 1.0\\n\"\n";
print "\"Content-Type: text/plain; charset=UTF-8\\n\"\n";
print "\"Content-Transfer-Encoding: 8bit\\n\"\n";
print "\n\n";
}
sub processfiles
{
my ( $files, $basedir) = ( @_ );
for my $filename ( @$files )
{
chomp( $filename );
open( FH, "<", $filename ) or warn "Cannot open file $filename";
binmode( FH, ":utf8" ) if $^V ge v5.8.0;
#warn("Using $filename");
#my $regexp = qr{^(Name|Comment|Language|Keywords|About|Description|GenericName)=};
my $regexp = qr{^(Name|Comment|Language|Keywords|About|Description|GenericName|Query|ExtraNames|X-TDE-Submenu)=};
while( <FH> )
{
if ( m/$regexp/o )
{
my $msgid = $_;
chomp( $msgid );
$msgid =~ s/\\/\\\\/g;
$msgid =~ s/\"/\\\"/g;
if ($msgid =~ m/ +$/) {
$msgid =~ s/ +$//; # remove trailing spaces
print STDERR "ERROR: white space at the end of $msgid in $filename\n";
}
if ($msgid =~ m/\r+$/) {
$msgid =~ s/\r+$//; # remove trailing CR (Carriage Return)
print STDERR "ERROR: CR at the end of $msgid in $filename\n";
}
$filename =~ s,^$basedir/,,;
print "#: $filename:$.\n";
print "msgid \"$msgid\"\n";
print "msgstr \"\"\n";
print "\n";
}
}
close( FH );
}
}
my $onefilelist;
my $basedir;
GetOptions ( "file-list=s" => \$onefilelist,
"base-dir=s" => \$basedir
);
prepare;
open( FILELIST, $onefilelist ) or warn ( "Cannot open file list: $onefilelist" );
my @thislist = <FILELIST>;
processfiles( \@thislist, $basedir );
close( FILELIST );

@ -1,44 +0,0 @@
#! /usr/bin/env bash
filelist=$1
rm -f "$filelist"_* $filelist
touch $filelist
dir=.
find $dir -name "*.directory" -print | grep -v debian >> $filelist
find $dir -name "*.kdelnk" -print | grep -v debian >> $filelist
find $dir -name "*.desktop" -print | grep -v debian >> $filelist
find $dir -name "*.kimap" -print | grep -v debian >> $filelist
find $dir -name "*.themerc" -print | grep -v debian >> $filelist
find $dir -name "*.kcsrc" -print | grep -v debian >> $filelist
find $dir -name "*.setdlg" -print | grep -v debian >> $filelist
find $dir -name "index.theme" -print | grep -v debian >> $filelist
find $dir -name "eventsrc" -print | grep -v debian >> $filelist
find $dir -name "*.protocol" -print | grep -v debian >> $filelist
### TEMPORARY START: we do not have TDE modules
if true; then
find ./konqueror -name .svn -prune , -name "directory.*" -type f 2>/dev/null | grep -v debian >> $filelist
find ./kdesktop -name .svn -prune , -name "directory.*" -type f 2>/dev/null | grep -v debian >> $filelist
find ./drkonqi -name "*rc" -print 2>/dev/null | grep -v debian >> $filelist
find ./kimgio -name \*.kimgio -print 2>/dev/null | grep -v debian >> $filelist
find ./noatun -name \*.plugin -print 2>/dev/null | grep -v debian >> $filelist
find ./noatun-plugins -name \*.plugin -print 2>/dev/null | grep -v debian >> $filelist
for file in `cat ./kolf/courses.list 2>/dev/null`; do
cat ./kolf/$file 2>/dev/null | grep -v debian >> $filelist
done
find ./amor/data -name \*rc -print 2>/dev/null | grep -v debian >> $filelist
find ./tdeprint -name \*.print -print 2>/dev/null | grep -v debian >> $filelist
find . -name \*.kksrc -print 2>/dev/null | grep -v debian >> $filelist
find ./kopete -name \*.plugin -print 2>/dev/null | grep -v debian >> $filelist
find . -name \*.kdevtemplate -print 2>/dev/null | grep -v debian >> $filelist
fi
### TEMPORARY END: we do not have TDE modules
# Extract .directory files in template directories of KOffice
find . -name .directory|fgrep templates >> $filelist
sort -o $filelist -u $filelist

@ -1,168 +0,0 @@
#! /usr/bin/env python
import sys, string, codecs, os
# TODO: currently the 78 chars are *without* the quotes, while for Gettext it is *with* the quotes
# FIXME: it seems possible to get lines bigger than 80 characters.
max_length = 78
wrap_before = ['<h1>', '<h2>', '<h3>', '<h4>', '<h5>', '<h6>', '<p>', '<br>', '<br/>',
'<ol>', '<ul>', '<li>', '<table>', '<th>', '<tr>', '<td>', '<center>',
'<blockquote>', '<pre>', '<hr>', '<hr/>']
### TODO: try to support any charset, not only UTF-8 (so that it can be used outside TDE)
def splitit( start, message, outfile ):
# print start+"\""+message+"\"" # DEBUG
if len(start):
if len(message) + len(start) < max_length and \
string.find(message, '\\n') == -1:
outstr = '%s"%s"\n' % (start, message)
outfile.write(outstr.encode('utf-8'))
return
outfile.write(start)
outfile.write(u'""\n')
index = 0
mlen = len(message)
last_brace = 0
last_space = 0
last_comma = 0
while index < mlen:
if message[index] == r'n' and (index > 0 and message[index-1] == '\\') \
and (index < 2 or message[index-2] != '\\'):
outstr = '"%s"\n' % message[:index+1]
outfile.write(outstr.encode('utf-8'))
message = message[index+1:]
mlen -= index + 1
index = 0
last_brace = 0
last_space = 0
last_comma = 0
continue
elif message[index] == u'>':
last_brace = index
elif message[index] == u' ':
last_space = index
elif message[index] == u',':
last_comma = index
elif message[index] == u'<':
for s in wrap_before:
if index > 0 and message[index:].startswith(s):
outstr = '"%s"\n' % message[:index]
outfile.write(outstr.encode('utf-8'))
message = message[index:]
mlen -= index
index = 0
last_brace = 0
last_space = 0
last_comma = 0
continue
if index > max_length:
if last_brace > 50:
index = last_brace
while index < mlen - 1 and message[index+1] == ' ':
index += 1
elif last_space != 0:
index = last_space
elif last_comma != 0:
index = last_comma
else:
while index > 0 and message[index] == u'\\':
index = index - 1
outstr = '"%s"\n' % message[:index+1]
outfile.write(outstr.encode('utf-8'))
message = message[index+1:]
mlen -= index + 1
index = 0
last_brace = 0
last_space = 0
last_comma = 0
continue
index += 1
if len(message):
outstr = '"%s"\n' % message
outfile.write(outstr.encode('utf-8'))
if sys.hexversion >= 0x02030000:
# We have Python 2.3 or better
open_type="rU" # Open for read with "Universal Newline Support"
else:
# We have a Python older than 2.3
open_type="r" # Normal open for read
### TODO: even in the case of a parse error, the script could try to process the next file(s) instead of exiting.
for file in sys.argv[1:]:
orig_file = open(file, open_type)
new_file = open(file + ".new", 'w')
last=''
start=''
index=0
line=' '
while 1: # python 2.1 has no True ;)
line = orig_file.readline()
index += 1
if not line:
break
if line == '\n' or line[0] == '#':
splitit(start, last, new_file)
start = ''
last = ''
new_file.write(line)
continue
try:
line = string.strip(unicode(line, 'utf-8'))
except UnicodeError:
print file
if line[0] == '"' and line[-1:] == '"':
last += line[1:-1]
continue
# new message
splitit(start, last, new_file)
if line.startswith("msgid "):
start = "msgid "
last = string.lstrip(line[6:-1])[1:]
elif line.startswith("msgstr "):
start = "msgstr "
last = string.lstrip(line[7:-1])[1:]
elif line.startswith("msgctxt "):
start = "msgctxt "
last = string.lstrip(line[8:-1])[1:]
elif line.startswith("msgid_plural "):
start = "msgid_plural "
last = string.lstrip(line[13:-1])[1:]
elif line.startswith("msgstr["):
# For most languages, there will be only one digit
if line[8] == "]" and line[9] == " ":
if line[7].isdigit():
start = line[:10]
last = string.lstrip(line[10:-1])[1:]
else:
print file, "not-a-digit error for mgstr[] in line", index
orig_file.close()
new_file.close()
sys.exit(1)
else:
posdigit = 7 # The first digit is at position 7
while line[posdigit].isdigit():
posdigit += 1
if posdigit > 7 and line[posdigit] == "]" and line[posdigit+1] == " ":
posdigit += 2 # skip ] and the space
start = line[:posdigit]
last = string.lstrip(line[posdigit:-1])[1:]
else:
print file, "parse error after msgstr[ in line", index
orig_file.close()
new_file.close()
sys.exit(1)
else:
print file, "parsing error in line", index
orig_file.close()
new_file.close()
sys.exit(1)
splitit(start, last, new_file)
orig_file.close()
new_file.close()
os.rename(file + ".new", file)
# kate: space-indent off; indent-width 8; replace-tabs off;
Loading…
Cancel
Save