diff options
author | Guillaume Cottenceau <gc@mandriva.com> | 2002-08-01 17:35:43 +0000 |
---|---|---|
committer | Guillaume Cottenceau <gc@mandriva.com> | 2002-08-01 17:35:43 +0000 |
commit | 36c3056b46649d0f28dd3b49f61ad08e8049548a (patch) | |
tree | 5d5a8e8b6880e3acdbf7349ccf62c4860fc6332c /grpmi/po/fake_c.pl | |
parent | 814cacf5edc5ad3642157a23d6d8cff249644d3a (diff) | |
download | rpmdrake-36c3056b46649d0f28dd3b49f61ad08e8049548a.tar rpmdrake-36c3056b46649d0f28dd3b49f61ad08e8049548a.tar.gz rpmdrake-36c3056b46649d0f28dd3b49f61ad08e8049548a.tar.bz2 rpmdrake-36c3056b46649d0f28dd3b49f61ad08e8049548a.tar.xz rpmdrake-36c3056b46649d0f28dd3b49f61ad08e8049548a.zip |
Initial revisionV2_0topic/RPMDRAKE
Diffstat (limited to 'grpmi/po/fake_c.pl')
-rwxr-xr-x | grpmi/po/fake_c.pl | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/grpmi/po/fake_c.pl b/grpmi/po/fake_c.pl new file mode 100755 index 00000000..21cf25b0 --- /dev/null +++ b/grpmi/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; + $_; +} |