summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-07-20 14:22:31 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-07-20 14:22:31 +0000
commit03b8951aa81080eabcd967eb6f1fe3a6fbc6f72a (patch)
tree78dcd324cf86e379c7113a4d24351d5c1bb8b4f4
parent0689e707a304e57e8b2e233567a08535f59edaf5 (diff)
downloaddrakx-backup-do-not-use-03b8951aa81080eabcd967eb6f1fe3a6fbc6f72a.tar
drakx-backup-do-not-use-03b8951aa81080eabcd967eb6f1fe3a6fbc6f72a.tar.gz
drakx-backup-do-not-use-03b8951aa81080eabcd967eb6f1fe3a6fbc6f72a.tar.bz2
drakx-backup-do-not-use-03b8951aa81080eabcd967eb6f1fe3a6fbc6f72a.tar.xz
drakx-backup-do-not-use-03b8951aa81080eabcd967eb6f1fe3a6fbc6f72a.zip
(load_po): enhance readability
-rw-r--r--perl-install/lang.pm15
1 files changed, 8 insertions, 7 deletions
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/;
}