Switch to KDE's translation system for QMl (now requires KDeclarative)

parent 721df26b
......@@ -90,9 +90,7 @@ else()
set(KF5_ICON_COMPATIBILITY TRUE)
endif()
find_package(KF5 REQUIRED COMPONENTS Archive Bookmarks CoreAddons Config ConfigWidgets
DBusAddons KIO WidgetsAddons NotifyConfig NewStuff XmlGui Notifications GuiAddons TextWidgets IconThemes Crash
OPTIONAL_COMPONENTS DocTools FileMetaData)
find_package(KF5 REQUIRED COMPONENTS Archive Bookmarks CoreAddons Config ConfigWidgets DBusAddons KIO WidgetsAddons NotifyConfig NewStuff XmlGui Notifications GuiAddons TextWidgets IconThemes Crash Declarative OPTIONAL_COMPONENTS DocTools FileMetaData)
if (KF5FileMetaData_FOUND)
message(STATUS "Found KF5 FileMetadata to extract file metadata")
......
......@@ -274,6 +274,7 @@ target_link_libraries(kdenlive
KF5::GuiAddons
KF5::Notifications
KF5::TextWidgets
KF5::Declarative
KF5::IconThemes
KF5::Crash
Qt5::Svg
......
......@@ -614,7 +614,7 @@ Rectangle {
}
MenuItem {
visible: true // !isBlank && !isTransition
text: qsTr('Cut')
text: i18n('Cut')
onTriggered: {
if (!trackRoot.isLocked) {
timeline.copyClip(trackIndex, index)
......@@ -626,30 +626,30 @@ Rectangle {
}
MenuItem {
visible: !grouped && trackRoot.selection.length > 1
text: qsTr('Group')
text: i18n('Group')
onTriggered: timeline.groupSelection()
}
MenuItem {
visible: grouped
text: qsTr('Ungroup')
text: i18n('Ungroup')
onTriggered: timeline.unGroupSelection(clipId)
}
MenuItem {
visible: true //!isBlank && !isTransition
text: qsTr('Copy')
text: i18n('Copy')
onTriggered: timeline.copyClip(trackIndex, index)
}
MenuSeparator {
visible: !isBlank && !isTransition
}
MenuItem {
text: qsTr('Remove')
text: i18n('Remove')
onTriggered: timeline.triggerAction('delete_timeline_clip')
}
MenuItem {
visible: true //!isBlank
text: qsTr('Lift')
text: i18n('Lift')
onTriggered: timeline.lift(trackIndex, index)
}
MenuSeparator {
......@@ -657,17 +657,17 @@ Rectangle {
}
MenuItem {
visible: true //!isBlank && !isTransition
text: qsTr('Split At Playhead (S)')
text: i18n('Split At Playhead (S)')
onTriggered: timeline.splitClip(trackIndex, index)
}
MenuItem {
id: mergeItem
text: qsTr('Merge with next clip')
text: i18n('Merge with next clip')
onTriggered: timeline.mergeClipWithNext(trackIndex, index, false)
}
MenuItem {
visible: !isBlank && !isTransition
text: qsTr('Rebuild Audio Waveform')
text: i18n('Rebuild Audio Waveform')
onTriggered: timeline.remakeAudioLevels(trackIndex, index)
}
/*onPopupVisibleChanged: {
......
......@@ -110,7 +110,7 @@ Rectangle {
onClicked: {
trackHeadRoot.myTrackHeight = buttonBar.visible ? nameEdit.height : '100'
}
tooltip: buttonBar.visible? qsTr('Minimize') : qsTr('Expand')
tooltip: buttonBar.visible? i18n('Minimize') : i18n('Expand')
}
Rectangle {
id: trackLabel
......@@ -219,7 +219,7 @@ Rectangle {
iconName: isMute ? 'kdenlive-hide-audio' : 'kdenlive-show-audio'
iconSource: isMute ? 'qrc:///pics/kdenlive-hide-audio.svgz' : 'qrc:///pics/kdenlive-show-audio.svgz'
onClicked: controller.setTrackProperty(trackId, "hide", isMute ? isHidden ? '1' : '0' : isHidden ? '3' : '2')
tooltip: isMute? qsTr('Unmute') : qsTr('Mute')
tooltip: isMute? i18n('Unmute') : i18n('Mute')
}
ToolButton {
......@@ -230,7 +230,7 @@ Rectangle {
iconName: isHidden ? 'kdenlive-hide-video' : 'kdenlive-show-video'
iconSource: isHidden? 'qrc:///pics/kdenlive-hide-video.svgz' : 'qrc:///pics/kdenlive-show-video.svgz'
onClicked: controller.setTrackProperty(trackId, "hide", isHidden ? isMute ? '2' : '0' : isMute ? '3' : '1')
tooltip: isHidden? qsTr('Show') : qsTr('Hide')
tooltip: isHidden? i18n('Show') : i18n('Hide')
}
ToolButton {
......@@ -240,7 +240,7 @@ Rectangle {
iconName: isLocked ? 'kdenlive-lock' : 'kdenlive-unlock'
iconSource: isLocked ? 'qrc:///pics/kdenlive-lock.svgz' : 'qrc:///pics/kdenlive-unlock.svgz'
onClicked: controller.setTrackProperty(trackId, "kdenlive:locked_track", isLocked ? '0' : '1')
tooltip: isLocked? qsTr('Unlock track') : qsTr('Lock track')
tooltip: isLocked? i18n('Unlock track') : i18n('Lock track')
}
}
Rectangle {
......
......@@ -131,7 +131,7 @@ Rectangle {
Menu {
id: menu
MenuItem {
text: qsTr('Add Audio Track')
text: i18n('Add Audio Track')
shortcut: 'Ctrl+U'
onTriggered: timeline.addAudioTrack();
}
......@@ -139,12 +139,12 @@ Rectangle {
Menu {
id: headerMenu
MenuItem {
text: qsTr('Add Track')
text: i18n('Add Track')
shortcut: 'Ctrl+U'
onTriggered: timeline.addTrack(currentTrack);
}
MenuItem {
text: qsTr('Delete Track')
text: i18n('Delete Track')
//shortcut: 'Ctrl+U'
onTriggered: timeline.deleteTrack(currentTrack);
}
......
......@@ -29,6 +29,7 @@
#include "bin/bin.h"
#include <KActionCollection>
#include <KDeclarative/KDeclarative>
// #include <QUrl>
#include <QQuickItem>
#include <QQmlContext>
......@@ -54,6 +55,10 @@ TimelineWidget::TimelineWidget(KActionCollection *actionCollection, BinControlle
proxyModel->setSortRole(TimelineItemModel::ItemIdRole);
proxyModel->sort(0, Qt::DescendingOrder);
KDeclarative::KDeclarative kdeclarative;
kdeclarative.setDeclarativeEngine(engine());
kdeclarative.initialize();
kdeclarative.setupBindings();
setResizeMode(QQuickWidget::SizeRootObjectToView);
rootContext()->setContextProperty("multitrack", proxyModel);
rootContext()->setContextProperty("controller", m_model.get());
......
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