From 03b8951aa81080eabcd967eb6f1fe3a6fbc6f72a Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 20 Jul 2001 14:22:31 +0000 Subject: (load_po): enhance readability --- perl-install/lang.pm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'perl-install') diff --git a/perl-install/lang.pm b/perl-install/lang.pm index 92b653548..6882f9bba 100644 --- a/perl-install/lang.pm +++ b/perl-install/lang.pm @@ -435,12 +435,13 @@ sub load_po { } local $_; while (<$F>) { - /^msgstr/ and $state = 1; - /^msgid/ && !$fuzzy and $state = 2; + /^msgstr/ and $state = 'msgstr'; + /^msgid/ && !$fuzzy and $state = 'msgid'; s/@/\\@/g; - if (/^(#|$)/ && $state != 3) { - $state = 3; + if (/^(#|$)/ && $state != 'between') { + $state = 'between'; + $to = c::iconv($to, $lang::charset, c::standard_charset()); if (my @l = $to =~ /%(\d+)\$/g) { $to =~ s/%(\d+)\$/%/g; $to = qq([ "$to", ) . join(",", map { $_ - 1 } @l) . " ],"; @@ -448,14 +449,14 @@ sub load_po { $to = qq("$to"); } if ($from) { - $s .= qq("$from" => ) . c::iconv($to, $lang::charset, c::standard_charset()) . ",\n"; + $s .= qq("$from" => $to,\n); } elsif ($to =~ /charset=([\w-]+)/) { $lang::charset = $1; } $from = $to = ''; } - $to .= (/"(.*)"/)[0] if $state == 1; - $from .= (/"(.*)"/)[0] if $state == 2; + $to .= (/"(.*)"/)[0] if $state == 'msgstr'; + $from .= (/"(.*)"/)[0] if $state == 'msgid'; $fuzzy = /^#, fuzzy/; } -- cgit v1.2.1