diff options
author | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2010-03-02 15:38:42 (GMT) |
---|---|---|
committer | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2010-03-03 10:09:18 (GMT) |
commit | 97b8727635a73197fac4f5edb8a1122733933db4 (patch) | |
tree | c26ff6e831dfb5b9e9ff05015be1d4d14e702572 /src/gui/widgets/qmenu_mac.mm | |
parent | 94da62be34187a41be87339463ad09bf65e34ea1 (diff) | |
download | Qt-97b8727635a73197fac4f5edb8a1122733933db4.zip Qt-97b8727635a73197fac4f5edb8a1122733933db4.tar.gz Qt-97b8727635a73197fac4f5edb8a1122733933db4.tar.bz2 |
Application menu is not translated in Mac OS X Cocoa
The application menu is loaded from the qt_menu.nib which only has
English strings. These will now be translated using Qt's own translation
mechanism. Every time a new translator is installed, the menu will now
try to get the new string. Modification of qt_xx.ts files are done in a
different patch.
Task-number: QTBUG-4463
Reviewed-by: MortenS
Diffstat (limited to 'src/gui/widgets/qmenu_mac.mm')
-rw-r--r-- | src/gui/widgets/qmenu_mac.mm | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm index 99c550f..2570cb5 100644 --- a/src/gui/widgets/qmenu_mac.mm +++ b/src/gui/widgets/qmenu_mac.mm @@ -924,14 +924,27 @@ static QString qt_mac_menu_merge_text(QMacMenuAction *action) else if (action->command == kHICommandQuit) ret = QMenuBar::tr("Quit %1").arg(qAppName()); #else - else if (action->menuItem == [loader aboutMenuItem]) - ret = QMenuBar::tr("About %1").arg(qAppName()); - else if (action->menuItem == [loader aboutQtMenuItem]) - ret = QMenuBar::tr("About Qt"); - else if (action->menuItem == [loader preferencesMenuItem]) - ret = QMenuBar::tr("Preferences"); - else if (action->menuItem == [loader quitMenuItem]) - ret = QMenuBar::tr("Quit %1").arg(qAppName()); + 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(); + } 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(); + } 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(); + } #endif return ret; } @@ -2180,3 +2193,4 @@ static OSMenuRef qt_mac_create_menu(QWidget *w) QT_END_NAMESPACE + |