mirror of
https://github.com/harry0703/MoneyPrinterTurbo.git
synced 2026-02-21 08:27:22 +08:00
feat: optimize code
This commit is contained in:
parent
5177c1871a
commit
dfa8328bb0
@ -57,6 +57,16 @@ i18n_dir = os.path.join(root_dir, "webui", "i18n")
|
||||
config_file = os.path.join(root_dir, "webui", ".streamlit", "webui.toml")
|
||||
system_locale = utils.get_system_locale()
|
||||
|
||||
|
||||
if "video_subject" not in st.session_state:
|
||||
st.session_state["video_subject"] = ""
|
||||
if "video_script" not in st.session_state:
|
||||
st.session_state["video_script"] = ""
|
||||
if "video_terms" not in st.session_state:
|
||||
st.session_state["video_terms"] = ""
|
||||
if "ui_language" not in st.session_state:
|
||||
st.session_state["ui_language"] = config.ui.get("language", system_locale)
|
||||
|
||||
# 加载语言文件
|
||||
locales = utils.load_locales(i18n_dir)
|
||||
|
||||
@ -97,16 +107,6 @@ support_locales = [
|
||||
"th-TH",
|
||||
]
|
||||
|
||||
if "video_subject" not in st.session_state:
|
||||
st.session_state["video_subject"] = ""
|
||||
if "video_script" not in st.session_state:
|
||||
st.session_state["video_script"] = ""
|
||||
if "video_terms" not in st.session_state:
|
||||
st.session_state["video_terms"] = ""
|
||||
if "ui_language" not in st.session_state:
|
||||
st.session_state["ui_language"] = config.ui.get("language", system_locale)
|
||||
|
||||
|
||||
def get_all_fonts():
|
||||
fonts = []
|
||||
for root, dirs, files in os.walk(font_dir):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user