Files
QtPotato/src/translate/translationpresets.cpp
T
tri 009dd94005 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
2026-11-07 15:01:05 +07:00

66 lines
3.4 KiB
C++

// SPDX-FileCopyrightText: 2026 Tri Vo Khac
// SPDX-License-Identifier: GPL-3.0-or-later
#include "translationpresets.h"
#include <KLocalizedString>
using namespace Qt::Literals::StringLiterals;
namespace TranslationPresets
{
const QList<Preset> &all()
{
static const QList<Preset> presets{
{
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,
},
};
return presets;
}
const Preset &find(const QString &id)
{
const auto &presets = all();
for (const Preset &preset : presets) {
if (preset.id == id) {
return preset;
}
}
return presets.constFirst();
}
}