Opened 14 years ago

Closed 10 years ago

#879 closed enhancement (fixed)

Add a "change language" option in GRASS GUI

Reported by: antoniorocha Owned by: lucadelu
Priority: major Milestone: 7.0.0
Component: Translations Version: svn-releasebranch64
Keywords: wxGUI, i18n Cc: grass-dev@…, martinl
CPU: All Platform: All

Description

Instead of changing GRASS language in init.bat files (or other), the user would change its language without quitting GRASS session.

Hamish comment was: I would suggest to put it in Config->GRASS working environment->

I suppose it would have to be a g.gisenv GRASS variable not an environment variable to work system-wide. But then we've have to add some G_getenv() -> setenv() magic in G_parser() and the start of wxgui.py?

Attachments (1)

language.diff (7.5 KB ) - added by lucadelu 12 years ago.
implemention of language preference

Download all attachments as: .zip

Change History (16)

in reply to:  description ; comment:1 by glynn, 14 years ago

Replying to antoniorocha:

Instead of changing GRASS language in init.bat files (or other), the user would change its language without quitting GRASS session.

Is there some reason why GRASS shouldn't just use the same locale settings as every other application?

Currently, this doesn't work on Windows, as localisation relies upon the LANG/LC_* environment variables being set, and Windows doesn't set those, so init.bat needs the fix proposed here or something similar.

This should probably be closed as "invalid" once someone opens a bug report for LANG not being set on Windows.

in reply to:  1 comment:2 by marisn, 14 years ago

Replying to glynn:

Is there some reason why GRASS shouldn't just use the same locale settings as every other application?

Ability to switch application language instead of changing whole work environment language is a nice feature. I use it quite often for QGIS and KDE applications (bug reports, testing l18n regressions etc.). Not everyone is capable of changing system-wide locale settings (read - restricted user rights on shared computers) also "export LANG" is not an lamer friendly way how to do this.

in reply to:  1 comment:3 by neteler, 14 years ago

Replying to glynn:

Is there some reason why GRASS shouldn't just use the same locale settings as every other application?

Yes: If I am visiting for example Japan/China/Brasil/... I am not necessarily able to understand the local language, i.e. use the localized menus of the PC provided to me.

Currently, this doesn't work on Windows, as localisation relies upon the LANG/LC_* environment variables being set, and Windows doesn't set those, so init.bat needs the fix proposed here or something similar.

This should probably be closed as "invalid" once someone opens a bug report for LANG not being set on Windows.

If it is better to have a separate bug report for this, let's do it. But it won't change the need for a solution.

Markus

comment:4 by neteler, 13 years ago

See also http://trac.osgeo.org/qgis/ticket/3634 "GRASS language is taken from system, not from QGIS settings"

comment:5 by hamish, 12 years ago

Component: wxGUITranslations
CPU: UnspecifiedAll
Keywords: wxGUI i18n added
Milestone: 6.4.06.4.3
Platform: UnspecifiedAll
Priority: normalmajor
Version: unspecifiedsvn-releasebranch64

by lucadelu, 12 years ago

Attachment: language.diff added

implemention of language preference

comment:6 by lucadelu, 12 years ago

Owner: changed from grass-dev@… to lucadelu

I implemented it for grass7, please check the diff attached.

Best Luca

comment:7 by hamish, 12 years ago

Cc: grass-dev@… added

comment:8 by neteler, 12 years ago

When adding the "LANGUAGE" variable, too, it works nicely.

comment:9 by lucadelu, 12 years ago

Committed as r49670 with "LANGUAGE" variable added.

TODO: replace locales in combobox, reduce list to only installed locales

in reply to:  9 comment:10 by lucadelu, 12 years ago

Replying to lucadelu:

Committed as r49670 with "LANGUAGE" variable added.

TODO: replace locales in combobox, reduce list to only installed locales

some improvement of this commit was done by MartinL in r49910, someone has an idea how to reduce list to only installed locales?

comment:11 by martinl, 11 years ago

Please try recent version...

comment:12 by martinl, 11 years ago

Cc: martinl added

comment:13 by martinl, 11 years ago

Milestone: 6.4.36.4.4

Update: changing language settings from wxGUI should work in 6.4.3. It still requires GRASS restart even in GRASS 7. Moving milestone to 6.4.4.

in reply to:  13 comment:14 by marisn, 11 years ago

Replying to martinl:

Update: changing language settings from wxGUI should work in 6.4.3. It still requires GRASS restart even in GRASS 7. Moving milestone to 6.4.4.

It could be possible to try to reset active WXGUI instance language instantly, still it's not possible to change parent process environment and thus anything not inheriting environment from WXGUI AFTER language change will still be in previous language. Save, restart cycle ensures that GRASS gets the new language and probably locale too, from the start and thus whole GRASS session has correct LANG and other parameters (CLI, all WXGUI instances etc.). Hope that clears a bit.

comment:15 by marisn, 10 years ago

Milestone: 6.4.47.0.0
Resolution: fixed
Status: newclosed

Language switching is working in 7. As GRASS 6 should be feature frozen, moving milestone and closing as implemented. Issues with its implementation in GRASS 7 should be tracked in separate tickets.

Note: See TracTickets for help on using tickets.