2 # gettext message substitute
9 $charset_code = "WC_CES_UTF_8";
10 open(PO, "$po_dir/$lang.po") or die "cannot open $po_dir/$lang.po, $!";
12 if (/^msgid\s*"(.*)"/) {
16 if (/^msgstr\s*"(.*)"/) {
20 if (/^"Content-Type: text\/plain; charset=(.*)\\n"/) {
26 open(CL, "charset-list") or die "cannot open charset-list, $!";
29 if ($l[0] eq $charset) {
30 $charset_code = $l[1];
36 @src = grep {/\.c$/} @ARGV;
39 open(SRC0, $src) or die "cannot open $src, $!";
41 open(SRC1, ">.$src") or die "cannot create .$src, $!";
43 s/^static\s*wc_ces\s*(\S+)\s*=\s*(WC_CES_\S+)\s*;\s*\/\*\s*FIXME: charset of source code \*\//static wc_ces $1 = $charset_code; \/* FIXME: charset of source code *\//;
44 s/(N?_\(")([^"]*)("\))/$1 . ($msg{$2} || $2) . $3/ge;
51 map {s/(.*\.c)$/.$1/} @ARGV;