summaryrefslogtreecommitdiffstats
path: root/po/bin/fixpot
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-06-07 18:54:11 +0000
committerThierry Vignaud <tv@mandriva.org>2007-06-07 18:54:11 +0000
commit534f2f4437093bd78411126ef45de41fc6b93bf3 (patch)
tree1a9c1e259e6f2495ebcacf3cbd8cb7d3fdaaac2a /po/bin/fixpot
parent92072c3be58f5c77ff0fecdaf6617fe6fa4120e1 (diff)
downloadbootloader-theme-534f2f4437093bd78411126ef45de41fc6b93bf3.tar
bootloader-theme-534f2f4437093bd78411126ef45de41fc6b93bf3.tar.gz
bootloader-theme-534f2f4437093bd78411126ef45de41fc6b93bf3.tar.bz2
bootloader-theme-534f2f4437093bd78411126ef45de41fc6b93bf3.tar.xz
bootloader-theme-534f2f4437093bd78411126ef45de41fc6b93bf3.zip
reimport my latest checkout
Diffstat (limited to 'po/bin/fixpot')
-rwxr-xr-xpo/bin/fixpot27
1 files changed, 27 insertions, 0 deletions
diff --git a/po/bin/fixpot b/po/bin/fixpot
new file mode 100755
index 0000000..1ed9665
--- /dev/null
+++ b/po/bin/fixpot
@@ -0,0 +1,27 @@
+#! /usr/bin/perl
+
+while(<>) {
+ if(/^\s*#|^\s*$/) { $msg[$cnt]{comment} .= $_; next }
+ if(s/^\s*msgid\b\s*//) { $cnt++; $id = 1 }
+ if(s/^\s*msgstr\b\s*//) { $id = 2 }
+ if($id == 1) { $msg[$cnt - 1]{id} .= $_; next }
+ if($id == 2) { $msg[$cnt - 1]{str} .= $_; next }
+
+ die "oops at line $.\n";
+}
+
+for (@msg) {
+ print $_->{comment};
+
+ next unless defined($_->{id}) && defined($_->{str});
+
+ if($_->{id} =~ /^\s*""\s*$/ || $_->{str} =~ /^\s*""\s*$/) {
+ print "msgid ", $_->{id};
+ print "msgstr ", $_->{str};
+ }
+ else {
+ print "msgid ", $_->{str};
+ print "msgstr \"\"\n";
+ }
+}
+