Show
Ignore:
Timestamp:
03/12/09 09:11:52 (9 months ago)
Author:
fumiakiy
Message:

Merged sockfish to trunk. "svn merge -r3114:3527 http://code.sixapart.com/svn/movabletype/branches/sockfish/ ."

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/build/l10n/trans.pl

    r1174 r3531  
    11#!/usr/bin/perl 
    22 
    3 # Movable Type (r) Open Source (C) 2005-2008 Six Apart, Ltd. 
     3# Movable Type (r) Open Source (C) 2005-2009 Six Apart, Ltd. 
    44# This program is distributed under the terms of the 
    55# GNU General Public License, version 2. 
     
    207207            } 
    208208        } 
    209         if ($tmpl =~ /\.yaml$/) { 
     209        if ($tmpl =~ /(services|streams)\.yaml$/) { 
     210            while ($text =~ /\s*(?:description|ident_hint|label|name):\s*(.+)/g) {  
     211                my($msg, %args); 
     212                my $trans = ''; 
     213                $args{phrase} = $1; 
     214                $args{phrase} =~ s/(^'+|'+$)//; 
     215                $args{phrase} =~ s/'/\\'/g; 
     216                if ($trans eq '' && $conv{$args{phrase}}) { 
     217                     $trans = $conv{$args{phrase}}; 
     218                     $is_used{$args{phrase}} = 1; 
     219                } 
     220                $trans =~ s/([^\\]?)'/$1\\'/g; 
     221                next if ($phrase{$args{phrase}}); 
     222                $phrase{$args{phrase}} = 1; 
     223                my $q = "'"; 
     224                if ($args{phrase} =~ /\\n/) { 
     225                   $q = '"'; 
     226                } 
     227                if ($trans) { 
     228                    printf "\t$q%s$q => '%s',\n", $args{phrase}, $trans; # Print out the translation if there was an existing one 
     229                } else { 
     230                    $trans = $lconv{lc $args{phrase}} || ''; 
     231                    my $reason = $trans ? "Case" : "New"; # New translation, or just different case? 
     232                    printf "\t$q%s$q => '%s', # Translate - $reason\n", $args{phrase}, $trans; # Print out the translation if there was an existing one based on the lowercase string, else empty 
     233                } 
     234            } 
     235        } 
     236        elsif ($tmpl =~ /\.yaml$/) { 
    210237            while ($text =~ /\s*label:\s*(.+)/g) {  
    211238                my($msg, %args); 
    212239                my $trans = ''; 
    213240                $args{phrase} = $1; 
     241                $args{phrase} =~ s/(^'+|'+$)//; 
    214242                $args{phrase} =~ s/'/\\'/g; 
    215243                if ($trans eq '' && $conv{$args{phrase}}) {