]> git.sesse.net Git - ttk-gettext/blobdiff - make-pot.pl
Add all the files.
[ttk-gettext] / make-pot.pl
diff --git a/make-pot.pl b/make-pot.pl
new file mode 100644 (file)
index 0000000..7a9a4b4
--- /dev/null
@@ -0,0 +1,26 @@
+#! /usr/bin/perl
+use Template;
+require 'Sesse::ExtractGettext.pm';
+
+my $template = Template->new({ FACTORY => 'Sesse::ExtractGettext' });
+my $date = `date +"%Y-%M-%d %H:%M%z"`;   # pah :-)
+chomp $date;
+
+print <<"EOF";
+# template file for $ARGV[0]
+msgid ""
+msgstr ""
+"Project-Id-Version: myproject\\n"
+"Report-Msgid-Bugs-To: \\n"
+"POT-Creation-Date: $date\\n"
+"MIME-Version: 1.0\\n"
+"Content-Type: text/plain; charset=utf-8\\n"
+"Content-Transfer-Encoding: 8bit\\n"
+
+EOF
+
+my $eaten = '';
+$template->process($ARGV[0], { page => 'templates/index.tmpl' }, \$eaten)
+       or die $template->error();    # errors don't really matter, but OK
+
+print "# eof\n";