X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=po2js.pl;h=f4060aada61546a28653ea634ea868cc077cbc37;hb=e0daa35be67fc5e579c2ebd84f615dc22a8df59c;hp=8a00e6c2c871993c4e55712f56f140888ca4888c;hpb=4a189d3c169f23e4017a890be29d4c9862953a3c;p=proxmox-i18n.git diff --git a/po2js.pl b/po2js.pl index 8a00e6c..f4060aa 100755 --- a/po2js.pl +++ b/po2js.pl @@ -13,7 +13,7 @@ use Encode; my $options = {}; -getopts('o:', $options) || +getopts('t:o:v:', $options) || die "unable to parse options\n"; die "no files specified\n" if !scalar(@ARGV); @@ -59,6 +59,13 @@ foreach my $filename (@ARGV) { my $po = $href->{$k}; next if $po->fuzzy(); # skip fuzzy entries my $ref = $po->reference(); + + # skip unused entries + next if !$ref; + + # skip entries if t is defined (pve/pmg) and the string is + # not used there or in the widget toolkit + next if $options->{t} && $ref !~ m/($options->{t}|proxmox)\-/; my $qmsgid = decode($charset, $po->msgid); my $msgid = $po->dequote($qmsgid); @@ -81,7 +88,7 @@ foreach my $filename (@ARGV) { my $json = to_json($catalog, {canonical => 1, utf8 => 1}); -my $content = ''; +my $content = "// $options->{v}\n"; # write version to beginning my $outfile = $options->{o};