MCPcopy Create free account
hub / github.com/Syncplay/syncplay / getInitialLanguage

Function getInitialLanguage

syncplay/messages.py:81–95  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

79
80
81def getInitialLanguage():
82 try:
83 import sys
84 frozen = getattr(sys, 'frozen', '')
85 if frozen and frozen in 'macosx_app':
86 from PySide2.QtCore import QLocale
87 initialLanguage = QLocale.system().uiLanguages()[0].split('-')[0]
88 else:
89 import locale
90 initialLanguage = locale.getdefaultlocale()[0].split("_")[0]
91 if initialLanguage not in messages:
92 initialLanguage = constants.FALLBACK_INITIAL_LANGUAGE
93 except:
94 initialLanguage = constants.FALLBACK_INITIAL_LANGUAGE
95 return initialLanguage
96
97
98def isValidLanguage(language):

Callers 2

addMessageTabMethod · 0.90
getMessageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected