[Tilesathome] Patch for German Windows installations

Juergen Buchner juebuchner at googlemail.com
Wed Jul 23 21:50:01 BST 2008


Hi,

I have tried to encapsulate the source code modifications for German
Windows users described in

http://wiki.openstreetmap.org/index.php/Tiles%40home/Install_Guide#...with_internationalisation

in a patch. I introduced a new config parameter named "IncscapeLocale"
Users with a "," as decimal separator (e.g. in Germany) can set this
parameter to "german" and Inkscape rendering will work.

It would be great if someone would apply the attached patch.

Kind regards

Jürgen


Index: tilesGen.pl
===================================================================
--- tilesGen.pl	(revision  9263)
+++ tilesGen.pl	(working copy)
@@ -36,6 +36,8 @@
 use English '-no_match_vars';
 use GD qw(:DEFAULT :cmp);
 use AppConfig qw(:argcount);
+use locale;
+use POSIX qw(locale_h);

 #---------------------------------

@@ -1616,6 +1618,12 @@
     }
     else
     {
+        my $locale = $Config->get("IncscapeLocale");
+        my $oldLocale;
+        if ($locale ne "0") {
+          $oldLocale=setlocale(LC_ALL, $locale);
+        }
+		
         $Cmd = sprintf("%s%s \"%s\" -z -w %d -h %d
--export-area=%f:%f:%f:%f --export-png=\"%s\" \"%s%s\" > %s",
         $Config->get("i18n") ? "LC_ALL=C " : "",
         $Config->get("Niceness"),
@@ -1627,6 +1635,11 @@
         $Config->get("WorkingDirectory"),
         $svgFile,
         $stdOut);
+
+        if ($locale ne "0") {
+          setlocale(LC_ALL, $oldLocale);
+        }
+
     }

     # stop rendering the current job when inkscape fails
Index: tilesAtHome.conf.windows
===================================================================
--- tilesAtHome.conf.windows	(revision 9263)
+++ tilesAtHome.conf.windows	(working copy)
@@ -25,6 +25,10 @@
 # Set the timeout when downloading files (on tenths of a second)
 DownloadTimeout=1800

+## Uncomment this for Windows installations in environments
+# with "," as decimal separator
+# InkscapeLocale = german
+
 # Fall back to XAPI in case we get a "no data here" error.
 # assumes XAPI is current enough for rendering
 # (tests show 8 minutes lag, which is very much OK, so this is the default)
Index: config.defaults
===================================================================
--- config.defaults	(revision 9263)
+++ config.defaults	(working copy)
@@ -32,6 +32,7 @@
 Osmarender = XSLT

 Inkscape = inkscape
+IncscapeLocale = 0

 BatikPath = /usr/share/batik-1.6/lib/batik-rasterizer.jar
 BatikJVMSize = 1536M




More information about the Tilesathome mailing list