[GRASS-dev] Re: [GRASS GIS] #1349: Ps.map supports only english
GRASS GIS
trac at osgeo.org
Wed Apr 20 02:55:46 EDT 2011
#1349: Ps.map supports only english
-------------------------+--------------------------------------------------
Reporter: annakrat | Owner: grass-dev@…
Type: enhancement | Status: new
Priority: minor | Milestone: 6.5.0
Component: Ps.map | Version: unspecified
Keywords: encoding | Platform: Unspecified
Cpu: Unspecified |
-------------------------+--------------------------------------------------
Comment(by hamish):
Replying to [ticket:1349 annakrat]:
> Postscript file generated by ps.map uses Latin1 and as a result
> I can't use czech language properly. I have no experience with
> postscript, so would it be possible to change it to utf8?
from the help page:
{{{
For users wanting to use special characters (such as accented char-
acters) it is important to note that ps.map uses ISO-8859-1 encod-
ing. This means that your instructions file will have to be
encoded in this encoding. If you normally work in a different
encoding environment (such as UTF-8), you have to transform your
file to the ISO-8859-1 encoding, for example by using the iconv
utility:
iconv -f UTF-8 -t ISO_8859-1 utf_file > iso_file
}}}
from the mailing list archive:
http://thread.gmane.org/gmane.comp.gis.grass.devel/15881
> Another issue relating to other languages is the label of
> scalebar units. It would be nice if the user could customize
> the label.
do you wish to have a translated version of one of the existing distance
formats, or to use one not on the current list?
I'd rather have it start from a fixed list of names+conv_to_meter values,
but translated names of units is possible:
{{{
Index: ps/ps.map/do_scalebar.c
===================================================================
--- ps/ps.map/do_scalebar.c (revision 46046)
+++ ps/ps.map/do_scalebar.c (working copy)
@@ -1,9 +1,8 @@
-/* Function to draw scalebar on page
- * **
- */
+/* Function to draw scalebar on page */
#include <string.h>
#include <math.h>
+#include <grass/glocale.h>
#include "local_proto.h"
#include "distance.h"
@@ -192,15 +191,15 @@
if (sb.units == SB_UNITS_AUTO)
strcpy(num, G_database_unit_name(TRUE));
else if(sb.units == SB_UNITS_METERS)
- strcpy(num, "meters");
+ strcpy(num, _("meters"));
else if(sb.units == SB_UNITS_KM)
- strcpy(num, "kilometers");
+ strcpy(num, _("kilometers"));
else if(sb.units == SB_UNITS_FEET)
- strcpy(num, "feet");
+ strcpy(num, _("feet"));
else if(sb.units == SB_UNITS_MILES)
- strcpy(num, "miles");
+ strcpy(num, _("miles"));
else if(sb.units == SB_UNITS_NMILES)
- strcpy(num, "nautical miles");
+ strcpy(num, _("nautical miles"));
text_box_path(72.0 * (x + length/2), 72.0 * (PS.page_height - (sb.y +
0.075)),
CENTER, UPPER, num, sb.fontsize, 0);
}}}
I don't think I bothered with that last time, beyond discussing if meters
vs. metres should be taken from 'g.proj -p'. I'm totally ignorant how and
if those unit names are called in non-latin languages so didn't take it
further.
In general I'm not much of a fan of hard-results depending on the locale
setting (harms ability to rely on reproducible results), but the above
patch seems reasonable enough to me.
does it solve the wish?
Hamish
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1349#comment:1>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list