Index: applications/editors/josm/i18n/convpreset.pl
===================================================================
--- applications/editors/josm/i18n/convpreset.pl	(revision 13391)
+++ applications/editors/josm/i18n/convpreset.pl	(revision 13392)
@@ -13,4 +13,8 @@
 # but it works with a default Perl installation
 
+# Print a header to write valid Java code.  No line break,
+# so that the input and output line numbers will match.
+print "class trans_preset { void tr(String s){} void f() {";
+
 while(my $line = <>)
 {
@@ -18,5 +22,5 @@
   if($line =~ /<item\s+name=(".*?")/)
   {
-    print "tr($1) /* item $item */\n";
+    print "tr($1); /* item $item */\n";
     $item = $group ? "$group$1" : $1;
     $item =~ s/""/\//;
@@ -25,5 +29,5 @@
   {
     $group = $1;
-    print "tr($1) /* group $group */\n";
+    print "tr($1); /* group $group */\n";
   }
   elsif($line =~ /<label\s+text=" "/)
@@ -33,15 +37,15 @@
   elsif($line =~ /<label\s+text=(".*?")/)
   {
-    print "tr($1) /* item $item label $1 */\n";
+    print "tr($1); /* item $item label $1 */\n";
   }
   elsif($line =~ /<text.*text=(".*?")/)
   {
     my $n = $1;
-    print "tr($n) /* item $item text $n */\n";
+    print "tr($n); /* item $item text $n */\n";
   }
   elsif($line =~ /<check.*text=(".*?")/)
   {
     my $n = $1;
-    print "tr($n) /* item $item check $n */\n";
+    print "tr($n); /* item $item check $n */\n";
   }
   # first handle display values
@@ -49,9 +53,9 @@
   {
     my ($n,$vals) = ($1,$2);
-    print "tr($n) /* item $item combo $n */";
+    print "tr($n); /* item $item combo $n */";
     foreach my $val (split ",",$vals)
     {
       next if $val =~ /^[0-9-]+$/; # search for non-numbers
-      print " tr(\"$val\")";
+      print " tr(\"$val\");";
     }
     print "\n";
@@ -60,9 +64,9 @@
   {
     my ($n,$vals) = ($1,$2);
-    print "tr($n) /* item $item combo $n */";
+    print "tr($n); /* item $item combo $n */";
     foreach my $val (split ",",$vals)
     {
       next if $val =~ /^[0-9-]+$/; # search for non-numbers
-      print " tr(\"$val\")";
+      print " tr(\"$val\");";
     }
     print "\n";
@@ -100,2 +104,4 @@
   $comment = 0 if($line =~ /-->/);
 }
+
+print "}}\n";
Index: applications/editors/josm/i18n/convstyle.pl
===================================================================
--- applications/editors/josm/i18n/convstyle.pl	(revision 13391)
+++ applications/editors/josm/i18n/convstyle.pl	(revision 13392)
@@ -9,4 +9,8 @@
 # but it works with a default Perl installation
 
+# Print a header to write valid Java code.  No line break,
+# so that the input and output line numbers will match.
+print "class trans_style { void tr(String s){} void f() {";
+
 while(my $line = <>)
 {
@@ -14,9 +18,9 @@
   if($line =~ /<rules\s+name=(".*?")/)
   {
-    print "tr($1) /* mappaint style named $1 */\n";
+    print "tr($1); /* mappaint style named $1 */\n";
   }
   elsif($line =~ /colour="([^"]+)#/)
   {
-    print "tr(\"$1\") /* color $1 */\n";
+    print "tr(\"$1\"); /* color $1 */\n";
   }
   else
@@ -25,2 +29,4 @@
   }
 }
+
+print "}}\n";
Index: applications/editors/josm/i18n/convsurveyor.pl
===================================================================
--- applications/editors/josm/i18n/convsurveyor.pl	(revision 13391)
+++ applications/editors/josm/i18n/convsurveyor.pl	(revision 13392)
@@ -11,4 +11,8 @@
 # This is a simple conversion and in no way a complete XML parser
 # but it works with a default Perl installation
+
+# Print a header to write valid Java code.  No line break,
+# so that the input and output line numbers will match.
+print "class trans_surveyor { void tr(String s){} void f() {";
 
 while(my $line = <>)
@@ -25,5 +29,5 @@
   elsif($line =~ /<button label=\"(.*?)\"/)
   {
-    print "tr(\"$1\") // $_\n";
+    print "tr(\"$1\"); // $line\n";
   }
   else
@@ -32,2 +36,4 @@
   }
 }
+
+print "}}\n";
Index: applications/editors/josm/i18n/convvalidator.pl
===================================================================
--- applications/editors/josm/i18n/convvalidator.pl	(revision 13391)
+++ applications/editors/josm/i18n/convvalidator.pl	(revision 13392)
@@ -11,4 +11,8 @@
 # This is a simple conversion and in no way a complete XML parser
 # but it works with a default Perl installation
+
+# Print a header to write valid Java code.  No line break,
+# so that the input and output line numbers will match.
+print "class trans_validator { void tr(String s){} void f() {";
 
 while(my $line = <>)
@@ -25,5 +29,5 @@
   elsif($line =~ /(.*) *# *(.*) *$/)
   {
-    print "tr(\"$2\") // $1\n";
+    print "tr(\"$2\"); // $1\n";
   }
   else
@@ -32,2 +36,4 @@
   }
 }
+
+print "}}\n";
Index: applications/editors/josm/i18n/convwms.pl
===================================================================
--- applications/editors/josm/i18n/convwms.pl	(revision 13391)
+++ applications/editors/josm/i18n/convwms.pl	(revision 13392)
@@ -11,4 +11,8 @@
 # This is a simple conversion and in no way a complete XML parser
 # but it works with a default Perl installation
+
+# Print a header to write valid Java code.  No line break,
+# so that the input and output line numbers will match.
+print "class trans_wms { void tr(String s){} void f() {";
 
 while(my $line = <>)
@@ -25,5 +29,5 @@
   elsif($line =~ /^(.*?);(.*?);(.*)$/)
   {
-    print "tr(\"$2\") // $3\n";
+    print "tr(\"$2\"); // $3\n";
   }
   else
@@ -32,2 +36,4 @@
   }
 }
+
+print "}}\n";
