Use system loanguage for servers

This commit is contained in:
et0h 2021-10-31 13:33:40 +00:00
parent 98b0d89981
commit 2a6098d2c4
2 changed files with 6 additions and 1 deletions

View File

@ -28,6 +28,10 @@ no_osd_message_list = [
"revert-notification",
]
def isMacOS():
import sys
return sys.platform.startswith(constants.OS_MACOS)
def getLanguages():
langList = {}
for lang in messages:
@ -64,7 +68,7 @@ def getInitialLanguage():
try:
import sys
frozen = getattr(sys, 'frozen', '')
if frozen in 'macosx_app':
if isMacOS() and frozen in 'macosx_app':
from PySide2.QtCore import QLocale
initialLanguage = QLocale.system().uiLanguages()[0].split('-')[0]
else:

View File

@ -29,6 +29,7 @@ class SyncFactory(Factory):
disableReady=False, disableChat=False, maxChatMessageLength=constants.MAX_CHAT_MESSAGE_LENGTH,
maxUsernameLength=constants.MAX_USERNAME_LENGTH, statsDbFile=None, tlsCertPath=None):
self.isolateRooms = isolateRooms
syncplay.messages.setLanguage(syncplay.messages.getInitialLanguage())
print(getMessage("welcome-server-notification").format(syncplay.version))
self.port = port
if password: