fix bug with dictionary only translated on demand

This commit is contained in:
Wolfang Torres
2026-06-12 20:58:53 +08:00
parent f9fc887d05
commit dde819f1e6
5 changed files with 26 additions and 20 deletions

View File

@@ -81,7 +81,7 @@ HSK_MODEL = Model(
"<strong>{{Pinyin}}</strong>"
"<br>{{Translated}}"
"<br>{{Audio}}"
"<br>Pinyin: {{type:Simplified}}"
"<br>Simplified: {{type:Simplified}}"
),
"afmt": (
"{{FrontSide}}<hr id='answer''><div class='simple'>{{Simplified}}</div>"
@@ -134,7 +134,8 @@ def output_anki_dictionary(process_file: ProcessFile, results: list[DictionaryRe
note = Note(
model=HSK_MODEL,
fields=[
"\n ".join(f"{n+1}. {m}" for n, m in enumerate(result.meanings)),
# "\n ".join(f"{n+1}. {m}" for n, m in enumerate(result.meanings)),
result.meaning,
PinyinToneConverter().convert_text(result.pinyin),
result.simplified,
result.traditional,