diff options
author | Pablo Saratxaga <pablo@mandriva.com> | 2002-08-23 00:50:14 +0000 |
---|---|---|
committer | Pablo Saratxaga <pablo@mandriva.com> | 2002-08-23 00:50:14 +0000 |
commit | 584d2eca1f6fe74be87c371d99a713176965f9f9 (patch) | |
tree | 225c49c0656057e01c92a9dd7340c64120e62e4f /po/fake_c.pl | |
parent | 8cb296dff1704b8b7247ebe8635a54e8336edb58 (diff) | |
download | drakwizard-584d2eca1f6fe74be87c371d99a713176965f9f9.tar drakwizard-584d2eca1f6fe74be87c371d99a713176965f9f9.tar.gz drakwizard-584d2eca1f6fe74be87c371d99a713176965f9f9.tar.bz2 drakwizard-584d2eca1f6fe74be87c371d99a713176965f9f9.tar.xz drakwizard-584d2eca1f6fe74be87c371d99a713176965f9f9.zip |
copied fake_c.pl from other modules, and converted wiz2pot into
wiz2fake_c; so now the pot file can be easily rebuild to match the
source files.
Diffstat (limited to 'po/fake_c.pl')
-rwxr-xr-x | po/fake_c.pl | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/po/fake_c.pl b/po/fake_c.pl new file mode 100755 index 00000000..21cf25b0 --- /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; + $_; +} |