Use system loanguage for servers
This commit is contained in:
parent
98b0d89981
commit
2a6098d2c4
@ -28,6 +28,10 @@ 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:
|
||||||
@ -64,7 +68,7 @@ def getInitialLanguage():
|
|||||||
try:
|
try:
|
||||||
import sys
|
import sys
|
||||||
frozen = getattr(sys, 'frozen', '')
|
frozen = getattr(sys, 'frozen', '')
|
||||||
if frozen in 'macosx_app':
|
if isMacOS() 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:
|
||||||
|
|||||||
@ -29,6 +29,7 @@ class SyncFactory(Factory):
|
|||||||
disableReady=False, disableChat=False, maxChatMessageLength=constants.MAX_CHAT_MESSAGE_LENGTH,
|
disableReady=False, disableChat=False, maxChatMessageLength=constants.MAX_CHAT_MESSAGE_LENGTH,
|
||||||
maxUsernameLength=constants.MAX_USERNAME_LENGTH, statsDbFile=None, tlsCertPath=None):
|
maxUsernameLength=constants.MAX_USERNAME_LENGTH, statsDbFile=None, tlsCertPath=None):
|
||||||
self.isolateRooms = isolateRooms
|
self.isolateRooms = isolateRooms
|
||||||
|
syncplay.messages.setLanguage(syncplay.messages.getInitialLanguage())
|
||||||
print(getMessage("welcome-server-notification").format(syncplay.version))
|
print(getMessage("welcome-server-notification").format(syncplay.version))
|
||||||
self.port = port
|
self.port = port
|
||||||
if password:
|
if password:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user