Kaydet (Commit) 4a6f1853 authored tarafından David Tardon's avatar David Tardon

fdo#58283 produce all translations for desktop files

Change-Id: Ie97e1ae7b2cc059630cba682a051eefff3ca044b
üst 115054fe
...@@ -76,6 +76,8 @@ while (<SOURCE>) { ...@@ -76,6 +76,8 @@ while (<SOURCE>) {
# For every section in the specified ulf file there should exist # For every section in the specified ulf file there should exist
# a template file in $workdir .. # a template file in $workdir ..
$entry{'outfile'} = "$workdir/$prefix$template.$ext"; $entry{'outfile'} = "$workdir/$prefix$template.$ext";
my %translations;
$entry{'translations'} = \%translations;
$templates{$template} = \%entry; $templates{$template} = \%entry;
} else { } else {
# split locale = "value" into 2 strings # split locale = "value" into 2 strings
...@@ -93,8 +95,7 @@ while (<SOURCE>) { ...@@ -93,8 +95,7 @@ while (<SOURCE>) {
$locale=~s/-/_/; $locale=~s/-/_/;
$templates{$template}->{'locale'} = $locale; $templates{$template}->{'translations'}->{$locale} = $value;
$templates{$template}->{'value'} = $value;
} }
} }
} }
...@@ -125,15 +126,17 @@ foreach $template (keys %templates) { ...@@ -125,15 +126,17 @@ foreach $template (keys %templates) {
$keyline =~ s/^$key/$outkey/; $keyline =~ s/^$key/$outkey/;
print OUTFILE $keyline; print OUTFILE $keyline;
if (/$key/) { if (/$key/) {
my $locale = $templates{$template}->{'locale'}; my $translations = $templates{$template}->{'translations'};
my $value = $templates{$template}->{'value'}; foreach my $locale (keys %{$translations}) {
print "locale is $locale\n"; my $value = $translations->{$locale};
print "value is $value\n"; print "locale is $locale\n";
if ($value) { print "value is $value\n";
if ($ext eq "desktop") { if ($value) {
print OUTFILE "$outkey\[$locale\]=$value\n"; if ($ext eq "desktop") {
} else { print OUTFILE "$outkey\[$locale\]=$value\n";
print OUTFILE "\t\[$locale\]$outkey=$value\n"; } else {
print OUTFILE "\t\[$locale\]$outkey=$value\n";
}
} }
} }
} }
......
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