]> git.proxmox.com Git - proxmox-i18n.git/blobdiff - po2js.pl
bump version to 3.1.0
[proxmox-i18n.git] / po2js.pl
index f4060aada61546a28653ea634ea868cc077cbc37..ee5bbd14a7f5a270270ead6850c7ee7c8879c8ad 100755 (executable)
--- a/po2js.pl
+++ b/po2js.pl
@@ -2,19 +2,18 @@
 
 use strict;
 use warnings;
-use Getopt::Std;
-use Locale::PO;
-use JSON;
+
 use Encode;
+use Getopt::Long;
+use JSON;
+use Locale::PO;
 
 # current limits:
 # - we do not support plural. forms
 # - no message content support
 
 my $options = {};
-
-getopts('t:o:v:', $options) ||
-    die "unable to parse options\n";
+GetOptions($options, 't=s', 'o=s', 'v=s') or die "unable to parse options\n";
 
 die "no files specified\n" if !scalar(@ARGV);
 
@@ -88,7 +87,8 @@ foreach my $filename (@ARGV) {
 
 my $json = to_json($catalog, {canonical => 1, utf8 => 1});
 
-my $content = "// $options->{v}\n"; # write version to beginning
+my $version = $options->{v} // ("dev-build " . localtime());
+my $content = "// $version\n"; # write version to the beginning to better avoid stale cache
 
 my $outfile = $options->{o};