Commit f57f76e6 authored by Pino Toscano's avatar Pino Toscano

i18n: use location for strings of palettes/brushes/etc

If known, output the location of the strings as comment; together with
the usage of rc.cpp (instead of i18ndata) as temporary file for these
strings, this makes sure the .po file shows their locations.
parent 8ddd75fd
......@@ -14,12 +14,12 @@ ACTIONFILES=`find . -name \*.action`
./action_i18n.pl --context=action $ACTIONFILES >> rc.cpp
# extracti18n.pl extracts additional data from brushes, palettes etc.
perl extracti18n.pl > i18ndata
perl extracti18n.pl >> rc.cpp
# Ignore sdk/templates which contains templates for writing future plugins.
# Also ignore crashreporter, it has it's own catalog
# None of the placeholder strings inside will be seen by users.
kundo2_aware_xgettext krita.pot i18ndata rc.cpp \
kundo2_aware_xgettext krita.pot rc.cpp \
`find . -name \*.cc -o -name \*.h -o -name \*.cpp | \
grep -v '/tests/' | grep -v './sdk/templates' | grep -v './krita/crashreporter/'`
......@@ -27,4 +27,4 @@ kundo2_aware_xgettext krita.pot i18ndata rc.cpp \
$XGETTEXT -L Python `find . -name \*.py` -j -o $podir/krita.pot
# Clean up
rm -f i18ndata rc.cpp
rm -f rc.cpp
......@@ -22,9 +22,13 @@
use strict;
use warnings;
sub printi18n($$) {
sub printi18n($$$$) {
if ($_[0] ne "")
{
if ($_[3] > 0)
{
print "// i18n: file: ".$_[2].":".$_[3]."\n";
}
print "i18nc(\"".$_[1]."\",\"".$_[0]."\");\n";
}
}
......@@ -49,13 +53,13 @@ foreach my $filename (@filenames)
my @splited = split(/: /, $lines[1]);
my $name = $splited[1];
chomp($name);
printi18n($name, $filename);
printi18n($name, $filename, $filename, 2);
}
else
{
my $name = $lines[0];
chomp($name);
printi18n($name, $filename);
printi18n($name, $filename, $filename, 1);
}
}
else
......@@ -70,13 +74,13 @@ foreach my $filename (@filenames)
{
read(FILE, $bytes, 12);
read(FILE, my $name, $size - 21);
printi18n($name, $filename);
printi18n($name, $filename, $filename, -1);
}
else
{
read(FILE, $bytes, 20);
read(FILE, my $name, $size - 29);
printi18n($name, $filename);
printi18n($name, $filename, $filename, -1);
}
}
else
......@@ -85,7 +89,7 @@ foreach my $filename (@filenames)
my $size = unpack("N", $bytes);
read(FILE, $bytes, 20);
read(FILE, my $name, $size - 25);
printi18n($name, $filename);
printi18n($name, $filename, $filename, -1);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment