[Libreoffice] [PATCH] speed up localized builds by introducing po2lo

Miklos Vajna vmiklos at frugalware.org
Wed Sep 14 16:19:02 PDT 2011


On Thu, Sep 15, 2011 at 12:44:01AM +0200, Miklos Vajna <vmiklos at frugalware.org> wrote:
> Actually that's not an omission:
> 
> The accessibility strings end up at
> translations/unxlngx6.pro/misc/sdf/avmedia/source/framework/localize.sdf
> here.

The attached patch fixes the issue here.
-------------- next part --------------
From 3381db95cc026f404094daabbed4a8d84685a142 Mon Sep 17 00:00:00 2001
From: Miklos Vajna <vmiklos at frugalware.org>
Date: Thu, 15 Sep 2011 01:13:05 +0200
Subject: [PATCH] fast_merge: fix mis-merge of first module's strings

The problem was that in write_lines() when $first_run was true, the
add_to_buffer() call already set the current module's name to the second
module.

A fix for this is to use let make_paths() take a parameter, and in case
of the first run, pass the really first module name, not the current
one.
---
 l10ntools/scripts/fast_merge.pl |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/l10ntools/scripts/fast_merge.pl b/l10ntools/scripts/fast_merge.pl
index 5dc63cf..73b824e 100644
--- a/l10ntools/scripts/fast_merge.pl
+++ b/l10ntools/scripts/fast_merge.pl
@@ -91,7 +91,7 @@ while( hasLines() )
 }
 if( $#current+1 ne 0 )
 {
-    ( $path , $localize_file ) = make_paths();
+    ( $path , $localize_file ) = make_paths($current[ 0 ]->module);
     add_to_buffer();
     write_buffer( $path , $localize_file );
 }
@@ -240,7 +240,8 @@ sub hasLines
 
 sub make_paths
 {
-    my $localizeFile = $merge_dir."\\".$current[ 0 ]->module."\\".$current[ 0 ]->file;
+    my $module = shift ;
+    my $localizeFile = $merge_dir."\\".$module."\\".$current[ 0 ]->file;
     my $path = getDir( $localizeFile );
     $path =~ s/\\/\//g;
 
@@ -251,8 +252,9 @@ sub make_paths
 sub write_lines
 {
     if( $first_run ){
+        my $module = $current[ 0 ]->module;
         add_to_buffer();
-        my( $path , $localize_file ) = make_paths();
+        my( $path , $localize_file ) = make_paths($module);
         $last_path = $path;
         $last_localize_file = $localize_file;
         mkpath $path;
@@ -262,7 +264,7 @@ sub write_lines
     else
     {
         return , if ( $#current+1 eq 0 );
-        my( $path , $localize_file ) = make_paths();
+        my( $path , $localize_file ) = make_paths($current[ 0 ]->module);
         if( $path eq $last_path )
         {
             add_to_buffer();
-- 
1.7.6

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110915/3d8db814/attachment.pgp>


More information about the LibreOffice mailing list