xml2h.pl 301 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
open(FILE, $ARGV[0]);
open(HEADER, ">$ARGV[0].h");

print HEADER "//Dummy header file used for translation generation...\n";
print HEADER "#define DUMMY {\n";

for (<FILE>) {
	if ($_ =~ /name=\"(.*?)\"/) {
		print HEADER "printf(_(\"$1\"));\n";
	}
}

print HEADER  "}\n";

close(HEADER);
close(FILE);