Handle LC_ALL=C correctly
We default to 'en' for LANG if LC_ALL=C is set
This commit is contained in:
		
							parent
							
								
									2a8c0da367
								
							
						
					
					
						commit
						03aa1db306
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -68,7 +68,10 @@ def initialize_lang():
 | 
			
		|||
    global LANG
 | 
			
		||||
    try:
 | 
			
		||||
        # en_US, fr_FR, el_GR etc..
 | 
			
		||||
        LANG = locale.getdefaultlocale()[0]
 | 
			
		||||
        default = locale.getdefaultlocale()[0]
 | 
			
		||||
        if default is None:
 | 
			
		||||
            # LC_ALL=C
 | 
			
		||||
            return
 | 
			
		||||
        LANG = LANG[:2]
 | 
			
		||||
    except (ValueError, locale.Error):
 | 
			
		||||
        pass
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue