3
# NOTE: this script is part of the KDE SDK and added to KDevelop to support KDE 2 application development.
4
# The original is located in the KDE CVS module kdesdk/scripts. It gets installed in the same directory as
5
# the KDevelop binary to be in your PATH.
7
# What it does is extract the strings in an application�s .rc file, e.g. testappui.rc, and writes into the pot file
8
# where the translations are build with (po-files)
10
# Added to KDevelop 2000-10-29, Ralf Nolden (nolden@kde.org)
18
print STDOUT "i18n(\"@_[0]\");\n";
21
while (defined ($ARGV[0]))
24
$filename = $_; # maybe check for options
27
print STDERR "no file to open\n";
34
open(FILE, $filename);
41
$textstring = '([tT][eE][xX][tT]|string)>';
44
if ($string =~ /<$textstring/) {
45
$string =~ s/^.*<$textstring//;
47
$starting_linenr = $linenr;
53
if (($intext == 1) && ($string =~ /<\/$textstring/)) {
55
$text =~ s/<\/$textstring.*$//;
59
writeoutstring($text);
60
$string =~ s/^.*<\/$textstring//;
62
if ($linenr != $starting_linenr) {
63
print STDERR "there is <text> floating\n";
70
print STDERR "parsing error in $filename $linenr\n";