diff options
author | Slávek Banko <[email protected]> | 2019-01-09 20:15:15 +0100 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2019-01-11 14:31:48 +0100 |
commit | fc2a264df5071a7febbd14ff5995c3c1d7776a9a (patch) | |
tree | 7890e8f7df47190bb0159e8cd6ecb03dce76f499 /translations/extractrc | |
parent | 4638acbc784819a256941c8132cfb8f21024ecbd (diff) | |
download | bibletime-fc2a264df5071a7febbd14ff5995c3c1d7776a9a.tar.gz bibletime-fc2a264df5071a7febbd14ff5995c3c1d7776a9a.zip |
Add CMakeL10n rules.
Update translation template.
Signed-off-by: Slávek Banko <[email protected]>
(cherry picked from commit f195bc821512f91cb87780f0ff0d99641cf27274)
Diffstat (limited to 'translations/extractrc')
-rw-r--r-- | translations/extractrc | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/translations/extractrc b/translations/extractrc new file mode 100644 index 0000000..ab9c5ca --- /dev/null +++ b/translations/extractrc @@ -0,0 +1,74 @@ +#! /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 ([email protected]) + +$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; +} + +} |