Last change
on this file since 28384 was 23091, checked in by stoecker, 14 years ago |
fix order of comments for better translators support
|
File size:
704 bytes
|
Rev | Line | |
---|
[13140] | 1 | #! /usr/bin/perl -w
|
---|
| 2 |
|
---|
| 3 | # Written by Dirk Stöcker <openstreetmap@dstoecker.de>
|
---|
| 4 | # Public domain, no rights reserved.
|
---|
| 5 |
|
---|
| 6 | use strict;
|
---|
| 7 |
|
---|
| 8 | # This is a simple conversion and in no way a complete XML parser
|
---|
| 9 | # but it works with a default Perl installation
|
---|
| 10 |
|
---|
[13392] | 11 | # Print a header to write valid Java code. No line break,
|
---|
| 12 | # so that the input and output line numbers will match.
|
---|
| 13 | print "class trans_style { void tr(String s){} void f() {";
|
---|
| 14 |
|
---|
[13140] | 15 | while(my $line = <>)
|
---|
| 16 | {
|
---|
| 17 | chomp($line);
|
---|
| 18 | if($line =~ /<rules\s+name=(".*?")/)
|
---|
| 19 | {
|
---|
[23091] | 20 | print "/* mappaint style named $1 */ tr($1);\n";
|
---|
[13140] | 21 | }
|
---|
[13385] | 22 | elsif($line =~ /colour="([^"]+)#/)
|
---|
[13140] | 23 | {
|
---|
[23091] | 24 | print "/* color $1 */ tr(\"$1\");\n";
|
---|
[13140] | 25 | }
|
---|
| 26 | else
|
---|
| 27 | {
|
---|
| 28 | print "/* $line */\n";
|
---|
| 29 | }
|
---|
| 30 | }
|
---|
[13392] | 31 |
|
---|
| 32 | print "}}\n";
|
---|
Note:
See
TracBrowser
for help on using the repository browser.