perf: recover lost files (locale_selector.dart, terminology.py, app_zh_hant.arb)

These files were accidentally omitted during cherry-pick workflow.
They were present in 639ef12 but dropped when switching to git apply workflow.
This commit is contained in:
qzl
2026-04-14 11:49:45 +08:00
parent dc66afb5a8
commit 97976b20bf
3 changed files with 114 additions and 128 deletions
@@ -0,0 +1,50 @@
"""简繁术语映射表。
用于将简体中文术语转换为繁体中文版本。
"""
# 六亲简体 → 繁体
LIU_QIN_HANT = {
"子孙": "子孫",
"妻财": "妻財",
}
# 六神简体 → 繁体(只有"龙"需要转换,其他单字简繁相同)
LIU_SHOU_HANT = {
"": "",
}
# 卦名常见简体 → 繁体
# 六十四卦中需要转换的字符:为→為、贲→賁、颐→頤、离→離、无→無、壮→壯、晋→晉
GUA_NAME_HANT = {
"": "",
"": "",
"": "",
"": "",
"": "",
"": "",
"": "",
}
def to_hant(text: str, mapping: dict[str, str]) -> str:
"""将文本中的字符根据映射表转换为繁体。"""
result = text
for simplified, traditional in mapping.items():
result = result.replace(simplified, traditional)
return result
def liu_shou_to_hant(single_char: str) -> str:
"""将六神单字转换为繁体。"""
return LIU_SHOU_HANT.get(single_char, single_char)
def liu_qin_to_hant(relation: str) -> str:
"""将六亲转换为繁体。"""
return to_hant(relation, LIU_QIN_HANT)
def gua_name_to_hant(name: str) -> str:
"""将卦名转换为繁体。"""
return to_hant(name, GUA_NAME_HANT)