您最多能選擇 25 個主題
主題必須以字母或數字為開頭,可包含連接號「-」且最長為 35 個字元。
此檔案含有易混淆的 Unicode 字元,這些字元的處理方式可能和下面呈現的不同。若您是有意且合理的使用,您可以放心地忽略此警告。使用 Escape 按鈕標記這些字元。
|
|
#! /usr/bin/perl
|
|
|
|
|
|
# NOTE: this script is part of the KDE SDK and added to KDevelop to support KDE 2 application development.
|
|
|
# The original is located in the KDE CVS module tdesdk/scripts. It gets installed in the same directory as
|
|
|
# the KDevelop binary to be in your PATH.
|
|
|
#
|
|
|
# What it does is extract the strings in an application´s .rc file, e.g. testappui.rc, and writes into the pot file
|
|
|
# where the translations are build with (po-files)
|
|
|
#
|
|
|
# Added to KDevelop 2000-10-29, Ralf Nolden (nolden@kde.org)
|
|
|
|
|
|
$linenr = 0;
|
|
|
$filename = "";
|
|
|
@filenames = ();
|
|
|
|
|
|
sub writeoutstring($)
|
|
|
{
|
|
|
print STDOUT "i18n(\"@_[0]\");\n";
|
|
|
}
|
|
|
|
|
|
while (defined ($ARGV[0]))
|
|
|
{
|
|
|
$_ = shift;
|
|
|
$filename = $_; # maybe check for options
|
|
|
|
|
|
if (! $filename) {
|
|
|
print STDERR "no file to open\n";
|
|
|
exit 1;
|
|
|
}
|
|
|
|
|
|
$string = "";
|
|
|
$intext = 0;
|
|
|
|
|
|
open(FILE, $filename);
|
|
|
while ( <FILE> ) {
|
|
|
$linenr++;
|
|
|
|
|
|
$string .= $_;
|
|
|
chomp($string);
|
|
|
|
|
|
$textstring = '([tT][eE][xX][tT]|string)>';
|
|
|
|
|
|
if ($intext == 0) {
|
|
|
if ($string =~ /<$textstring/) {
|
|
|
$string =~ s/^.*<$textstring//;
|
|
|
$intext = 1;
|
|
|
$starting_linenr = $linenr;
|
|
|
} else {
|
|
|
$string = "";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (($intext == 1) && ($string =~ /<\/$textstring/)) {
|
|
|
my $text = $string;
|
|
|
$text =~ s/<\/$textstring.*$//;
|
|
|
$text =~ s/</</g;
|
|
|
$text =~ s/>/>/g;
|
|
|
$text =~ s/&/&/g;
|
|
|
writeoutstring($text);
|
|
|
$string =~ s/^.*<\/$textstring//;
|
|
|
$intext = 0;
|
|
|
if ($linenr != $starting_linenr) {
|
|
|
print STDERR "there is <text> floating\n";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if ($intext == 1) {
|
|
|
print STDERR "parsing error in $filename $linenr\n";
|
|
|
exit 1;
|
|
|
}
|
|
|
|
|
|
}
|