Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
my $ctime = scalar localtime;
my $href = {};
my $ctime = scalar localtime;
my $href = {};
-my $po = new Locale::PO(-msgid=> '',
- -comment=> $header,
- -fuzzy=> 1,
- -msgstr=>
- "Project-Id-Version: $projectId\n" .
- "Report-Msgid-Bugs-To: <support\@proxmox.com>\n" .
- "POT-Creation-Date: $ctime\n" .
- "PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" .
- "Last-Translator: FULL NAME <EMAIL\@ADDRESS>\n" .
- "Language-Team: LANGUAGE <support\@proxmox.com>\n" .
- "MIME-Version: 1.0\n" .
- "Content-Type: text/plain; charset=UTF-8\n" .
- "Content-Transfer-Encoding: 8bit\n");
+my $po = Locale::PO->new(
+ -msgid => '',
+ -comment => $header,
+ -fuzzy => 1,
+ -msgstr => "Project-Id-Version: $projectId\n"
+ ."Report-Msgid-Bugs-To: <support\@proxmox.com>\n"
+ ."POT-Creation-Date: $ctime\n"
+ ."PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n"
+ ."Last-Translator: FULL NAME <EMAIL\@ADDRESS>\n"
+ ."Language-Team: LANGUAGE <support\@proxmox.com>\n"
+ ."MIME-Version: 1.0\n"
+ ."Content-Type: text/plain; charset=UTF-8\n"
+ ."Content-Transfer-Encoding: 8bit\n",
+);
if (my $po = $href->{$text}) {
$po->reference($po->reference() . " $ref");
if (my $po = $href->{$text}) {
$po->reference($po->reference() . " $ref");
- } else {
- my $po = new Locale::PO(-msgid=> $text, -reference=> $ref, -msgstr=> '');
+ } else {
+ my $po = Locale::PO->new(-msgid=> $text, -reference=> $ref, -msgstr=> '');
$href->{$text} = $po;
}
};
$href->{$text} = $po;
}
};
}
foreach my $s (@$sources) {
}
foreach my $s (@$sources) {
- open(SRC, $s) || die "unable to open file '$s' - $!\n";
- while(defined(my $line = <SRC>)) {
+ open(my $SRC_FH, '<', $s) || die "unable to open file '$s' - $!\n";
+ while(defined(my $line = <$SRC_FH>)) {
next if $line =~ m/^\s*function gettext/;
if ($line =~ m/gettext\s*\(/) {
extract_msg($s, $., $line);
}
}
next if $line =~ m/^\s*function gettext/;
if ($line =~ m/gettext\s*\(/) {
extract_msg($s, $., $line);
}
}
}
my $filename = $options->{o} // "messages.pot";
}
my $filename = $options->{o} // "messages.pot";