summaryrefslogtreecommitdiff
path: root/kike-extract-messages.sh
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2014-07-14 20:39:01 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2014-07-14 22:15:56 +0200
commitcc4ca46cc3cf447c26bf72fa88268ad970bccbff (patch)
treeabb53a86d7941074e32deff9ae493e8563461ebc /kike-extract-messages.sh
parentb58ee27362ac285e3839ed051f4319118280ad5a (diff)
downloadxK-cc4ca46cc3cf447c26bf72fa88268ad970bccbff.tar.gz
xK-cc4ca46cc3cf447c26bf72fa88268ad970bccbff.tar.xz
xK-cc4ca46cc3cf447c26bf72fa88268ad970bccbff.zip
Add a utility to extract a message catalogs
Diffstat (limited to 'kike-extract-messages.sh')
-rwxr-xr-xkike-extract-messages.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/kike-extract-messages.sh b/kike-extract-messages.sh
new file mode 100755
index 0000000..9438695
--- /dev/null
+++ b/kike-extract-messages.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+LC_ALL=C exec awk '
+ BEGIN {
+ print "$quote \"";
+ print "$set 1";
+ }
+ /^\tIRC_(ERR|RPL)_[A-Z]+ *= *[0-9]+,?$/ {
+ match($3, /^[0-9]+/);
+ id[$1] = substr($3, RSTART, RLENGTH);
+ }
+ /^\t\[IRC_(ERR|RPL)_[A-Z]+\] *= *".*",?$/ {
+ z = substr($1, 2, length($1) - 2);
+ match($0, /".*"/);
+ print id[z] " " substr($0, RSTART, RLENGTH);
+ }'