summaryrefslogtreecommitdiffstats
path: root/perl-install/lang.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-09-23 00:38:28 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-09-23 00:38:28 +0000
commit37860db32a298e81d107848c7021f39427ff2e29 (patch)
treeaca56a7afe2ac47312f7d69037dd2be7fe5da32a /perl-install/lang.pm
parenta2d6666a3797ac9d980855cc8a28cf9a6466a78c (diff)
downloaddrakx-37860db32a298e81d107848c7021f39427ff2e29.tar
drakx-37860db32a298e81d107848c7021f39427ff2e29.tar.gz
drakx-37860db32a298e81d107848c7021f39427ff2e29.tar.bz2
drakx-37860db32a298e81d107848c7021f39427ff2e29.tar.xz
drakx-37860db32a298e81d107848c7021f39427ff2e29.zip
no_comment
Diffstat (limited to 'perl-install/lang.pm')
-rw-r--r--perl-install/lang.pm28
1 files changed, 28 insertions, 0 deletions
diff --git a/perl-install/lang.pm b/perl-install/lang.pm
index ee6931fae..8d7465729 100644
--- a/perl-install/lang.pm
+++ b/perl-install/lang.pm
@@ -172,6 +172,34 @@ sub write {
}
}
+sub load_po($) {
+ my ($lang) = @_;
+ my ($s, $from, $to, $state);
+
+ $s .= "package po::I18N;\n";
+ $s .= "\%$lang = (";
+
+ my $f; -e ($f = "$_/po/$lang.po") and last foreach @INC;
+ local *F; open F, $f or return;
+ foreach (<F>) {
+ /^msgstr/ and $state = 1;
+ /^msgid/ and $state = 2;
+
+ if (/^(#|$)/ && $state != 3) {
+ $state = 3;
+ $s .= qq("$from" => "$to",\n) if $from;
+ $from = $to = '';
+ }
+ $to .= (/"(.*)"/)[0] if $state == 1;
+ $from .= (/"(.*)"/)[0] if $state == 2;
+ }
+ $s .= ");";
+ no strict "vars";
+ eval $s;
+ !$@;
+}
+
+
#-sub load_font {
#- my ($charset) = @_;
#- my $fontFile = "lat0-sun16";