feat(ui): style app menus and extract glossary dialog

- Add AppMenu and AppMenuItem so menu labels, mnemonics and shortcuts render consistently under org.kde.union
- Move the translation glossary into GlossaryDialog with add, remove and clear-all actions
- Regroup the translation preset and instructions settings layout
This commit was merged in pull request #3.
This commit is contained in:
tri committed 2026-11-07 15:03:37 +07:00
1 parent 9e55dba687
commit de9e6484ee
24 files changed
+533 -166

No files matched your search

+6
View File
@@ -15,31 +15,37 @@ const QList<Preset> &all()
{
u"general"_s,
i18nc("@item:inlistbox translation preset", "General"),
i18nc("@info translation preset description", "Natural dialogue with conventional names and a tone suited to the scene."),
u"Keep names as they are conventionally rendered and use a natural, conversational tone appropriate to the scene."_s,
},
{
u"chinese-donghua"_s,
i18nc("@item:inlistbox translation preset", "Chinese animation / wuxia / xianxia"),
i18nc("@info translation preset description", "Traditional names, cultivation terms, and period-appropriate forms of address."),
u"For Chinese animation, wuxia, xianxia, and historical settings, the source is often an English subtitle with pinyin names. When translating into Vietnamese, convert Chinese personal names, place names, sect and clan names, techniques, and cultivation terms into their Sino-Vietnamese (Hán-Việt) forms (for example, Xiao Yan → Tiêu Viêm, Dou Qi → Đấu Khí, Sect Master → Tông chủ). For other target languages, use that language's conventional rendering. Be consistent and prefer well-known established renderings from famous works. When translating into Vietnamese, use period-appropriate forms of address such as ta/ngươi, huynh/đệ, sư phụ, and tiền bối."_s,
},
{
u"japanese-anime"_s,
i18nc("@item:inlistbox translation preset", "Japanese anime"),
i18nc("@info translation preset description", "Casual dialogue with Japanese names and honorifics preserved."),
u"Keep Japanese names in romaji. Keep honorifics such as -san, -kun, and -senpai as-is. Use a natural, casual tone."_s,
},
{
u"korean-drama"_s,
i18nc("@item:inlistbox translation preset", "Korean drama"),
i18nc("@info translation preset description", "Modern dialogue with Korean names and relationship-aware forms of address."),
u"Keep Korean names. Use modern forms of address that fit the relationships; when translating into Vietnamese, use forms such as anh/em, and oppa may be kept when appropriate."_s,
},
{
u"western"_s,
i18nc("@item:inlistbox translation preset", "Western"),
i18nc("@info translation preset description", "A neutral modern tone with naturally adapted idioms."),
u"Keep names. Use a neutral modern tone and adapt idioms naturally for the target language."_s,
},
{
u"documentary"_s,
i18nc("@item:inlistbox translation preset", "Documentary"),
i18nc("@info translation preset description", "Formal, precise language with accurate terminology."),
u"Keep names. Use a formal, precise tone and translate terminology accurately."_s,
},
};
+1
View File
@@ -11,6 +11,7 @@ namespace TranslationPresets
struct Preset {
QString id;
QString name;
QString description;
QString guidance;
};
+1 -1
View File
@@ -117,7 +117,7 @@ QVariantList TranslationService::translationPresets() const
{
QVariantList result;
for (const auto &preset : TranslationPresets::all()) {
result.append(QVariantMap{{u"id"_s, preset.id}, {u"name"_s, preset.name}, {u"guidance"_s, preset.guidance}});
result.append(QVariantMap{{u"id"_s, preset.id}, {u"name"_s, preset.name}, {u"description"_s, preset.description}, {u"guidance"_s, preset.guidance}});
}
return result;
}