From 30e18cdbe0b9347269daccbed982af08f692a4b7 Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 3 Nov 2020 15:14:26 +0100 Subject: [PATCH] Gui: [skip ci] support of translation in undo/redo dialog --- src/Gui/DlgUndoRedo.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Gui/DlgUndoRedo.cpp b/src/Gui/DlgUndoRedo.cpp index 7ab8ac5f51..298d6e9c5a 100644 --- a/src/Gui/DlgUndoRedo.cpp +++ b/src/Gui/DlgUndoRedo.cpp @@ -22,6 +22,9 @@ #include "PreCompiled.h" +#ifndef _PreComp_ +#include +#endif #include "DlgUndoRedo.h" #include "Application.h" @@ -77,8 +80,10 @@ void UndoDialog::onFetchInfo() Gui::Document* pcDoc = mdi->getGuiDocument(); if (pcDoc) { std::vector vecUndos = pcDoc->getUndoVector(); - for (std::vector::iterator i = vecUndos.begin(); i != vecUndos.end(); ++i) - addAction(QString::fromUtf8((*i).c_str()), this, SLOT(onSelected())); + for (std::vector::iterator i = vecUndos.begin(); i != vecUndos.end(); ++i) { + QString text = QCoreApplication::translate("Command", i->c_str()); + addAction(text, this, SLOT(onSelected())); + } } } } @@ -140,8 +145,10 @@ void RedoDialog::onFetchInfo() Gui::Document* pcDoc = mdi->getGuiDocument(); if (pcDoc) { std::vector vecRedos = pcDoc->getRedoVector(); - for (std::vector::iterator i = vecRedos.begin(); i != vecRedos.end(); ++i) - addAction(QString::fromUtf8((*i).c_str()), this, SLOT(onSelected())); + for (std::vector::iterator i = vecRedos.begin(); i != vecRedos.end(); ++i) { + QString text = QCoreApplication::translate("Command", i->c_str()); + addAction(text, this, SLOT(onSelected())); + } } } }