Fwd: [GRASS-dev] Scripting in Linux

Kim Besson kimbesson1981 at gmail.com
Thu Jan 28 05:43:49 EST 2010


Hello all

Ok I have configured and compiled with -nls with the latest SVN6.4 snapshot.
I defined LANG and LANGUAGE in init.sh.
my grasswxpy seems to be working but I thing my grassmods is not being read
since no script/module is being translated.

I got the following warning in my terminal window:

(process:2783): Gdk-WARNING **: locale not supported by C library

(process:2783): Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale.


Do anyone knows what might be happening?

Thank you so much
Kim

2010/1/27 Glynn Clements <glynn at gclements.plus.com>

>
> Kim Besson wrote:
>
> > This might have something to do with a few messages related with
> i.tasscap
> > translation.
> >
> > Ok (I have tested this at my WinGRASS installation due to limit access to
> my
> > LINUX machine):
> > 1- I downloaded grassmods_es.po file (the first language where I want to
> > have my NDVI calculator available). Other will be Brazilian and of course
> > English (already available in the Script code).
> > 2- Just like Glynn said, At the po file header is some
> > information: "Content-Type: text/plain; charset=ISO-8859-1\n"
> > 3- At grassmods.mo the following was there:
> > #: ../locale/scriptstrings/i.tasscap_to_translate.c:1
> > msgid "Tasseled Cap (Kauth Thomas) transformation for LANDSAT-TM data"
> > msgstr "Transformación Tasseled Cap (Kauth Thomas) para datos LANDSAT-TM"
> > 4- using po Editor I created mo files and renamed and put them in
> > location/es/LC_Messages
> > 4- I added the following to my Init.bat
> > set LANGUAGE=es_ES
> > set LANG=es_ES
> > set LC_ALL=es_ES
> > 5- I Started GRASS and realize that:
> > - GUI is in spanish (bueno :) buttons, text in status bar in the bottom;
> > menu
> > - But i.tasscap and neither other scripts are translated even If I have
> them
> > in my mo file.
> > 6- I decided to compare the type of files I mean, wxpython_es.po that is
> > working againts grassmods_es.po that isn't.
>
> Ensure that GRASS was configured with the --with-nls flag, otherwise
> it won't use translations. The wxPython GUI will use translations
> regardless of how GRASS was configured.
>
> > Conclusions: The one that is working is  UTF-8
> > and Content-Transfer-Encoding: 8bit\n and the other one
> > is charset=ISO-8859-1.
> >
> > Is this the problem? If it's how can we contour this problem, I mean use
> > special characters? (I also experiment with De and it also didnt' work).
>
> The encoding of the .po file isn't "visible" to the code which uses
> the translations. The .mo file will always contain UTF-8 text, but
> this is automatically converted to the locale's encoding when the
> translation is retrieved.
>
> In 6.4, there is (or was?) a known bug with the GUI and non-UTF-8
> locales: the GUI converts the text from the locale's encoding to
> UTF-8, but leaves the original encoding in the XML header, which can
> confuse the XML parser. But this depends upon the locale's encoding,
> not the encoding of the .po file.
>
> --
> Glynn Clements <glynn at gclements.plus.com>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-dev/attachments/20100128/5d70b10c/attachment-0001.html


More information about the grass-dev mailing list