[Libreoffice-commits] core.git: Branch 'libreoffice-3-6' - sysui/desktop

David Tardon dtardon at redhat.com
Fri Feb 15 02:25:28 PST 2013


 sysui/desktop/share/translate.pl |   25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

New commits:
commit 2c4d36b7d6da9f9b578d903499844930f90c8faf
Author: David Tardon <dtardon at redhat.com>
Date:   Fri Feb 15 07:28:39 2013 +0100

    fdo#58283 produce all translations for desktop files
    
    Change-Id: Ie97e1ae7b2cc059630cba682a051eefff3ca044b
    (cherry picked from commit 4a6f1853a2a15b938575406feada108443257536)
    Reviewed-on: https://gerrit.libreoffice.org/2162
    Reviewed-by: Andras Timar <atimar at suse.com>
    Tested-by: Andras Timar <atimar at suse.com>

diff --git a/sysui/desktop/share/translate.pl b/sysui/desktop/share/translate.pl
index c55ee25..f67cb58 100755
--- a/sysui/desktop/share/translate.pl
+++ b/sysui/desktop/share/translate.pl
@@ -85,6 +85,8 @@ while (<SOURCE>) {
         # For every section in the specified ulf file there should exist
         # a template file in $workdir ..
         $entry{'outfile'} = "$workdir/$prefix$template.$ext";
+        my %translations;
+        $entry{'translations'} = \%translations;
         $templates{$template} = \%entry;
     } else {
         # split locale = "value" into 2 strings
@@ -102,8 +104,7 @@ while (<SOURCE>) {
 
             $locale=~s/-/_/;
 
-            $templates{$template}->{'locale'} = $locale;
-            $templates{$template}->{'value'} = $value;
+            $templates{$template}->{'translations'}->{$locale} = $value;
         }
     }
 }
@@ -134,15 +135,17 @@ foreach $template (keys %templates) {
         $keyline =~ s/^$key/$outkey/;
         print OUTFILE $keyline;
         if (/$key/) {
-            my $locale = $templates{$template}->{'locale'};
-            my $value = $templates{$template}->{'value'};
-            print "locale is $locale\n";
-            print "value is $value\n";
-            if ($value) {
-                if ($ext eq "desktop") {
-                    print OUTFILE "$outkey\[$locale\]=$value\n";
-                } else {
-                    print OUTFILE "\t\[$locale\]$outkey=$value\n";
+            my $translations = $templates{$template}->{'translations'};
+            foreach my $locale (keys %{$translations}) {
+                my $value = $translations->{$locale};
+                print "locale is $locale\n";
+                print "value is $value\n";
+                if ($value) {
+                    if ($ext eq "desktop") {
+                        print OUTFILE "$outkey\[$locale\]=$value\n";
+                    } else {
+                        print OUTFILE "\t\[$locale\]$outkey=$value\n";
+                    }
                 }
             }
         }


More information about the Libreoffice-commits mailing list