@@ -30,6 +30,7 @@ def missing_extensions(ext_list:[]):
3030 error_str = "Note: <b style='color:Orange;'>Found missing extensions.</b></p>"
3131 for ext in ext_list :
3232 error_str += "<p>- <b style='color:Orange;'>" + ext + "</b></p> "
33+ error_str += "<b style='color:Orange;'>The above Extension Missing Reminder is for reference only. Please determine the necessary plugins based on your actual needs and specific conditions.</b></p> "
3334 return error_str
3435
3536 def click_to_download (file_name , file_url ):
@@ -58,13 +59,15 @@ def alternative_option(target_value, new_value):
5859 def no_option (option_name , value ):
5960 if (option_name == "stable diffusion checkpoint" ):
6061 return f'''未找到大模型'<b style='color:Orange;'>{ value } </b>'!'''
61- return f'''错误: '<b style='color:Red;'>{ option_name } </b>'导入失败!<br>\
62+ clear_option_name = option_name .replace ("state-ext-" ,"" )
63+ return f'''错误: '<b style='color:Red;'>{ clear_option_name } </b>'导入失败!<br>\
6264 未找到选项'<b style='color:Red;'>{ value } </b>'!'''
6365
6466 def missing_extensions (ext_list :[]):
6567 error_str = "注意, <b style='color:Orange;'>发现缺失的插件:</b></p>"
6668 for ext in ext_list :
6769 error_str += "<p>- <b style='color:Orange;'>" + ext + "</b></p> "
70+ error_str += "<b style='color:Orange;'>以上插件缺失提示仅供参考,请注意辨别实际情况下您所需要安装的插件。</b></p> "
6871 return error_str
6972
7073 def click_to_download (file_name , file_url ):
@@ -125,25 +128,45 @@ def init():
125128 with open (shared .cmd_opts .ui_settings_file , mode = 'r' ) as f :
126129 json_str = f .read ()
127130 webui_settings = json .loads (json_str )
131+
132+ successed = False
133+ auto_language = False
128134 try :
135+ # 优先读取自己的设置
129136 if (webui_settings ['lightdiffusionflow-language' ] == "default" ):
130- localization_files = ["zh_CN" , "zh-Hans (Stable) [vladmandic]" , "zh-Hans (Stable)" ,
131- "zh-Hans (Testing) [vladmandic]" , "zh-Hans (Testing)" ]
132- try :
133- # 如果用户使用了中文汉化文件,插件也默认显示中文
134- localization_files .index (webui_settings ["localization" ])
135- OutputPrompt = OutputPrompt_Chinese
136- except :
137- OutputPrompt = OutputPrompt_English
137+ auto_language = True
138138 elif (webui_settings ['lightdiffusionflow-language' ] == "english" ):
139139 OutputPrompt = OutputPrompt_English
140+ successed = True
140141 else :
141142 OutputPrompt = OutputPrompt_Chinese
142- except KeyError :
143- pass
143+ successed = True
144+ except :
145+ OutputPrompt = OutputPrompt_English
146+
147+ # 如果是default就读取其他设置配合
148+ if (auto_language and not successed ):
149+ # 自带的本地化文件
150+ localization_files = ["zh_CN" , "zh-Hans (Stable) [vladmandic]" , "zh-Hans (Stable)" ,
151+ "zh-Hans (Testing) [vladmandic]" , "zh-Hans (Testing)" ,"chinese-all-1024" ,"chinese-english-1024" ]
152+ try :
153+ # 如果用户使用了中文汉化文件,插件也默认显示中文
154+ localization_files .index (webui_settings ["localization" ])
155+ OutputPrompt = OutputPrompt_Chinese
156+ successed = True
157+ except :
158+ pass
159+
160+ # 第三方翻译插件bilingual-localization
161+ if (not successed ):
162+ try :
163+ if (webui_settings ["bilingual_localization_enabled" ] and webui_settings ["bilingual_localization_file" ] != "None" ):
164+ OutputPrompt = OutputPrompt_Chinese
165+ successed = True
166+ except :
167+ OutputPrompt = OutputPrompt_English
144168 except :
145- # 啥都读不到就默认显示英文
146- OutputPrompt = OutputPrompt_English
169+ pass
147170
148171 Image_Components_Key = [
149172 # 第一个组件是用来预计算第一张有效图的索引 防止出现有没用的页面跳转
0 commit comments