From f3f979cbd37f47892cd0c0a9fc23b802ed6f7890 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Thu, 18 Mar 2010 10:25:38 +0100 Subject: Incorrect translation for Application menu items in Mac. A behavior change was introduced by the commit 97b8727635a73197fac4f5edb8a1122733933db4. The menu items with menuRoles will now be translated like Native Mac applications. Translations/merging of menu items are done as follows: 1) AboutRole ==> "About " 2) PreferencesRole ==> "Preferences..." 3) QuitRole ==> "Quit " Task-number: QTBUG-4463 Reviewed-by: mortens --- src/gui/kernel/qapplication.cpp | 7 ++++--- src/gui/kernel/qcocoamenuloader_mac.mm | 3 +++ src/gui/widgets/qmenu_mac.mm | 22 +++++++--------------- translations/qt_da.ts | 15 +++++++++++++++ translations/qt_de.ts | 15 +++++++++++++++ translations/qt_es.ts | 15 +++++++++++++++ translations/qt_fr.ts | 15 +++++++++++++++ translations/qt_ja_JP.ts | 15 +++++++++++++++ translations/qt_pl.ts | 15 +++++++++++++++ translations/qt_pt.ts | 15 +++++++++++++++ translations/qt_ru.ts | 15 +++++++++++++++ translations/qt_sv.ts | 15 +++++++++++++++ translations/qt_zh_CN.ts | 15 +++++++++++++++ translations/qt_zh_TW.ts | 15 +++++++++++++++ 14 files changed, 179 insertions(+), 18 deletions(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index fea8c37..a2666f7 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -2309,12 +2309,14 @@ static bool qt_detectRTLLanguage() " languages or to 'RTL' in right-to-left languages (such as Hebrew" " and Arabic) to get proper widget layout.") == QLatin1String("RTL")); } -#if defined(QT_MAC_USE_COCOA) static const char *application_menu_strings[] = { QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Services"), QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Hide %1"), QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Hide Others"), - QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Show All") + QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Show All"), + QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Preferences..."), + QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","Quit %1"), + QT_TRANSLATE_NOOP("MAC_APPLICATION_MENU","About %1") }; QString qt_mac_applicationmenu_string(int type) { @@ -2322,7 +2324,6 @@ QString qt_mac_applicationmenu_string(int type) application_menu_strings[type]); } #endif -#endif /*!\reimp diff --git a/src/gui/kernel/qcocoamenuloader_mac.mm b/src/gui/kernel/qcocoamenuloader_mac.mm index 35d156a..b58fd7c 100644 --- a/src/gui/kernel/qcocoamenuloader_mac.mm +++ b/src/gui/kernel/qcocoamenuloader_mac.mm @@ -231,6 +231,9 @@ QT_USE_NAMESPACE [hideItem setTitle: qt_mac_QStringToNSString(qt_mac_applicationmenu_string(1).arg(qAppName()))]; [hideAllOthersItem setTitle: qt_mac_QStringToNSString(qt_mac_applicationmenu_string(2))]; [showAllItem setTitle: qt_mac_QStringToNSString(qt_mac_applicationmenu_string(3))]; + [preferencesItem setTitle: qt_mac_QStringToNSString(qt_mac_applicationmenu_string(4))]; + [quitItem setTitle: qt_mac_QStringToNSString(qt_mac_applicationmenu_string(5).arg(qAppName()))]; + [aboutItem setTitle: qt_mac_QStringToNSString(qt_mac_applicationmenu_string(6).arg(qAppName()))]; #endif } diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm index 627043d..9a14ce6 100644 --- a/src/gui/widgets/qmenu_mac.mm +++ b/src/gui/widgets/qmenu_mac.mm @@ -909,6 +909,7 @@ static NSMenuItem *qt_mac_menu_merge_action(OSMenuRef merge, QMacMenuAction *act static QString qt_mac_menu_merge_text(QMacMenuAction *action) { QString ret; + extern QString qt_mac_applicationmenu_string(int type); #ifdef QT_MAC_USE_COCOA QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *loader = getMenuLoader(); #endif @@ -916,34 +917,25 @@ static QString qt_mac_menu_merge_text(QMacMenuAction *action) ret = action->action->text(); #ifndef QT_MAC_USE_COCOA else if (action->command == kHICommandAbout) - ret = QMenuBar::tr("About %1").arg(qAppName()); + ret = qt_mac_applicationmenu_string(6).arg(qAppName()); else if (action->command == kHICommandAboutQt) ret = QMenuBar::tr("About Qt"); else if (action->command == kHICommandPreferences) - ret = QMenuBar::tr("Preferences"); + ret = qt_mac_applicationmenu_string(4); else if (action->command == kHICommandQuit) - ret = QMenuBar::tr("Quit %1").arg(qAppName()); + ret = qt_mac_applicationmenu_string(5).arg(qAppName()); #else else if (action->menuItem == [loader aboutMenuItem]) { - if (action->action->text() == QString("About %1").arg(qAppName())) - ret = QMenuBar::tr("About %1").arg(qAppName()); - else - ret = action->action->text(); + ret = qt_mac_applicationmenu_string(6).arg(qAppName()); } else if (action->menuItem == [loader aboutQtMenuItem]) { if (action->action->text() == QString("About Qt")) ret = QMenuBar::tr("About Qt"); else ret = action->action->text(); } else if (action->menuItem == [loader preferencesMenuItem]) { - if (action->action->text() == QString("Preferences")) - ret = QMenuBar::tr("Preferences"); - else - ret = action->action->text(); + ret = qt_mac_applicationmenu_string(4); } else if (action->menuItem == [loader quitMenuItem]) { - if (action->action->text() == QString("Quit %1").arg(qAppName())) - ret = QMenuBar::tr("About %1").arg(qAppName()); - else - ret = action->action->text(); + ret = qt_mac_applicationmenu_string(5).arg(qAppName()); } #endif return ret; diff --git a/translations/qt_da.ts b/translations/qt_da.ts index 515ed50..6d52fc2 100644 --- a/translations/qt_da.ts +++ b/translations/qt_da.ts @@ -23,6 +23,21 @@ Show All Vis alle + + + Preferences... + Indstillinger… + + + + Quit %1 + Slut %1 + + + + About %1 + Om %1 + AudioOutput diff --git a/translations/qt_de.ts b/translations/qt_de.ts index 2108774..6289834 100644 --- a/translations/qt_de.ts +++ b/translations/qt_de.ts @@ -23,6 +23,21 @@ Show All Alle anzeigen + + + Preferences... + Einstellungen … + + + + Quit %1 + %1 beenden + + + + About %1 + Über %1 + CloseButton diff --git a/translations/qt_es.ts b/translations/qt_es.ts index 596864a..4fa4762 100644 --- a/translations/qt_es.ts +++ b/translations/qt_es.ts @@ -23,6 +23,21 @@ Show All Mostrar todo + + + Preferences... + Preferencias… + + + + Quit %1 + Salir de %1 + + + + About %1 + Acerca de %1 + AudioOutput diff --git a/translations/qt_fr.ts b/translations/qt_fr.ts index 322fb65..7a69cbe 100644 --- a/translations/qt_fr.ts +++ b/translations/qt_fr.ts @@ -23,6 +23,21 @@ Show All Tout afficher + + + Preferences... + Préférences… + + + + Quit %1 + Quitter %1 + + + + About %1 + À propos de %1 + AudioOutput diff --git a/translations/qt_ja_JP.ts b/translations/qt_ja_JP.ts index f0dae3a..e6f92b7 100644 --- a/translations/qt_ja_JP.ts +++ b/translations/qt_ja_JP.ts @@ -23,6 +23,21 @@ Show All すべてを表示 + + + Preferences... + 環境設定... + + + + Quit %1 + %1 を終了 + + + + About %1 + %1 について + CloseButton diff --git a/translations/qt_pl.ts b/translations/qt_pl.ts index bf6e1fe..db7d2c5 100644 --- a/translations/qt_pl.ts +++ b/translations/qt_pl.ts @@ -23,6 +23,21 @@ Show All Pokaż wszystko + + + Preferences... + Preferencje… + + + + Quit %1 + Zakończ %1 + + + + About %1 + %1… + CloseButton diff --git a/translations/qt_pt.ts b/translations/qt_pt.ts index 7ca7fe7..97afd4f 100644 --- a/translations/qt_pt.ts +++ b/translations/qt_pt.ts @@ -23,6 +23,21 @@ Show All Mostrar Tudo + + + Preferences... + Preferências… + + + + Quit %1 + Encerrar %1 + + + + About %1 + Sobre o %1 + AudioOutput diff --git a/translations/qt_ru.ts b/translations/qt_ru.ts index 641d7aa..e9cdfd4 100644 --- a/translations/qt_ru.ts +++ b/translations/qt_ru.ts @@ -23,6 +23,21 @@ Show All Показать все + + + Preferences... + Настройки… + + + + Quit %1 + Завершить %1 + + + + About %1 + О программе %1 + CloseButton diff --git a/translations/qt_sv.ts b/translations/qt_sv.ts index 391af4a..d4c8977 100644 --- a/translations/qt_sv.ts +++ b/translations/qt_sv.ts @@ -23,6 +23,21 @@ Show All Visa alla + + + Preferences... + Inställningar… + + + + Quit %1 + Avsluta %1 + + + + About %1 + Om %1 + AudioOutput diff --git a/translations/qt_zh_CN.ts b/translations/qt_zh_CN.ts index d6a995d..df23f43 100644 --- a/translations/qt_zh_CN.ts +++ b/translations/qt_zh_CN.ts @@ -23,6 +23,21 @@ Show All 全部显示 + + + Preferences... + 偏好设置… + + + + Quit %1 + 退出 %1 + + + + About %1 + 关于 %1 + AudioOutput diff --git a/translations/qt_zh_TW.ts b/translations/qt_zh_TW.ts index 50c0048..b29c879 100644 --- a/translations/qt_zh_TW.ts +++ b/translations/qt_zh_TW.ts @@ -23,6 +23,21 @@ Show All 顯示全部 + + + Preferences... + 偏好設定⋯ + + + + Quit %1 + 結束 %1 + + + + About %1 + 關於 %1 + AudioOutput -- cgit v0.12