Gui: Adding translation comments to hints and new numpad keys.

This commit is contained in:
Max Wilfinger
2025-06-05 11:20:39 +02:00
committed by Chris Hennes
parent 493817a775
commit 281d4e0b91
2 changed files with 65 additions and 10 deletions

View File

@@ -184,6 +184,18 @@ struct InputHint
KeyF34 = Qt::Key_F34,
KeyF35 = Qt::Key_F35,
// numpad keys
KeyNum0 = Qt::Key_0 + Qt::KeypadModifier,
KeyNum1 = Qt::Key_1 + Qt::KeypadModifier,
KeyNum2 = Qt::Key_2 + Qt::KeypadModifier,
KeyNum3 = Qt::Key_3 + Qt::KeypadModifier,
KeyNum4 = Qt::Key_4 + Qt::KeypadModifier,
KeyNum5 = Qt::Key_5 + Qt::KeypadModifier,
KeyNum6 = Qt::Key_6 + Qt::KeypadModifier,
KeyNum7 = Qt::Key_7 + Qt::KeypadModifier,
KeyNum8 = Qt::Key_8 + Qt::KeypadModifier,
KeyNum9 = Qt::Key_9 + Qt::KeypadModifier,
// Mouse Keys
MouseMove = 1 << 16,
MouseLeft = 2 << 16,

View File

@@ -164,7 +164,7 @@ QString Gui::InputHintWidget::inputRepresentation(const InputHint::UserInput key
// clang-format off
switch (key) {
// Keyboard Keys
case KeySpace: return tr("Space");
case KeySpace: return QStringLiteral("");
case KeyExclam: return QStringLiteral("!");
case KeyQuoteDbl: return QStringLiteral("\"");
case KeyNumberSign: return QStringLiteral("-/+");
@@ -234,27 +234,41 @@ QString Gui::InputHintWidget::inputRepresentation(const InputHint::UserInput key
case KeyAsciiTilde: return QStringLiteral("~");
// misc keys
case KeyEscape: return tr("Escape");
case KeyTab: return tr("tab ⭾");
/*: Keyboard key for Escape */
case KeyEscape: return tr("Esc");
/*: Keyboard key for Tab */
case KeyTab: return tr("Tab ⭾");
/*: Keyboard key for Backtab */
case KeyBacktab: return tr("Backtab");
case KeyBackspace: return tr("");
case KeyReturn: return tr(" Enter");
case KeyBackspace: return QStringLiteral("");
case KeyReturn: return QStringLiteral("");
/*: Keyboard key for numpad Enter */
case KeyEnter: return tr("Enter");
/*: Keyboard key for Insert */
case KeyInsert: return tr("Insert");
case KeyDelete: return tr("Delete");
/*: Keyboard key for Delete */
case KeyDelete: return tr("Del");
/*: Keyboard key for Pause */
case KeyPause: return tr("Pause");
/*: Keyboard key for Print */
case KeyPrintScr: return tr("Print");
/*: Keyboard key for SysReq */
case KeySysReq: return tr("SysReq");
/*: Keyboard key for Clear */
case KeyClear: return tr("Clear");
// cursor movement
/*: Keyboard key for Home */
case KeyHome: return tr("Home");
/*: Keyboard key for End */
case KeyEnd: return tr("End");
case KeyLeft: return QStringLiteral("");
case KeyUp: return QStringLiteral("");
case KeyRight: return QStringLiteral("");
case KeyDown: return QStringLiteral("");
/*: Keyboard key for Page Down */
case KeyPageUp: return tr("PgDown");
/*: Keyboard key for Page Up */
case KeyPageDown: return tr("PgUp");
// modifiers
@@ -264,17 +278,23 @@ QString Gui::InputHintWidget::inputRepresentation(const InputHint::UserInput key
case KeyMeta: return QStringLiteral("");
case KeyAlt: return QStringLiteral("");
#else
case KeyShift: return tr("Shift");
/*: Keyboard key for Shift on Windows & Linux */
case KeyShift: return tr("⇧ Shift");
/*: Keyboard key for Control on Windows & Linux */
case KeyControl: return tr("Ctrl");
#ifdef FC_OS_WIN32
case KeyMeta: return tr("⊞ Win");
case KeyMeta: return QStringLiteral("⊞ Win");
#else
case KeyMeta: return tr("❖ Meta");
case KeyMeta: return QStringLiteral("❖ Meta");
#endif
/*: Keyboard key for Alt on Windows & Linux */
case KeyAlt: return tr("Alt");
#endif
/*: Keyboard key for Caps Lock */
case KeyCapsLock: return tr("Caps Lock");
/*: Keyboard key for Num Lock */
case KeyNumLock: return tr("Num Lock");
/*: Keyboard key for Scroll Lock */
case KeyScrollLock: return tr("Scroll Lock");
// function
@@ -314,7 +334,30 @@ QString Gui::InputHintWidget::inputRepresentation(const InputHint::UserInput key
case KeyF34: return QStringLiteral("F34");
case KeyF35: return QStringLiteral("F35");
default: return tr("???");
// numpad
/*: Keyboard key for numpad 0 */
case KeyNum0: return tr("Num0");
/*: Keyboard key for numpad 1 */
case KeyNum1: return tr("Num1");
/*: Keyboard key for numpad 2 */
case KeyNum2: return tr("Num2");
/*: Keyboard key for numpad 3 */
case KeyNum3: return tr("Num3");
/*: Keyboard key for numpad 4 */
case KeyNum4: return tr("Num4");
/*: Keyboard key for numpad 5 */
case KeyNum5: return tr("Num5");
/*: Keyboard key for numpad 6 */
case KeyNum6: return tr("Num6");
/*: Keyboard key for numpad 7 */
case KeyNum7: return tr("Num7");
/*: Keyboard key for numpad 8 */
case KeyNum8: return tr("Num8");
/*: Keyboard key for numpad 9 */
case KeyNum9: return tr("Num9");
default: return QStringLiteral("???");
}
// clang-format on
}