This commit is contained in:
lllyasviel
2023-10-20 16:28:51 -07:00
parent 650f32b920
commit 65190b4a68
2 changed files with 7 additions and 21 deletions
+1 -4
View File
@@ -29,14 +29,11 @@ def dump_english_config(components):
all_texts = []
for c in components:
label = getattr(c, 'label', None)
value = getattr(c, 'value', None)
choices = getattr(c, 'choices', None)
info = getattr(c, 'info', None)
if isinstance(label, str):
all_texts.append(label)
if isinstance(value, str):
all_texts.append(value)
if isinstance(info, str):
all_texts.append(info)
if isinstance(choices, list):
@@ -48,7 +45,7 @@ def dump_english_config(components):
if isinstance(y, str):
all_texts.append(y)
config_dict = {k: k for k in all_texts}
config_dict = {k: k for k in all_texts if k != ""}
full_name = os.path.abspath(os.path.join(localization_root, 'en.json'))
with open(full_name, "w", encoding="utf-8") as json_file: