Merge branch 'ui_language' into for_webui
This commit is contained in:
@@ -10,12 +10,6 @@ def getImageFile(file_name):
|
|||||||
img = Image_open(os_path.join(os_path.dirname(__file__), "img", file_name))
|
img = Image_open(os_path.join(os_path.dirname(__file__), "img", file_name))
|
||||||
return img
|
return img
|
||||||
|
|
||||||
def getKeyByValue(dictionary, value):
|
|
||||||
for key, val in dictionary.items():
|
|
||||||
if val == value:
|
|
||||||
return key
|
|
||||||
return None
|
|
||||||
|
|
||||||
def callFunctionIfCallable(function, *args):
|
def callFunctionIfCallable(function, *args):
|
||||||
if callable(function) is True:
|
if callable(function) is True:
|
||||||
function(*args)
|
function(*args)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ from threading import Thread
|
|||||||
import re
|
import re
|
||||||
from config import config
|
from config import config
|
||||||
from model import model
|
from model import model
|
||||||
from utils import getKeyByValue, isUniqueStrings, printLog, printResponse
|
from utils import isUniqueStrings, printLog, printResponse
|
||||||
|
|
||||||
# Common
|
# Common
|
||||||
class DownloadSoftwareProgressBar:
|
class DownloadSoftwareProgressBar:
|
||||||
@@ -663,7 +663,6 @@ def callbackSetFontFamily(data, *args, **kwargs) -> dict:
|
|||||||
|
|
||||||
def callbackSetUiLanguage(data, *args, **kwargs) -> dict:
|
def callbackSetUiLanguage(data, *args, **kwargs) -> dict:
|
||||||
printLog("Set UI Language", data)
|
printLog("Set UI Language", data)
|
||||||
data = getKeyByValue(config.SELECTABLE_UI_LANGUAGES_DICT, data)
|
|
||||||
config.UI_LANGUAGE = data
|
config.UI_LANGUAGE = data
|
||||||
return {"status":200, "result":config.UI_LANGUAGE}
|
return {"status":200, "result":config.UI_LANGUAGE}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user