Commit 7c9294c6 authored by Yuri Chornoivan's avatar Yuri Chornoivan
Browse files

Use translations for asset names in the Undo History

parent 299b02a0
......@@ -37,9 +37,9 @@ AssetCommand::AssetCommand(const std::shared_ptr<AssetParameterModel> &model, co
m_name = m_model->data(index, AssetParameterModel::NameRole).toString();
const QString id = model->getAssetId();
if (EffectsRepository::get()->exists(id)) {
setText(i18n("Edit %1", EffectsRepository::get()->getName(id)));
setText(i18n("Edit %1").arg(i18n(EffectsRepository::get()->getName(id).toUtf8().data())));
} else if (TransitionsRepository::get()->exists(id)) {
setText(i18n("Edit %1", TransitionsRepository::get()->getName(id)));
setText(i18n("Edit %1").arg(i18n(TransitionsRepository::get()->getName(id).toUtf8().data())));
}
QVariant previousVal = m_model->data(index, AssetParameterModel::ValueRole);
m_oldValue = previousVal.type() == QVariant::Double ? locale.toString(previousVal.toDouble()) : previousVal.toString();
......@@ -86,9 +86,9 @@ AssetMultiCommand::AssetMultiCommand(const std::shared_ptr<AssetParameterModel>
m_name = m_model->data(indexes.first(), AssetParameterModel::NameRole).toString();
const QString id = model->getAssetId();
if (EffectsRepository::get()->exists(id)) {
setText(i18n("Edit %1", EffectsRepository::get()->getName(id)));
setText(i18n("Edit %1").arg(i18n(EffectsRepository::get()->getName(id).toUtf8().data())));
} else if (TransitionsRepository::get()->exists(id)) {
setText(i18n("Edit %1", TransitionsRepository::get()->getName(id)));
setText(i18n("Edit %1").arg(i18n(TransitionsRepository::get()->getName(id).toUtf8().data())));
}
for (QModelIndex ix : m_indexes) {
QVariant previousVal = m_model->data(ix, AssetParameterModel::ValueRole);
......
......@@ -474,7 +474,7 @@ bool EffectStackModel::appendEffect(const QString &effectId, bool makeCurrent)
update();
PUSH_LAMBDA(update, redo);
PUSH_LAMBDA(update, undo);
PUSH_UNDO(undo, redo, i18n("Add effect %1", effectName));
PUSH_UNDO(undo, redo, i18n("Add effect %1").arg(i18n(effectName.toUtf8().data())));
} else if (makeCurrent) {
if (auto srvPtr = m_masterService.lock()) {
srvPtr->set("kdenlive:activeeffect", currentActive);
......@@ -749,7 +749,7 @@ void EffectStackModel::moveEffect(int destRow, const std::shared_ptr<AbstractEff
UPDATE_UNDO_REDO(update, update, undo, redo);
auto effectId = std::static_pointer_cast<EffectItemModel>(item)->getAssetId();
QString effectName = EffectsRepository::get()->getName(effectId);
PUSH_UNDO(undo, redo, i18n("Move effect %1", effectName));
PUSH_UNDO(undo, redo, i18n("Move effect %1").arg(i18n(effectName.toUtf8().data())));
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment