Opened 10 years ago

Closed 5 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 8 years ago.
implemention of language preference

Download all attachments as: .zip

Change History (16)

comment:1 in reply to:  description ; Changed 10 years ago by glynn

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.

comment:2 in reply to:  1 Changed 10 years ago by marisn

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.

comment:3 in reply to:  1 Changed 9 years ago by neteler

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 Changed 9 years ago by neteler

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

comment:5 Changed 8 years ago by hamish

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

Changed 8 years ago by lucadelu

Attachment: language.diff added

implemention of language preference

comment:6 Changed 8 years ago by lucadelu

Owner: changed from grass-dev@… to lucadelu

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

Best Luca

comment:7 Changed 8 years ago by hamish

Cc: grass-dev@… added

comment:8 Changed 8 years ago by neteler

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

comment:9 Changed 8 years ago by lucadelu

Committed as r49670 with "LANGUAGE" variable added.

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

comment:10 in reply to:  9 Changed 7 years ago by lucadelu

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 Changed 7 years ago by martinl

Please try recent version...

comment:12 Changed 7 years ago by martinl

Cc: martinl added

comment:13 Changed 7 years ago by martinl

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.

comment:14 in reply to:  13 Changed 7 years ago by marisn

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 Changed 5 years ago by marisn

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.