summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPrasanth Ullattil <prasanth.ullattil@nokia.com>2010-09-23 11:43:26 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2010-09-24 01:27:48 (GMT)
commit3c68304a73e52a2cca5bfc0e43b379d2857bd92a (patch)
treeab89a790f9b52bfcb5cdd1a224ff5bd25d3bbc96
parent6fd33c5028632d279646dcd2f6857f0602a07fe5 (diff)
downloadQt-3c68304a73e52a2cca5bfc0e43b379d2857bd92a.zip
Qt-3c68304a73e52a2cca5bfc0e43b379d2857bd92a.tar.gz
Qt-3c68304a73e52a2cca5bfc0e43b379d2857bd92a.tar.bz2
Incorrect translations for application menu items on Mac OS X.
This is a regression fron 4.6 release. Menu entries with some specific roles are automatically merged to the application menu. They are now translated based on the context "MAC_APPLICATION_MENU" instead of "QMenuBar" context. This patch eanbles the use for both contexts. Task-number: QTBUG-13878 Reviewed-by: Richard Moe Gustavsen (cherry picked from commit 7d878ba53909157cf1911c30ce973378589c2cc0)
-rw-r--r--src/gui/kernel/qapplication.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 43d5772..185af9a 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -2397,8 +2397,13 @@ static const char *application_menu_strings[] = {
};
QString qt_mac_applicationmenu_string(int type)
{
- return qApp->translate("MAC_APPLICATION_MENU",
- application_menu_strings[type]);
+ QString menuString = QString::fromLatin1(application_menu_strings[type]);
+ QString translated = qApp->translate("QMenuBar", application_menu_strings[type]);
+ if (translated != menuString)
+ return translated;
+ else
+ return qApp->translate("MAC_APPLICATION_MENU",
+ application_menu_strings[type]);
}
#endif
#endif