[GRASS-dev] [GRASS GIS] #3875: GRASS doesn't start with non-system locale

#3875: GRASS doesn't start with non-system locale
-------------------------+-------------------------
Reporter: annakrat | Owner: grass-dev@…
     Type: defect | Status: new
Priority: critical | Milestone: 7.6.2
Component: Default | Version: svn-trunk
Keywords: init script | CPU: Unspecified
Platform: All |
-------------------------+-------------------------
When setting different locale, GRASS session doesn't start:
{{{
Traceback (most recent call last):
   File "./bin.x86_64-pc-linux-gnu/grass77", line 2204, in <module>
     main()
   File "./bin.x86_64-pc-linux-gnu/grass77", line 2082, in main
     message(_("Starting GRASS GIS..."))
NameError: global name '_' is not defined
}}}

Appeared after
[https://github.com/OSGeo/grass/commit/2246f5b6aca7a3dca67fc8b0d0c46fe64be39626
2246f5b].

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3875&gt;
GRASS GIS <https://grass.osgeo.org>

#3875: GRASS doesn't start with non-system locale
--------------------------+-------------------------
  Reporter: annakrat | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: critical | Milestone: 7.6.2
Component: Default | Version: svn-trunk
Resolution: | Keywords: init script
       CPU: Unspecified | Platform: All
--------------------------+-------------------------

Comment (by marisn):

To reproduce the issue it is necessary to set language override to some
language with unsupported locale.

Thus the full output is:

{{{
Failed to enforce user specified language 'ru' with error: 'unsupported
locale setting'
A LANGUAGE environmental variable has been set.
Part of messages will be displayed in the requested language.
Traceback (most recent call last):
   File "bin.x86_64-pc-linux-gnu/grass77", line 2204, in <module>
     main()
   File "bin.x86_64-pc-linux-gnu/grass77", line 2082, in main
     message(_("Starting GRASS GIS..."))
NameError: global name '_' is not defined
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3875#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#3875: GRASS doesn't start with non-system locale
--------------------------+-------------------------
  Reporter: annakrat | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: critical | Milestone: 7.6.2
Component: Default | Version: svn-trunk
Resolution: | Keywords: init script
       CPU: Unspecified | Platform: All
--------------------------+-------------------------

Comment (by hellik):

windows 10 box with german locale, switching winGRASS to english, wxGUI
starts, though some warning:

{{{
Error: Reading settings from file
<C:\Users\myuser\AppData\Roaming\GRASS7\wx> failed.
                 Details: not enough values to unpack (expected 2, got 1)
                 Line: ''
}}}

switching to ru, wxGUI starts and the GUI is partly in russian, though the
same warning:

{{{
Error: Reading settings from file
<C:\Users\myuser\AppData\Roaming\GRASS7\wx> failed.
                 Details: not enough values to unpack (expected 2, got 1)
                 Line: ''
}}}

tested with

{{{
System Info
GRASS version: 7.7.dev
Code revision: 5249e44ac
Build date: 2019-07-24
Build platform: x86_64-w64-mingw32
GDAL: 2.4.1
PROJ.4: 5.2.0
GEOS: 3.7.2
SQLite: 3.26.0
Python: 3.7.0
wxPython: 4.0.3
Platform: Windows-10-10.0.18362-SP0 (OSGeo4W)
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3875#comment:2&gt;
GRASS GIS <https://grass.osgeo.org>

#3875: GRASS doesn't start with non-system locale
--------------------------+-------------------------
  Reporter: annakrat | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: critical | Milestone: 7.6.2
Component: Default | Version: svn-trunk
Resolution: | Keywords: init script
       CPU: Unspecified | Platform: All
--------------------------+-------------------------

Comment (by annakrat):

Replying to [comment:2 hellik]:
> windows 10 box with german locale, switching winGRASS to english, wxGUI
starts, though some warning:

but that's before the commit that caused this

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3875#comment:3&gt;
GRASS GIS <https://grass.osgeo.org>

#3875: GRASS doesn't start with non-system locale
--------------------------+-------------------------
  Reporter: annakrat | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: blocker | Milestone: 7.6.2
Component: Default | Version: svn-trunk
Resolution: | Keywords: init script
       CPU: Unspecified | Platform: All
--------------------------+-------------------------
Changes (by annakrat):

* priority: critical => blocker

Comment:

Looks like it happens on Mac without special locale setting

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3875#comment:4&gt;
GRASS GIS <https://grass.osgeo.org>

#3875: GRASS doesn't start with non-system locale
--------------------------+-------------------------
  Reporter: annakrat | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: blocker | Milestone: 7.6.2
Component: Default | Version: svn-trunk
Resolution: | Keywords: init script
       CPU: Unspecified | Platform: All
--------------------------+-------------------------

Comment (by marisn):

Please test if this PR fixes the issue:
https://github.com/OSGeo/grass/pull/156

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3875#comment:5&gt;
GRASS GIS <https://grass.osgeo.org>

#3875: GRASS doesn't start with non-system locale
--------------------------+---------------------------------
  Reporter: annakrat | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: blocker | Milestone: 7.8.1
Component: Default | Version: git-releasebranch78
Resolution: fixed | Keywords: init script
       CPU: Unspecified | Platform: All
--------------------------+---------------------------------
Changes (by neteler):

* status: new => closed
* version: svn-trunk => git-releasebranch78
* resolution: => fixed
* milestone: 7.6.2 => 7.8.1

Comment:

PR applied in

- master:
https://github.com/OSGeo/grass/commit/63d08250621d74bc7d43b8d87ba6d635f4763a54
- relbranch78:
https://github.com/OSGeo/grass/commit/25835a286ea70f80bb5745ffb0c0d0dd728f7927

Closing, reopen if needed.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3875#comment:6&gt;
GRASS GIS <https://grass.osgeo.org>