Skip to content

Commit 29a9d20

Browse files
author
spirit
committed
getlocale() or getdefaultlocale()
1 parent 4a02d21 commit 29a9d20

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

‎language_tool/__init__.py‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -486,11 +486,7 @@ def get_jar_info():
486486
def get_locale_language():
487487
"""Get the language code for the current locale setting.
488488
"""
489-
language = locale.getlocale()[0]
490-
if not language:
491-
locale.setlocale(locale.LC_ALL, "")
492-
language = locale.getlocale()[0]
493-
return language
489+
return locale.getlocale()[0] or locale.getdefaultlocale()[0]
494490

495491

496492
@atexit.register

0 commit comments

Comments
 (0)