netsurf: branch master updated. release/3.0-51-g70b1a8b

NetSurf Browser Project (Commit Mailer) no-reply at netsurf-browser.org
Tue May 7 22:20:37 BST 2013


Gitweb links:

...log http://git.netsurf-browser.org/netsurf.git/shortlog/70b1a8b1cef34b956422c92d51aad73f47bc35a1
...commit http://git.netsurf-browser.org/netsurf.git/commit/70b1a8b1cef34b956422c92d51aad73f47bc35a1
...tree http://git.netsurf-browser.org/netsurf.git/tree/70b1a8b1cef34b956422c92d51aad73f47bc35a1

The branch, master has been updated
       via  70b1a8b1cef34b956422c92d51aad73f47bc35a1 (commit)
       via  9c6e4c7eb5d425d216ad3ccc987a854d904b59cd (commit)
      from  a0fde060e8b11b55ea70c2d71565a4f4e326b768 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=70b1a8b1cef34b956422c92d51aad73f47bc35a1
commit 70b1a8b1cef34b956422c92d51aad73f47bc35a1
Author: Vivek Dasmohapatra <vivek at collabora.co.uk>
Commit: Vincent Sanders <vince at netsurf-browser.org>

    Add new translation entries to the master file when importing

diff --git a/utils/import-messages.pl b/utils/import-messages.pl
index d34165a..4c13a85 100644
--- a/utils/import-messages.pl
+++ b/utils/import-messages.pl
@@ -59,6 +59,8 @@ sub main ()
     my $opt_ok;
     my @input;
     my %message;
+    my $last_key;
+    my $last_plat;
 
     # option parsing:
     Getopt::Long::Configure( GETOPT_OPTS );
@@ -93,11 +95,33 @@ sub main ()
     {
         use bytes;
 
-        if( !/#/     &&
-            !/^\s*$/ &&
-            /^([a-z]{2})\.([^.]+)\.([^:]+):/ )
+        my( $lang, $plat, $key );
+
+        if( /^([a-z]{2})\.([^.]+)\.([^:]+):/ )
         {
-            my( $lang, $plat, $key ) = ( $1, $2, $3 );
+            ( $lang, $plat, $key ) = ( $1, $2, $3 );
+        }
+
+        if( $key || $message{ $last_key } )
+        {
+            #print( $output "## $last_key -> $key\n" );
+            # the key changed but we have a message for it still pending:
+            if( $last_key && $message{ $last_key } && ($key ne $last_key) )
+            {
+                my $plt = $last_plat;
+                my $str = $message{ $last_key };
+                my $msg = qq|$opt{lang}.$last_plat.$last_key:$str\n|;
+
+                print( $output $msg );
+                delete( $message{ $last_key } );
+
+                # if the line following our new translation is not blank,
+                # generate a synthetic group-separator:
+                if( !/^\s*$/ ) { print( $output "\n") }
+            }
+
+            $last_key  = $key;
+            $last_plat = $plat;
 
             if( $lang eq $opt{lang} )
             {
@@ -106,7 +130,8 @@ sub main ()
                     ( $opt{plat} eq 'any' ||   # all platforms ok
                       $opt{plat} eq $plat  ) ) # specified platform matched
                 {
-                    print( $output $val ? qq|$1.$2.$3:$val\n| : $_ );
+                    print( $output qq|$1.$2.$3:$val\n| );
+                    delete( $message{ $key } );
                     next;
                 }
             }
@@ -201,7 +226,7 @@ sub parser ()
 
         while ( <$stream> )
         {
-            if( /(\S+)\s*=\s?(.*)/ )
+            if( /([^#]\S+)\s*=\s?(.*)/ )
             {
                 my $key = $1;
                 my $val = $2;


commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=9c6e4c7eb5d425d216ad3ccc987a854d904b59cd
commit 9c6e4c7eb5d425d216ad3ccc987a854d904b59cd
Author: Vivek Dasmohapatra <vivek at collabora.co.uk>
Commit: Vincent Sanders <vince at netsurf-browser.org>

    Fix unescaping when importing transifex/java-properties format translations

diff --git a/utils/import-messages.pl b/utils/import-messages.pl
index 1c30e7f..d34165a 100644
--- a/utils/import-messages.pl
+++ b/utils/import-messages.pl
@@ -193,7 +193,7 @@ sub parser ()
 {
     package msgfmt::java;
 
-    sub unescape { $_[0] =~ s/\\([\\':])/$1/g; $_[0] }
+    sub unescape { $_[0] =~ s/\\([^abfnrtv])/$1/g; $_[0] }
     sub parse
     {
         my $cache  = shift();


-----------------------------------------------------------------------

Summary of changes:
 utils/import-messages.pl |   39 ++++++++++++++++++++++++++++++++-------
 1 files changed, 32 insertions(+), 7 deletions(-)

diff --git a/utils/import-messages.pl b/utils/import-messages.pl
index 1c30e7f..4c13a85 100644
--- a/utils/import-messages.pl
+++ b/utils/import-messages.pl
@@ -59,6 +59,8 @@ sub main ()
     my $opt_ok;
     my @input;
     my %message;
+    my $last_key;
+    my $last_plat;
 
     # option parsing:
     Getopt::Long::Configure( GETOPT_OPTS );
@@ -93,11 +95,33 @@ sub main ()
     {
         use bytes;
 
-        if( !/#/     &&
-            !/^\s*$/ &&
-            /^([a-z]{2})\.([^.]+)\.([^:]+):/ )
+        my( $lang, $plat, $key );
+
+        if( /^([a-z]{2})\.([^.]+)\.([^:]+):/ )
         {
-            my( $lang, $plat, $key ) = ( $1, $2, $3 );
+            ( $lang, $plat, $key ) = ( $1, $2, $3 );
+        }
+
+        if( $key || $message{ $last_key } )
+        {
+            #print( $output "## $last_key -> $key\n" );
+            # the key changed but we have a message for it still pending:
+            if( $last_key && $message{ $last_key } && ($key ne $last_key) )
+            {
+                my $plt = $last_plat;
+                my $str = $message{ $last_key };
+                my $msg = qq|$opt{lang}.$last_plat.$last_key:$str\n|;
+
+                print( $output $msg );
+                delete( $message{ $last_key } );
+
+                # if the line following our new translation is not blank,
+                # generate a synthetic group-separator:
+                if( !/^\s*$/ ) { print( $output "\n") }
+            }
+
+            $last_key  = $key;
+            $last_plat = $plat;
 
             if( $lang eq $opt{lang} )
             {
@@ -106,7 +130,8 @@ sub main ()
                     ( $opt{plat} eq 'any' ||   # all platforms ok
                       $opt{plat} eq $plat  ) ) # specified platform matched
                 {
-                    print( $output $val ? qq|$1.$2.$3:$val\n| : $_ );
+                    print( $output qq|$1.$2.$3:$val\n| );
+                    delete( $message{ $key } );
                     next;
                 }
             }
@@ -193,7 +218,7 @@ sub parser ()
 {
     package msgfmt::java;
 
-    sub unescape { $_[0] =~ s/\\([\\':])/$1/g; $_[0] }
+    sub unescape { $_[0] =~ s/\\([^abfnrtv])/$1/g; $_[0] }
     sub parse
     {
         my $cache  = shift();
@@ -201,7 +226,7 @@ sub parser ()
 
         while ( <$stream> )
         {
-            if( /(\S+)\s*=\s?(.*)/ )
+            if( /([^#]\S+)\s*=\s?(.*)/ )
             {
                 my $key = $1;
                 my $val = $2;


-- 
NetSurf Browser



More information about the netsurf-commits mailing list