Bug 353880 - KActionMenu(const QIcon &icon, const QString &text, QObject *parent) failed to i18nc
Summary: KActionMenu(const QIcon &icon, const QString &text, QObject *parent) failed t...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-ki18n
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Chusslove Illich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-14 03:45 UTC by Leslie Zhai
Modified: 2016-08-10 02:50 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Leslie Zhai 2015-10-14 03:45:09 UTC
KActionMenu(const QIcon &icon, const QString &text, QObject *parent) failed to i18nc for Konsole https://twitter.com/xiangzhai/status/654138729271918592 when clicked the File menu on the top of Konsole, the New Tab failed to i18nc.

KActionMenu https://projects.kde.org/projects/frameworks/kwidgetsaddons/repository/revisions/master/entry/src/kactionmenu.cpp#L66 looks ok! is Qt5 bug?

KF5 Version: 5.15.0
Qt5 Version: 5.5.0

workaround patch for Konsole, but ... it is the huge work to change each KActionMenu:

diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp
index cbfec0c..b9936d5 100644
--- a/src/MainWindow.cpp
+++ b/src/MainWindow.cpp
@@ -291,6 +291,7 @@ void MainWindow::setupActions()
 
     // File Menu
     _newTabMenuAction = new KActionMenu(QIcon::fromTheme(QStringLiteral("tab-new")), i18nc("@action:inmenu", "&New Tab"), collection);
+    _newTabMenuAction->setText(i18nc("@action:inmenu", "&New Tab"));
     collection->setDefaultShortcut(_newTabMenuAction, Qt::CTRL + Qt::SHIFT + Qt::Key_T);
     collection->setShortcutsConfigurable(_newTabMenuAction, true);
     _newTabMenuAction->setAutoRepeat(false);

Reproducible: Always
Comment 1 Christoph Feck 2015-10-19 21:40:20 UTC
Odd workaround, because the constructor in kactionmenu.cpp also calls "setText()" with the given string.
Comment 2 Leslie Zhai 2016-08-10 02:50:42 UTC
kf5.24.0 fixed