aboutsummaryrefslogtreecommitdiffstats
path: root/po/fake_c.pl
diff options
context:
space:
mode:
authorDaouda Lo <daouda@mandriva.com>2003-04-25 07:12:14 +0000
committerDaouda Lo <daouda@mandriva.com>2003-04-25 07:12:14 +0000
commitb6f2e2b9a618eddd377712619df68ccdfd887255 (patch)
tree5bb8cabf2bde030d059738e29435fe73b7994457 /po/fake_c.pl
parentba4716f3ca29f4d0dd7bd7e4c0416374c32850c9 (diff)
downloaduserdrake-b6f2e2b9a618eddd377712619df68ccdfd887255.tar
userdrake-b6f2e2b9a618eddd377712619df68ccdfd887255.tar.gz
userdrake-b6f2e2b9a618eddd377712619df68ccdfd887255.tar.bz2
userdrake-b6f2e2b9a618eddd377712619df68ccdfd887255.tar.xz
userdrake-b6f2e2b9a618eddd377712619df68ccdfd887255.zip
- add po stuffs
Diffstat (limited to 'po/fake_c.pl')
-rwxr-xr-xpo/fake_c.pl22
1 files changed, 22 insertions, 0 deletions
diff --git a/po/fake_c.pl b/po/fake_c.pl
new file mode 100755
index 0000000..21cf25b
--- /dev/null
+++ b/po/fake_c.pl
@@ -0,0 +1,22 @@
+#!/usr/bin/perl -lp
+
+s|^(__?\()| $1|; # add a blank at the beginning (?!)
+
+s|_\(\[(.*),\s*(.*),\s*(.*)\]|ngettext($2,$3,$1)|; # special plural form handling
+
+s,\Qs/#.*//,,; # ugly special case
+
+s,(^|[^\$])#([^+].*),"$1/*" . simpl($2) . "*/",e;
+ # rewrite comments to C format except for:
+ # - ``#+ xxx'' comments which are kept
+ # - ``$#xxx'' which are not comments
+
+s|//|/""/|g; # ensure // or not understood as comments
+
+s|$|\\n\\|; # multi-line strings not handled in C
+
+sub simpl {
+ local $_ = $_[0];
+ s,\*/,,g;
+ $_;
+}