Skip to content

Commit

Permalink
better typo and check
Browse files Browse the repository at this point in the history
  • Loading branch information
Furtif committed Dec 30, 2023
1 parent a4fe056 commit b4895a6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions options.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import gettext
import os

import locale
import os

simulation_mode = False
port_speed = 38400
Expand Down Expand Up @@ -46,14 +45,16 @@ def translator(domain):
lang, enc = locale.getlocale()
check = lang
except:
pass

if check == 'en_US':
try:
lang, enc = locale.getdefaultlocale()
check = lang
except:
pass
pass
os.environ['LANG'] = check

# Set up message catalog access
os.environ['LANG'] = check
t = gettext.translation(domain, 'dtt4all_data/locale', fallback=True) # not ok in python 3.11.x, codeset="utf-8")
return t.gettext

0 comments on commit b4895a6

Please sign in to comment.