I want to set GRASS LANGUAGE in a LINUX installation. In Windows is quite
easy, just add the following in .../etc/init.bat:
set LANGUAGE=es_ES
set LANG=es_ES
set LC_ALL=es_ES
And in LINUX, how is it done? Just add the same text in .../etc/init.sh and
it's finished or do I have to do something to this file?
These would normally be set in e.g. ~/.profile (or ~/.bash_profile
etc; there are quite a lot of files which may be read by the shell)
then inherited by all processes.
Setting environment variables in Unix is done with e.g.:
LANG=es_ES
export LANG
I'd advise against using LC_ALL, as it overrides LC_NUMERIC. This can
cause numbers to use a comma as the decimal separator, which is
problematic when writing files (most file formats require a period).
GRASS modules only use the LC_MESSAGES category directly, but some
programs and (especially) scripts invoke external programs which may
be affected by the LC_NUMERIC or LC_ALL settings (scripts which use
awk are prone to this, although I think that we have now found them
all and forced LC_NUMERIC=C).
I want to set GRASS LANGUAGE in a LINUX installation. In Windows is quite
easy, just add the following in …/etc/init.bat:
set LANGUAGE=es_ES
set LANG=es_ES
set LC_ALL=es_ES
And in LINUX, how is it done? Just add the same text in …/etc/init.sh and
it’s finished or do I have to do something to this file?
These would normally be set in e.g. ~/.profile (or ~/.bash_profile
etc; there are quite a lot of files which may be read by the shell)
then inherited by all processes.
Setting environment variables in Unix is done with e.g.:
LANG=es_ES
export LANG
I’d advise against using LC_ALL, as it overrides LC_NUMERIC. This can
cause numbers to use a comma as the decimal separator, which is
problematic when writing files (most file formats require a period).
GRASS modules only use the LC_MESSAGES category directly, but some
programs and (especially) scripts invoke external programs which may
be affected by the LC_NUMERIC or LC_ALL settings (scripts which use
awk are prone to this, although I think that we have now found them
all and forced LC_NUMERIC=C).
I tryed to add LANG=es_ES LANGUAGE=es_ES to
my /usr/local/grass-6.4.0svn/etc/init.sh and I got the following at my
terminal window:
(process:2196): Gdk-WARNING **: locale not supported by C library
(process:2196): Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale.
What it might be?
This suggests that you don't have the necessary locale files
installed; look in /usr/share/i18n/locales. Some distributions only
support UTF-8 locales, in which case you may need to use es_ES.UTF-8.
By the way, How can I have 2 language sets I mean 2 different launchers with
2 different languages?
Launchers?
Generally, the locale is set on a per-user basis. If you want to set
the locale for individual processes, you have to set LANG/LC_*
yourself, e.g. providing a script which sets the variables before
invoking the application.
Ok…
At /usr/share/i18n/locales/ I have several Files so that might not be the problem. Or is it? (Now I’m a bit lost in this locations vs Translations).
Generally, the locale is set on a per-user basis. If you want to set
the locale for individual processes, you have to set LANG/LC_*
yourself, e.g. providing a script which sets the variables before
invoking the application.
So I can have a script that, as example, reads third parameter (grass64 -wxpython ES_es) and set the LANGUAGE as Spanish?
Thank you
I tryed to add LANG=es_ES LANGUAGE=es_ES to
my /usr/local/grass-6.4.0svn/etc/init.sh and I got the following at my
terminal window:
(process:2196): Gdk-WARNING **: locale not supported by C library
(process:2196): Gtk-WARNING **: Locale not supported by C library.
Using the fallback ‘C’ locale.
What it might be?
This suggests that you don’t have the necessary locale files
installed; look in /usr/share/i18n/locales. Some distributions only
support UTF-8 locales, in which case you may need to use es_ES.UTF-8.
By the way, How can I have 2 language sets I mean 2 different launchers with
2 different languages?
Launchers?
Generally, the locale is set on a per-user basis. If you want to set
the locale for individual processes, you have to set LANG/LC_*
yourself, e.g. providing a script which sets the variables before
invoking the application.
At /usr/share/i18n/locales/ I have several Files so that might not be the
problem. Or is it? (Now I'm a bit lost in this locations vs Translations).
There's more to it than that. Typically, the files in
/usr/share/i18n/locales are source files, which are compiled with
localedef to generate /usr/lib/locale/locale-archive. You can use
"localedef --list-archive" to list which locales are defined in the
archive.
That defines everything *except* for translations: text encoding,
numeric format, date format, monetary format, collation rules, etc.
Translations are handled separately, as each application has its own
messages catalogues. But even if an application has a message
catalogue for a particular locale, it won't be used if the base locale
isn't defined.
Thank you Glynn.
For instance If I want to have 2 language sets available for a user, can have two different bash_profiles? I mean have grass64eng for english language and grass64sp for Spanish?
And are there any rules regarding bash_profiles files?
Thanks
Gilbert
These would normally be set in e.g. ~/.profile (or ~/.bash_profile
etc; there are quite a lot of files which may be read by the shell)
then inherited by all processes.
Setting environment variables in Unix is done with e.g.:
LANG=es_ES
export LANG
I’d advise against using LC_ALL, as it overrides LC_NUMERIC. This can
cause numbers to use a comma as the decimal separator, which is
problematic when writing files (most file formats require a period).
GRASS modules only use the LC_MESSAGES category directly, but some
programs and (especially) scripts invoke external programs which may
be affected by the LC_NUMERIC or LC_ALL settings (scripts which use
awk are prone to this, although I think that we have now found them
all and forced LC_NUMERIC=C).
For instance If I want to have 2 language sets available for a user, can
have two different bash_profiles? I mean have grass64eng for english
language and grass64sp for Spanish?
And are there any rules regarding bash_profiles files?
~/.bash_profile is read when starting a login shell. It isn't started
for non-login shells.
If you want to provide separate versions of the grass64 script, bash's
startup files aren't relevant.
I just want to provide GRASS64 in two languages and without the user has to define lang in the bash_profiles.
My idea was to create 2 files: grass64eng and grass64sp each one with different language sets. So the user would have only to select the adequate file. If this is not correct, what would be your suggestion?
For instance If I want to have 2 language sets available for a user, can
have two different bash_profiles? I mean have grass64eng for english
language and grass64sp for Spanish?
And are there any rules regarding bash_profiles files?
~/.bash_profile is read when starting a login shell. It isn’t started
for non-login shells.
If you want to provide separate versions of the grass64 script, bash’s
startup files aren’t relevant.
On Wed, Feb 3, 2010 at 1:35 PM, Gilbert Ferrara
<gilbertferrara1974@gmail.com> wrote:
I just want to provide GRASS64 in two languages and without the user has to
define lang in the bash_profiles.
My idea was to create 2 files: grass64eng and grass64sp each one with
different language sets. So the user would have only to select the adequate
file.
On Wed, Feb 3, 2010 at 1:35 PM, Gilbert Ferrara
<gilbertferrara1974@gmail.com> wrote:
> I just want to provide GRASS64 in two languages and without the user has to
> define lang in the bash_profiles.
> My idea was to create 2 files: grass64eng and grass64sp each one with
> different language sets. So the user would have only to select the adequate
> file.
I just want to provide GRASS64 in two languages and without the user has to
define lang in the bash_profiles.
My idea was to create 2 files: grass64eng and grass64sp each one with
different language sets. So the user would have only to select the adequate
file.
What is the difference of being a child process or taking over? I mean, for
processing or data analysis?
The effect is the same, but using "exec" means one fewer process.
There are some situations where the difference can be more
significant, but they aren't particularly relevant to shell scripts or
to running commands manuall from the shell.