Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2161

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/61/2161/1

fdo#58283 produce all translations for desktop files

Change-Id: Ie97e1ae7b2cc059630cba682a051eefff3ca044b
(cherry picked from commit 4a6f1853a2a15b938575406feada108443257536)
---
M sysui/desktop/share/translate.pl
1 file changed, 14 insertions(+), 11 deletions(-)



diff --git a/sysui/desktop/share/translate.pl b/sysui/desktop/share/translate.pl
index f6255df..200f6a8 100644
--- a/sysui/desktop/share/translate.pl
+++ b/sysui/desktop/share/translate.pl
@@ -76,6 +76,8 @@
         # 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
@@ -93,8 +95,7 @@
 
             $locale=~s/-/_/;
 
-            $templates{$template}->{'locale'} = $locale;
-            $templates{$template}->{'value'} = $value;
+            $templates{$template}->{'translations'}->{$locale} = $value;
         }
     }
 }
@@ -125,15 +126,17 @@
         $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";
+                    }
                 }
             }
         }

-- 
To view, visit https://gerrit.libreoffice.org/2161
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie97e1ae7b2cc059630cba682a051eefff3ca044b
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: David Tardon <dtardon@redhat.com>

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.