Refactor how non-macOS/frozen initialLanguage is fixed
This commit is contained in:
parent
39be0a13a7
commit
b7f27f013b
@ -28,10 +28,6 @@ no_osd_message_list = [
|
|||||||
"revert-notification",
|
"revert-notification",
|
||||||
]
|
]
|
||||||
|
|
||||||
def isMacOS():
|
|
||||||
import sys
|
|
||||||
return sys.platform.startswith(constants.OS_MACOS)
|
|
||||||
|
|
||||||
def getLanguages():
|
def getLanguages():
|
||||||
langList = {}
|
langList = {}
|
||||||
for lang in messages:
|
for lang in messages:
|
||||||
@ -68,7 +64,7 @@ def getInitialLanguage():
|
|||||||
try:
|
try:
|
||||||
import sys
|
import sys
|
||||||
frozen = getattr(sys, 'frozen', '')
|
frozen = getattr(sys, 'frozen', '')
|
||||||
if isMacOS() and frozen in 'macosx_app':
|
if frozen and frozen in 'macosx_app':
|
||||||
from PySide2.QtCore import QLocale
|
from PySide2.QtCore import QLocale
|
||||||
initialLanguage = QLocale.system().uiLanguages()[0].split('-')[0]
|
initialLanguage = QLocale.system().uiLanguages()[0].split('-')[0]
|
||||||
else:
|
else:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user