Opened 5 years ago

Closed 5 years ago

#3875 closed defect (fixed)

GRASS doesn't start with non-system locale

Reported by: annakrat Owned by: grass-dev@…
Priority: blocker Milestone: 7.8.1
Component: Default Version: git-releasebranch78
Keywords: init script Cc:
CPU: Unspecified Platform: All

Description

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 2246f5b.

Change History (6)

comment:1 by marisn, 5 years ago

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

comment:2 by hellik, 5 years ago

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)

in reply to:  2 comment:3 by annakrat, 5 years ago

Replying to 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

comment:4 by annakrat, 5 years ago

Priority: criticalblocker

Looks like it happens on Mac without special locale setting

comment:5 by marisn, 5 years ago

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

comment:6 by neteler, 5 years ago

Milestone: 7.6.27.8.1
Resolution: fixed
Status: newclosed
Version: svn-trunkgit-releasebranch78
Note: See TracTickets for help on using tickets.