summaryrefslogtreecommitdiffstats
path: root/perl-install/share/po/fake_c.pl
blob: 86146bdafd546ae37b1e1407641f6d74dbb481b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/perl -lp

s|_\(\[(.*),\s*(.*),\s*(.*)\]| ngettext($2,$3,$1)|; # special plural form handling

s|^(__?\()| $1|;		# add a blank at the beginning (?!)
s,\Qs/#.*//,,;			# ugly special case
s|//|/""/|g;			# ensure // or not understood as comments

s,(^|[^\$])#([^+].*),\1/*\2*/,; # rewrite comments to C format except for:
                                # - ``#+ xxx'' comments which are kept
                                # - ``$#xxx'' which are not comments

s|$|\\n\\|;			# multi-line strings not handled in C