From 345328432da8b10bb1d2afc14c5e37d32ffdb006 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sat, 12 Jan 2019 10:10:24 +1100 Subject: [PATCH] translation --- dialogs/aboutdialog.cpp | 12 +++- dialogs/actionsearch.cpp | 2 +- dialogs/debugdialog.cpp | 2 +- dialogs/demonotice.cpp | 17 ++++- dialogs/exportdialog.cpp | 91 +++++++++++++++--------- dialogs/loaddialog.cpp | 6 +- dialogs/mediapropertiesdialog.cpp | 41 ++++++++--- dialogs/newsequencedialog.cpp | 48 ++++++------- dialogs/preferencesdialog.cpp | 89 +++++++++++++---------- dialogs/replaceclipmediadialog.cpp | 38 +++++++--- dialogs/speeddialog.cpp | 14 ++-- dialogs/texteditdialog.cpp | 2 +- effects/internal/audionoiseeffect.cpp | 4 +- effects/internal/cornerpineffect.cpp | 10 +-- effects/internal/fillleftrighteffect.cpp | 6 +- effects/internal/paneffect.cpp | 2 +- effects/internal/shakeeffect.cpp | 6 +- effects/internal/solideffect.cpp | 14 ++-- effects/internal/texteffect.cpp | 46 ++++++------ effects/internal/timecodeeffect.cpp | 18 ++--- effects/internal/toneeffect.cpp | 8 +-- effects/internal/transformeffect.cpp | 22 +++--- effects/internal/voideffect.cpp | 4 +- effects/internal/volumeeffect.cpp | 2 +- effects/internal/vsthostwin.cpp | 20 +++--- io/exportthread.cpp | 36 +++++----- io/loadthread.cpp | 25 +++++-- io/previewgenerator.cpp | 4 +- olive.pro | 2 + panels/effectcontrols.cpp | 16 ++--- panels/grapheditor.cpp | 8 +-- panels/project.cpp | 45 ++++++++---- panels/timeline.cpp | 66 +++++++++-------- panels/viewer.cpp | 4 +- playback/audio.cpp | 4 +- playback/cacher.cpp | 2 +- project/effect.cpp | 13 ++-- project/effectrow.cpp | 5 +- project/media.cpp | 59 ++++++++------- project/sequence.cpp | 4 +- project/sourcescommon.cpp | 36 +++++----- project/transition.cpp | 8 ++- ui/collapsiblewidget.cpp | 2 +- ui/colorbutton.cpp | 2 +- ui/embeddedfilechooser.cpp | 2 +- ui/graphview.cpp | 6 +- ui/keyframenavigator.cpp | 2 +- ui/keyframeview.cpp | 6 +- ui/labelslider.cpp | 8 +-- ui/timelinewidget.cpp | 28 ++++---- ui/viewerwidget.cpp | 19 ++--- 51 files changed, 555 insertions(+), 381 deletions(-) diff --git a/dialogs/aboutdialog.cpp b/dialogs/aboutdialog.cpp index 7d1bdb7e9..653f0b859 100644 --- a/dialogs/aboutdialog.cpp +++ b/dialogs/aboutdialog.cpp @@ -14,7 +14,17 @@ AboutDialog::AboutDialog(QWidget *parent) : layout->setSpacing(20); setLayout(layout); - QLabel* label = new QLabel("

https://www.olivevideoeditor.org/

Olive is a non-linear video editor. This software is free and protected by the GNU GPL.

Olive Team is obliged to inform users that Olive source code is available for download from its website.

Olive uses (at least) the following libraries in accordance with the GNU GPL/LGPL:

Qt, FFmpeg, libass, libfreetype, libmp3lame, libopenjpeg, libopus, libtheora, libtwolame, libvpx, libwavpack, libwebp, libx264, libx265, lzma, bzlib, zlib, libvidstab, libvorbis.

"); + QLabel* label = + new QLabel("" + "

" + "

" + "" + "https://www.olivevideoeditor.org/" + "

" + + tr("Olive is a non-linear video editor. This software is free and protected by the GNU GPL.") + + "

" + + tr("Olive Team is obliged to inform users that Olive source code is available for download from its website.") + + "

"); label->setAlignment(Qt::AlignCenter); label->setWordWrap(true); layout->addWidget(label); diff --git a/dialogs/actionsearch.cpp b/dialogs/actionsearch.cpp index 3f5593dbe..8641cf584 100644 --- a/dialogs/actionsearch.cpp +++ b/dialogs/actionsearch.cpp @@ -23,7 +23,7 @@ ActionSearch::ActionSearch(QWidget *parent) : QFont entry_field_font = entry_field->font(); entry_field_font.setPointSize(entry_field_font.pointSize()*1.2); entry_field->setFont(entry_field_font); - entry_field->setPlaceholderText("Search for action..."); + entry_field->setPlaceholderText(tr("Search for action...")); connect(entry_field, SIGNAL(textChanged(const QString&)), this, SLOT(search_update(const QString &))); connect(entry_field, SIGNAL(returnPressed()), this, SLOT(perform_action())); connect(entry_field, SIGNAL(moveSelectionUp()), this, SLOT(move_selection_up())); diff --git a/dialogs/debugdialog.cpp b/dialogs/debugdialog.cpp index b70b24bab..614f68e1c 100644 --- a/dialogs/debugdialog.cpp +++ b/dialogs/debugdialog.cpp @@ -8,7 +8,7 @@ DebugDialog* debug_dialog = NULL; DebugDialog::DebugDialog(QWidget *parent) : QDialog(parent) { - setWindowTitle("Debug Log"); + setWindowTitle(tr("Debug Log")); QVBoxLayout* layout = new QVBoxLayout(); setLayout(layout); diff --git a/dialogs/demonotice.cpp b/dialogs/demonotice.cpp index d16f9bd47..b47bb9fc1 100644 --- a/dialogs/demonotice.cpp +++ b/dialogs/demonotice.cpp @@ -7,7 +7,7 @@ DemoNotice::DemoNotice(QWidget *parent) : QDialog(parent) { - setWindowTitle("Welcome to Olive!"); + setWindowTitle(tr("Welcome to Olive!")); setMaximumWidth(600); QVBoxLayout* vlayout = new QVBoxLayout(); @@ -17,10 +17,21 @@ DemoNotice::DemoNotice(QWidget *parent) : layout->setMargin(10); layout->setSpacing(20); - QLabel* icon = new QLabel("

"); + QLabel* icon = new QLabel("" + "

" + ""); layout->addWidget(icon); - QLabel* text = new QLabel("

Welcome to Olive!

Olive is a free open-source video editor released under the GNU GPL. If you have paid for this software, you have been scammed.

This software is currently in ALPHA which means it is unstable and very likely to crash, have bugs, and have missing features. We offer no warranty so use at your own risk. Please report any bugs or feature requests at www.olivevideoeditor.org

Thank you for trying Olive and we hope you enjoy it!

"); + QLabel* text = new QLabel("

" + "" + + tr("Welcome to Olive!") + + "

" + + tr("Olive is a free open-source video editor released under the GNU GPL. If you have paid for this software, you have been scammed.") + + "

" + + tr("This software is currently in ALPHA which means it is unstable and very likely to crash, have bugs, and have missing features. We offer no warranty so use at your own risk. Please report any bugs or feature requests at %1").arg("www.olivevideoeditor.org") + + "

" + + tr("Thank you for trying Olive and we hope you enjoy it!") + + "

"); text->setWordWrap(true); layout->addWidget(text); diff --git a/dialogs/exportdialog.cpp b/dialogs/exportdialog.cpp index edcafc1f9..97349fd19 100644 --- a/dialogs/exportdialog.cpp +++ b/dialogs/exportdialog.cpp @@ -57,7 +57,7 @@ enum ExportFormats { ExportDialog::ExportDialog(QWidget *parent) : QDialog(parent) { - setWindowTitle("Export \"" + sequence->name + "\""); + setWindowTitle(tr("Export \"%1\"").arg(sequence->name)); setup_ui(); rangeCombobox->setCurrentIndex(0); @@ -320,7 +320,12 @@ void ExportDialog::format_changed(int index) void ExportDialog::render_thread_finished() { if (progressBar->value() < 100 && !cancelled) { - QMessageBox::critical(this, "Export Failed", "Export failed - " + export_error, QMessageBox::Ok); + QMessageBox::critical( + this, + tr("Export Failed"), + tr("Export failed - %1").arg(export_error), + QMessageBox::Ok + ); } prep_ui_for_render(false); panel_sequence_viewer->viewer_widget->makeCurrent(); @@ -337,7 +342,12 @@ void ExportDialog::prep_ui_for_render(bool r) { void ExportDialog::export_action() { if (widthSpinbox->value()%2 == 1 || heightSpinbox->value()%2 == 1) { - QMessageBox::critical(this, "Invalid dimensions", "Export width and height must both be even numbers/divisible by 2.", QMessageBox::Ok); + QMessageBox::critical( + this, + tr("Invalid dimensions"), + tr("Export width and height must both be even numbers/divisible by 2."), + QMessageBox::Ok + ); return; } @@ -389,7 +399,12 @@ void ExportDialog::export_action() { break; default: qCritical() << "Invalid codec selection for an image sequence"; - QMessageBox::critical(this, "Invalid codec", "Couldn't determine output parameters for the selected codec. This is a bug, please contact the developers.", QMessageBox::Ok); + QMessageBox::critical( + this, + tr("Invalid codec"), + tr("Couldn't determine output parameters for the selected codec. This is a bug, please contact the developers."), + QMessageBox::Ok + ); return; } break; @@ -454,10 +469,20 @@ void ExportDialog::export_action() { break; default: qCritical() << "Invalid format - this is a bug, please inform the developers"; - QMessageBox::critical(this, "Invalid format", "Couldn't determine output format. This is a bug, please contact the developers.", QMessageBox::Ok); + QMessageBox::critical( + this, + tr("Invalid format"), + tr("Couldn't determine output format. This is a bug, please contact the developers."), + QMessageBox::Ok + ); return; } - QString filename = QFileDialog::getSaveFileName(this, "Export Media", "", format_strings[formatCombobox->currentIndex()] + " (*." + ext + ")"); + QString filename = QFileDialog::getSaveFileName( + this, + tr("Export Media"), + "", + format_strings[formatCombobox->currentIndex()] + " (*." + ext + ")" + ); if (!filename.isEmpty()) { if (!filename.endsWith("." + ext, Qt::CaseInsensitive)) { filename += "." + ext; @@ -540,11 +565,11 @@ void ExportDialog::vcodec_changed(int index) { compressionTypeCombobox->clear(); if ((format_vcodecs.size() > 0 && format_vcodecs.at(index) == AV_CODEC_ID_H264)) { compressionTypeCombobox->setEnabled(true); - compressionTypeCombobox->addItem("Quality-based (Constant Rate Factor)", COMPRESSION_TYPE_CFR); + compressionTypeCombobox->addItem(tr("Quality-based (Constant Rate Factor)"), COMPRESSION_TYPE_CFR); // compressionTypeCombobox->addItem("File size-based (Two-Pass)", COMPRESSION_TYPE_TARGETSIZE); // compressionTypeCombobox->addItem("Average bitrate (Two-Pass)", COMPRESSION_TYPE_TARGETBR); } else { - compressionTypeCombobox->addItem("Constant Bitrate", COMPRESSION_TYPE_CBR); + compressionTypeCombobox->addItem(tr("Constant Bitrate"), COMPRESSION_TYPE_CBR); compressionTypeCombobox->setCurrentIndex(0); compressionTypeCombobox->setEnabled(false); } @@ -557,17 +582,17 @@ void ExportDialog::comp_type_changed(int) { switch (compressionTypeCombobox->currentData().toInt()) { case COMPRESSION_TYPE_CBR: case COMPRESSION_TYPE_TARGETBR: - videoBitrateLabel->setText("Bitrate (Mbps):"); + videoBitrateLabel->setText(tr("Bitrate (Mbps):")); videobitrateSpinbox->setValue(qMax(0.5, (double) qRound((0.01528 * sequence->height) - 4.5))); break; case COMPRESSION_TYPE_CFR: - videoBitrateLabel->setText("Quality (CRF):"); + videoBitrateLabel->setText(tr("Quality (CRF):")); videobitrateSpinbox->setValue(36); videobitrateSpinbox->setMaximum(51); - videobitrateSpinbox->setToolTip("Quality Factor:\n\n0 = lossless\n17-18 = visually lossless (compressed, but unnoticeable)\n23 = high quality\n51 = lowest quality possible"); + videobitrateSpinbox->setToolTip(tr("Quality Factor:\n\n0 = lossless\n17-18 = visually lossless (compressed, but unnoticeable)\n23 = high quality\n51 = lowest quality possible")); break; case COMPRESSION_TYPE_TARGETSIZE: - videoBitrateLabel->setText("Target File Size (MB):"); + videoBitrateLabel->setText(tr("Target File Size (MB):")); videobitrateSpinbox->setValue(100); break; } @@ -576,59 +601,57 @@ void ExportDialog::comp_type_changed(int) { void ExportDialog::setup_ui() { QVBoxLayout* verticalLayout = new QVBoxLayout(this); - QHBoxLayout* horizontalLayout = new QHBoxLayout(); + QHBoxLayout* format_layout = new QHBoxLayout(); - horizontalLayout->addWidget(new QLabel("Format:")); + format_layout->addWidget(new QLabel(tr("Format:"))); formatCombobox = new QComboBox(this); - horizontalLayout->addWidget(formatCombobox); + format_layout->addWidget(formatCombobox); - verticalLayout->addLayout(horizontalLayout); + verticalLayout->addLayout(format_layout); - QHBoxLayout* horizontalLayout_4 = new QHBoxLayout(); + QHBoxLayout* range_layout = new QHBoxLayout(); - horizontalLayout_4->addWidget(new QLabel("Range:")); + range_layout->addWidget(new QLabel(tr("Range:"))); rangeCombobox = new QComboBox(this); - rangeCombobox->addItem("Entire Sequence"); - rangeCombobox->addItem("In to Out"); + rangeCombobox->addItem(tr("Entire Sequence")); + rangeCombobox->addItem(tr("In to Out")); - horizontalLayout_4->addWidget(rangeCombobox); + range_layout->addWidget(rangeCombobox); - verticalLayout->addLayout(horizontalLayout_4); + verticalLayout->addLayout(range_layout); videoGroupbox = new QGroupBox(this); - videoGroupbox->setTitle("Video"); + videoGroupbox->setTitle(tr("Video")); videoGroupbox->setFlat(false); videoGroupbox->setCheckable(true); QGridLayout* videoGridLayout = new QGridLayout(videoGroupbox); - videoGridLayout->addWidget(new QLabel("Codec:"), 0, 0, 1, 1); + videoGridLayout->addWidget(new QLabel(tr("Codec:")), 0, 0, 1, 1); vcodecCombobox = new QComboBox(videoGroupbox); videoGridLayout->addWidget(vcodecCombobox, 0, 1, 1, 1); - videoGridLayout->addWidget(new QLabel("Width:"), 1, 0, 1, 1); + videoGridLayout->addWidget(new QLabel(tr("Width:")), 1, 0, 1, 1); widthSpinbox = new QSpinBox(videoGroupbox); widthSpinbox->setMaximum(16777216); videoGridLayout->addWidget(widthSpinbox, 1, 1, 1, 1); - videoGridLayout->addWidget(new QLabel("Height:"), 2, 0, 1, 1); + videoGridLayout->addWidget(new QLabel(tr("Height:")), 2, 0, 1, 1); heightSpinbox = new QSpinBox(videoGroupbox); heightSpinbox->setMaximum(16777216); videoGridLayout->addWidget(heightSpinbox, 2, 1, 1, 1); - videoGridLayout->addWidget(new QLabel("Frame Rate:"), 3, 0, 1, 1); + videoGridLayout->addWidget(new QLabel(tr("Frame Rate:")), 3, 0, 1, 1); framerateSpinbox = new QDoubleSpinBox(videoGroupbox); framerateSpinbox->setMaximum(60); framerateSpinbox->setValue(0); videoGridLayout->addWidget(framerateSpinbox, 3, 1, 1, 1); - videoGridLayout->addWidget(new QLabel("Compression Type:"), 4, 0, 1, 1); - compressionTypeCombobox = new QComboBox(videoGroupbox); - compressionTypeCombobox->addItem("Quality-based (Constant Rate Factor)"); - compressionTypeCombobox->addItem("File size-based (Two-Pass)"); + videoGridLayout->addWidget(new QLabel(tr("Compression Type:")), 4, 0, 1, 1); + compressionTypeCombobox = new QComboBox(videoGroupbox); videoGridLayout->addWidget(compressionTypeCombobox, 4, 1, 1, 1); videoBitrateLabel = new QLabel(videoGroupbox); @@ -646,17 +669,17 @@ void ExportDialog::setup_ui() { QGridLayout* audioGridLayout = new QGridLayout(audioGroupbox); - audioGridLayout->addWidget(new QLabel("Codec:"), 0, 0, 1, 1); + audioGridLayout->addWidget(new QLabel(tr("Codec:")), 0, 0, 1, 1); acodecCombobox = new QComboBox(audioGroupbox); audioGridLayout->addWidget(acodecCombobox, 0, 1, 1, 1); - audioGridLayout->addWidget(new QLabel("Sampling Rate:"), 1, 0, 1, 1); + audioGridLayout->addWidget(new QLabel(tr("Sampling Rate:")), 1, 0, 1, 1); samplingRateSpinbox = new QSpinBox(audioGroupbox); samplingRateSpinbox->setMaximum(96000); samplingRateSpinbox->setValue(0); audioGridLayout->addWidget(samplingRateSpinbox, 1, 1, 1, 1); - audioGridLayout->addWidget(new QLabel("Bitrate (Kbps/CBR):"), 3, 0, 1, 1); + audioGridLayout->addWidget(new QLabel(tr("Bitrate (Kbps/CBR):")), 3, 0, 1, 1); audiobitrateSpinbox = new QSpinBox(audioGroupbox); audiobitrateSpinbox->setMaximum(320); audiobitrateSpinbox->setValue(256); diff --git a/dialogs/loaddialog.cpp b/dialogs/loaddialog.cpp index 3751ebea9..a0ac2a434 100644 --- a/dialogs/loaddialog.cpp +++ b/dialogs/loaddialog.cpp @@ -14,19 +14,19 @@ #include "mainwindow.h" LoadDialog::LoadDialog(QWidget *parent, bool autorecovery) : QDialog(parent) { - setWindowTitle("Loading..."); + setWindowTitle(tr("Loading...")); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); QVBoxLayout* layout = new QVBoxLayout(); setLayout(layout); - layout->addWidget(new QLabel("Loading '" + project_url.mid(project_url.lastIndexOf('/')+1) + "'...")); + layout->addWidget(new QLabel(tr("Loading '%1'...").arg(project_url.mid(project_url.lastIndexOf('/')+1)))); bar = new QProgressBar(); bar->setValue(0); layout->addWidget(bar); - cancel_button = new QPushButton("Cancel"); + cancel_button = new QPushButton(tr("Cancel")); connect(cancel_button, SIGNAL(clicked(bool)), this, SLOT(cancel())); hboxLayout = new QHBoxLayout(); diff --git a/dialogs/mediapropertiesdialog.cpp b/dialogs/mediapropertiesdialog.cpp index f8f128b95..188187f3f 100644 --- a/dialogs/mediapropertiesdialog.cpp +++ b/dialogs/mediapropertiesdialog.cpp @@ -19,7 +19,7 @@ MediaPropertiesDialog::MediaPropertiesDialog(QWidget *parent, Media *i) : QDialog(parent), item(i) { - setWindowTitle("\"" + i->get_name() + "\" Properties"); + setWindowTitle(tr("\"%1\" Properties").arg(i->get_name())); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); QGridLayout* grid = new QGridLayout(); @@ -29,13 +29,21 @@ MediaPropertiesDialog::MediaPropertiesDialog(QWidget *parent, Media *i) : Footage* f = item->to_footage(); - grid->addWidget(new QLabel("Tracks:"), row, 0, 1, 2); + grid->addWidget(new QLabel(tr("Tracks:")), row, 0, 1, 2); row++; track_list = new QListWidget(); for (int i=0;ivideo_tracks.size();i++) { const FootageStream& fs = f->video_tracks.at(i); - QListWidgetItem* item = new QListWidgetItem("Video " + QString::number(fs.file_index) + ": " + QString::number(fs.video_width) + "x" + QString::number(fs.video_height) + " " + QString::number(fs.video_frame_rate) + "FPS"); + + QListWidgetItem* item = new QListWidgetItem( + tr("Video %1: %2x%3 %4FPS").arg( + QString::number(fs.file_index), + QString::number(fs.video_width), + QString::number(fs.video_height), + QString::number(fs.video_frame_rate) + ) + ); item->setFlags(item->flags() | Qt::ItemIsUserCheckable); item->setCheckState(fs.enabled ? Qt::Checked : Qt::Unchecked); item->setData(Qt::UserRole+1, fs.file_index); @@ -43,7 +51,13 @@ MediaPropertiesDialog::MediaPropertiesDialog(QWidget *parent, Media *i) : } for (int i=0;iaudio_tracks.size();i++) { const FootageStream& fs = f->audio_tracks.at(i); - QListWidgetItem* item = new QListWidgetItem("Audio " + QString::number(fs.file_index) + ": " + QString::number(fs.audio_frequency) + "Hz " + QString::number(fs.audio_channels) + " channels"); + QListWidgetItem* item = new QListWidgetItem( + tr("Audio %1: %2Hz %3 channels").arg( + QString::number(fs.file_index), + QString::number(fs.audio_frequency), + QString::number(fs.audio_channels) + ) + ); item->setFlags(item->flags() | Qt::ItemIsUserCheckable); item->setCheckState(fs.enabled ? Qt::Checked : Qt::Unchecked); item->setData(Qt::UserRole+1, fs.file_index); @@ -55,7 +69,7 @@ MediaPropertiesDialog::MediaPropertiesDialog(QWidget *parent, Media *i) : if (f->video_tracks.size() > 0) { // frame conforming if (!f->video_tracks.at(0).infinite_length) { - grid->addWidget(new QLabel("Conform to Frame Rate:"), row, 0); + grid->addWidget(new QLabel(tr("Conform to Frame Rate:")), row, 0); conform_fr = new QDoubleSpinBox(); conform_fr->setMinimum(0.01); conform_fr->setValue(f->video_tracks.at(0).video_frame_rate * f->speed); @@ -65,22 +79,29 @@ MediaPropertiesDialog::MediaPropertiesDialog(QWidget *parent, Media *i) : row++; // deinterlacing mode - interlacing_box = new QComboBox(); - interlacing_box->addItem("Auto (" + get_interlacing_name(f->video_tracks.at(0).video_auto_interlacing) + ")"); + interlacing_box = new QComboBox(); + interlacing_box->addItem( + tr("Auto (%1)").arg( + get_interlacing_name(f->video_tracks.at(0).video_auto_interlacing) + ) + ); interlacing_box->addItem(get_interlacing_name(VIDEO_PROGRESSIVE)); interlacing_box->addItem(get_interlacing_name(VIDEO_TOP_FIELD_FIRST)); interlacing_box->addItem(get_interlacing_name(VIDEO_BOTTOM_FIELD_FIRST)); - interlacing_box->setCurrentIndex((f->video_tracks.at(0).video_auto_interlacing == f->video_tracks.at(0).video_interlacing) ? 0 : f->video_tracks.at(0).video_interlacing + 1); + interlacing_box->setCurrentIndex( + (f->video_tracks.at(0).video_auto_interlacing == f->video_tracks.at(0).video_interlacing) + ? 0 + : f->video_tracks.at(0).video_interlacing + 1); - grid->addWidget(new QLabel("Interlacing:"), row, 0); + grid->addWidget(new QLabel(tr("Interlacing:")), row, 0); grid->addWidget(interlacing_box, row, 1); row++; } name_box = new QLineEdit(item->get_name()); - grid->addWidget(new QLabel("Name:"), row, 0); + grid->addWidget(new QLabel(tr("Name:")), row, 0); grid->addWidget(name_box, row, 1); row++; diff --git a/dialogs/newsequencedialog.cpp b/dialogs/newsequencedialog.cpp index 0451aa886..66e3b45dc 100644 --- a/dialogs/newsequencedialog.cpp +++ b/dialogs/newsequencedialog.cpp @@ -31,7 +31,7 @@ NewSequenceDialog::NewSequenceDialog(QWidget *parent, Media *existing) : if (existing != NULL) { existing_sequence = existing->to_sequence(); - setWindowTitle("Editing \"" + existing_sequence->name + "\""); + setWindowTitle(tr("Editing \"%1\"").arg(existing_sequence->name)); width_numeric->setValue(existing_sequence->width); height_numeric->setValue(existing_sequence->height); @@ -51,7 +51,7 @@ NewSequenceDialog::NewSequenceDialog(QWidget *parent, Media *existing) : } } else { existing_sequence = NULL; - setWindowTitle("New Sequence"); + setWindowTitle(tr("New Sequence")); } } @@ -157,21 +157,21 @@ void NewSequenceDialog::setup_ui() { QHBoxLayout* preset_layout = new QHBoxLayout(widget); preset_layout->setContentsMargins(0, 0, 0, 0); - preset_layout->addWidget(new QLabel("Preset:")); + preset_layout->addWidget(new QLabel(tr("Preset:"))); preset_combobox = new QComboBox(widget); - preset_combobox->addItem("Film 4K"); - preset_combobox->addItem("TV 4K (Ultra HD/2160p)"); - preset_combobox->addItem("1080p"); - preset_combobox->addItem("720p"); - preset_combobox->addItem("480p"); - preset_combobox->addItem("360p"); - preset_combobox->addItem("240p"); - preset_combobox->addItem("144p"); - preset_combobox->addItem("NTSC (480i)"); - preset_combobox->addItem("PAL (576i)"); - preset_combobox->addItem("Custom"); + preset_combobox->addItem(tr("Film 4K")); + preset_combobox->addItem(tr("TV 4K (Ultra HD/2160p)")); + preset_combobox->addItem(tr("1080p")); + preset_combobox->addItem(tr("720p")); + preset_combobox->addItem(tr("480p")); + preset_combobox->addItem(tr("360p")); + preset_combobox->addItem(tr("240p")); + preset_combobox->addItem(tr("144p")); + preset_combobox->addItem(tr("NTSC (480i)")); + preset_combobox->addItem(tr("PAL (576i)")); + preset_combobox->addItem(tr("Custom")); preset_combobox->setCurrentIndex(2); preset_layout->addWidget(preset_combobox); @@ -179,23 +179,23 @@ void NewSequenceDialog::setup_ui() { verticalLayout->addWidget(widget); QGroupBox* videoGroupBox = new QGroupBox(this); - videoGroupBox->setTitle("Video"); + videoGroupBox->setTitle(tr("Video")); QGridLayout* videoLayout = new QGridLayout(videoGroupBox); - videoLayout->addWidget(new QLabel("Width:"), 0, 0, 1, 1); + videoLayout->addWidget(new QLabel(tr("Width:")), 0, 0, 1, 1); width_numeric = new QSpinBox(videoGroupBox); width_numeric->setMaximum(9999); width_numeric->setValue(1920); videoLayout->addWidget(width_numeric, 0, 2, 1, 2); - videoLayout->addWidget(new QLabel("Height:"), 1, 0, 1, 2); + videoLayout->addWidget(new QLabel(tr("Height:")), 1, 0, 1, 2); height_numeric = new QSpinBox(videoGroupBox); height_numeric->setMaximum(9999); height_numeric->setValue(1080); videoLayout->addWidget(height_numeric, 1, 2, 1, 2); - videoLayout->addWidget(new QLabel("Frame Rate:"), 2, 0, 1, 1); + videoLayout->addWidget(new QLabel(tr("Frame Rate:")), 2, 0, 1, 1); frame_rate_combobox = new QComboBox(videoGroupBox); frame_rate_combobox->addItem("10 FPS", 10.0); frame_rate_combobox->addItem("12.5 FPS", 12.5); @@ -211,14 +211,14 @@ void NewSequenceDialog::setup_ui() { frame_rate_combobox->setCurrentIndex(6); videoLayout->addWidget(frame_rate_combobox, 2, 2, 1, 2); - videoLayout->addWidget(new QLabel("Pixel Aspect Ratio:"), 4, 0, 1, 1); + videoLayout->addWidget(new QLabel(tr("Pixel Aspect Ratio:")), 4, 0, 1, 1); par_combobox = new QComboBox(videoGroupBox); - par_combobox->addItem("Square Pixels (1.0)"); + par_combobox->addItem(tr("Square Pixels (1.0)")); videoLayout->addWidget(par_combobox, 4, 2, 1, 2); - videoLayout->addWidget(new QLabel("Interlacing:"), 6, 0, 1, 1); + videoLayout->addWidget(new QLabel(tr("Interlacing:")), 6, 0, 1, 1); interlacing_combobox = new QComboBox(videoGroupBox); - interlacing_combobox->addItem("None (Progressive)"); + interlacing_combobox->addItem(tr("None (Progressive)")); // interlacing_combobox->addItem("Upper Field First"); // interlacing_combobox->addItem("Lower Field First"); videoLayout->addWidget(interlacing_combobox, 6, 2, 1, 2); @@ -226,11 +226,11 @@ void NewSequenceDialog::setup_ui() { verticalLayout->addWidget(videoGroupBox); QGroupBox* audioGroupBox = new QGroupBox(this); - audioGroupBox->setTitle("Audio"); + audioGroupBox->setTitle(tr("Audio")); QGridLayout* audioLayout = new QGridLayout(audioGroupBox); - audioLayout->addWidget(new QLabel("Sample Rate: "), 0, 0, 1, 1); + audioLayout->addWidget(new QLabel(tr("Sample Rate: ")), 0, 0, 1, 1); audio_frequency_combobox = new QComboBox(audioGroupBox); audio_frequency_combobox->addItem("22050 Hz", 22050); diff --git a/dialogs/preferencesdialog.cpp b/dialogs/preferencesdialog.cpp index a730d6bb5..f6e8e8359 100644 --- a/dialogs/preferencesdialog.cpp +++ b/dialogs/preferencesdialog.cpp @@ -54,7 +54,7 @@ QString KeySequenceEditor::export_shortcut() { PreferencesDialog::PreferencesDialog(QWidget *parent) : QDialog(parent) { - setWindowTitle("Preferences"); + setWindowTitle(tr("Preferences")); setup_ui(); accurateSeekButton->setChecked(!config.fast_seeking); @@ -110,7 +110,11 @@ void PreferencesDialog::setup_kbd_shortcuts(QMenuBar* menubar) { void PreferencesDialog::save() { if (!custom_css_fn->text().isEmpty() && !QFileInfo::exists(custom_css_fn->text())) { - QMessageBox::critical(this, "Invalid CSS File", "CSS file '" + custom_css_fn->text() + "' does not exist."); + QMessageBox::critical( + this, + tr("Invalid CSS File"), + tr("CSS file '%1' does not exist.").arg(custom_css_fn->text()) + ); return; } @@ -142,7 +146,11 @@ void PreferencesDialog::reset_default_shortcut() { } void PreferencesDialog::reset_all_shortcuts() { - if (QMessageBox::question(this, "Confirm Reset All Shortcuts", "Are you sure you wish to reset all keyboard shortcuts to their defaults?", QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { + if (QMessageBox::question( + this, + tr("Confirm Reset All Shortcuts"), + tr("Are you sure you wish to reset all keyboard shortcuts to their defaults?"), + QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { for (int i=0;ireset_to_default(); } @@ -191,7 +199,7 @@ bool PreferencesDialog::refine_shortcut_list(const QString &s, QTreeWidgetItem* } void PreferencesDialog::load_shortcut_file() { - QString fn = QFileDialog::getOpenFileName(this, "Import Keyboard Shortcuts"); + QString fn = QFileDialog::getOpenFileName(this, tr("Import Keyboard Shortcuts")); if (!fn.isEmpty()) { QFile f(fn); if (f.exists() && f.open(QFile::ReadOnly)) { @@ -206,21 +214,24 @@ void PreferencesDialog::load_shortcut_file() { while (index < ba.size() && ba.at(index) != '\n') { ks.append(ba.at(index)); index++; - } - dout << "set" << key_shortcut_fields.at(i)->action_name() << "to" << ks; + } key_shortcut_fields.at(i)->setKeySequence(ks); } else { key_shortcut_fields.at(i)->reset_to_default(); } } } else { - QMessageBox::critical(this, "Error saving shortcuts", "Failed to open file for reading"); + QMessageBox::critical( + this, + tr("Error saving shortcuts"), + tr("Failed to open file for reading") + ); } } } void PreferencesDialog::save_shortcut_file() { - QString fn = QFileDialog::getSaveFileName(this, "Export Keyboard Shortcuts"); + QString fn = QFileDialog::getSaveFileName(this, tr("Export Keyboard Shortcuts")); if (!fn.isEmpty()) { QFile f(fn); if (f.open(QFile::WriteOnly)) { @@ -233,16 +244,16 @@ void PreferencesDialog::save_shortcut_file() { start = false; } } - QMessageBox::information(this, "Export Shortcuts", "Shortcuts exported successfully"); + QMessageBox::information(this, tr("Export Shortcuts"), tr("Shortcuts exported successfully")); f.close(); } else { - QMessageBox::critical(this, "Error saving shortcuts", "Failed to open file for writing"); + QMessageBox::critical(this, tr("Error saving shortcuts"), tr("Failed to open file for writing")); } } } void PreferencesDialog::browse_css_file() { - QString fn = QFileDialog::getOpenFileName(this, "Browse for CSS file"); + QString fn = QFileDialog::getOpenFileName(this, tr("Browse for CSS file")); if (!fn.isEmpty()) { custom_css_fn->setText(fn); } @@ -255,120 +266,120 @@ void PreferencesDialog::setup_ui() { QTabWidget* general_tab = new QTabWidget(); QGridLayout* general_layout = new QGridLayout(general_tab); - general_layout->addWidget(new QLabel("Custom CSS:"), 0, 0, 1, 1); + general_layout->addWidget(new QLabel(tr("Custom CSS:")), 0, 0, 1, 1); custom_css_fn = new QLineEdit(general_tab); custom_css_fn->setText(config.css_path); general_layout->addWidget(custom_css_fn, 0, 1, 1, 1); - QPushButton* custom_css_browse = new QPushButton("Browse", general_tab); + QPushButton* custom_css_browse = new QPushButton(tr("Browse"), general_tab); connect(custom_css_browse, SIGNAL(clicked(bool)), this, SLOT(browse_css_file())); general_layout->addWidget(custom_css_browse, 0, 2, 1, 1); - general_layout->addWidget(new QLabel("Image sequence formats:"), 1, 0, 1, 1); + general_layout->addWidget(new QLabel(tr("Image sequence formats:")), 1, 0, 1, 1); imgSeqFormatEdit = new QLineEdit(general_tab); general_layout->addWidget(imgSeqFormatEdit, 1, 1, 1, 2); - general_layout->addWidget(new QLabel("Audio Recording:"), 2, 0, 1, 1); + general_layout->addWidget(new QLabel(tr("Audio Recording:")), 2, 0, 1, 1); recordingComboBox = new QComboBox(general_tab); - recordingComboBox->addItem("Mono"); - recordingComboBox->addItem("Stereo"); + recordingComboBox->addItem(tr("Mono")); + recordingComboBox->addItem(tr("Stereo")); general_layout->addWidget(recordingComboBox, 2, 1, 1, 2); - tabWidget->addTab(general_tab, "General"); + tabWidget->addTab(general_tab, tr("General")); QWidget* behavior_tab = new QWidget(); - tabWidget->addTab(behavior_tab, "Behavior"); + tabWidget->addTab(behavior_tab, tr("Behavior")); // Playback QWidget* playback_tab = new QWidget(); QVBoxLayout* playback_tab_layout = new QVBoxLayout(playback_tab); // Playback -> Disable Multithreading on Images - disable_img_multithread = new QCheckBox("Disable Multithreading on Images"); + disable_img_multithread = new QCheckBox(tr("Disable Multithreading on Images")); disable_img_multithread->setChecked(config.disable_multithreading_for_images); playback_tab_layout->addWidget(disable_img_multithread); // Playback -> Seeking QGroupBox* seeking_group = new QGroupBox(playback_tab); - seeking_group->setTitle("Seeking"); + seeking_group->setTitle(tr("Seeking")); QVBoxLayout* seeking_group_layout = new QVBoxLayout(seeking_group); accurateSeekButton = new QRadioButton(seeking_group); - accurateSeekButton->setText("Accurate Seeking\nAlways show the correct frame (visual may pause briefly as correct frame is retrieved)"); + accurateSeekButton->setText(tr("Accurate Seeking\nAlways show the correct frame (visual may pause briefly as correct frame is retrieved)")); seeking_group_layout->addWidget(accurateSeekButton); fastSeekButton = new QRadioButton(seeking_group); - fastSeekButton->setText("Fast Seeking\nSeek quickly (may briefly show inaccurate frames when seeking - doesn't affect playback/export)"); + fastSeekButton->setText(tr("Fast Seeking\nSeek quickly (may briefly show inaccurate frames when seeking - doesn't affect playback/export)")); seeking_group_layout->addWidget(fastSeekButton); playback_tab_layout->addWidget(seeking_group); // Playback -> Memory Usage QGroupBox* memory_usage_group = new QGroupBox(playback_tab); - memory_usage_group->setTitle("Memory Usage"); + memory_usage_group->setTitle(tr("Memory Usage")); QGridLayout* memory_usage_layout = new QGridLayout(memory_usage_group); - memory_usage_layout->addWidget(new QLabel("Upcoming Frame Queue:"), 0, 0); + memory_usage_layout->addWidget(new QLabel(tr("Upcoming Frame Queue:")), 0, 0); upcoming_queue_spinbox = new QDoubleSpinBox(); upcoming_queue_spinbox->setValue(config.upcoming_queue_size); memory_usage_layout->addWidget(upcoming_queue_spinbox, 0, 1); upcoming_queue_type = new QComboBox(); - upcoming_queue_type->addItem("frames"); - upcoming_queue_type->addItem("seconds"); + upcoming_queue_type->addItem(tr("frames")); + upcoming_queue_type->addItem(tr("seconds")); upcoming_queue_type->setCurrentIndex(config.upcoming_queue_type); memory_usage_layout->addWidget(upcoming_queue_type, 0, 2); - memory_usage_layout->addWidget(new QLabel("Previous Frame Queue:"), 1, 0); + memory_usage_layout->addWidget(new QLabel(tr("Previous Frame Queue:")), 1, 0); previous_queue_spinbox = new QDoubleSpinBox(); previous_queue_spinbox->setValue(config.previous_queue_size); memory_usage_layout->addWidget(previous_queue_spinbox, 1, 1); previous_queue_type = new QComboBox(); - previous_queue_type->addItem("frames"); - previous_queue_type->addItem("seconds"); + previous_queue_type->addItem(tr("frames")); + previous_queue_type->addItem(tr("seconds")); previous_queue_type->setCurrentIndex(config.previous_queue_type); memory_usage_layout->addWidget(previous_queue_type, 1, 2); playback_tab_layout->addWidget(memory_usage_group); - tabWidget->addTab(playback_tab, "Playback"); + tabWidget->addTab(playback_tab, tr("Playback")); QWidget* shortcut_tab = new QWidget(); QVBoxLayout* shortcut_layout = new QVBoxLayout(shortcut_tab); QLineEdit* key_search_line = new QLineEdit(); - key_search_line->setPlaceholderText("Search for action or shortcut"); + key_search_line->setPlaceholderText(tr("Search for action or shortcut")); connect(key_search_line, SIGNAL(textChanged(const QString &)), this, SLOT(refine_shortcut_list(const QString &))); shortcut_layout->addWidget(key_search_line); keyboard_tree = new QTreeWidget(); QTreeWidgetItem* tree_header = keyboard_tree->headerItem(); - tree_header->setText(0, "Action"); - tree_header->setText(1, "Shortcut"); + tree_header->setText(0, tr("Action")); + tree_header->setText(1, tr("Shortcut")); shortcut_layout->addWidget(keyboard_tree); QHBoxLayout* reset_shortcut_layout = new QHBoxLayout(); - QPushButton* import_shortcut_button = new QPushButton("Import"); + QPushButton* import_shortcut_button = new QPushButton(tr("Import")); reset_shortcut_layout->addWidget(import_shortcut_button); connect(import_shortcut_button, SIGNAL(clicked(bool)), this, SLOT(load_shortcut_file())); - QPushButton* export_shortcut_button = new QPushButton("Export"); + QPushButton* export_shortcut_button = new QPushButton(tr("Export")); reset_shortcut_layout->addWidget(export_shortcut_button); connect(export_shortcut_button, SIGNAL(clicked(bool)), this, SLOT(save_shortcut_file())); reset_shortcut_layout->addStretch(); - QPushButton* reset_selected_shortcut_button = new QPushButton("Reset Selected"); + QPushButton* reset_selected_shortcut_button = new QPushButton(tr("Reset Selected")); reset_shortcut_layout->addWidget(reset_selected_shortcut_button); connect(reset_selected_shortcut_button, SIGNAL(clicked(bool)), this, SLOT(reset_default_shortcut())); - QPushButton* reset_all_shortcut_button = new QPushButton("Reset All"); + QPushButton* reset_all_shortcut_button = new QPushButton(tr("Reset All")); reset_shortcut_layout->addWidget(reset_all_shortcut_button); connect(reset_all_shortcut_button, SIGNAL(clicked(bool)), this, SLOT(reset_all_shortcuts())); shortcut_layout->addLayout(reset_shortcut_layout); - tabWidget->addTab(shortcut_tab, "Keyboard"); + tabWidget->addTab(shortcut_tab, tr("Keyboard")); verticalLayout->addWidget(tabWidget); diff --git a/dialogs/replaceclipmediadialog.cpp b/dialogs/replaceclipmediadialog.cpp index 5243cc71c..ee07947ee 100644 --- a/dialogs/replaceclipmediadialog.cpp +++ b/dialogs/replaceclipmediadialog.cpp @@ -23,19 +23,19 @@ ReplaceClipMediaDialog::ReplaceClipMediaDialog(QWidget *parent, Media *old_media QDialog(parent), media(old_media) { - setWindowTitle("Replace clips using \"" + old_media->get_name() + "\""); + setWindowTitle(tr("Replace clips using \"%1\"").arg(old_media->get_name())); resize(300, 400); QVBoxLayout* layout = new QVBoxLayout(); - layout->addWidget(new QLabel("Select which media you want to replace this media's clips with:")); + layout->addWidget(new QLabel(tr("Select which media you want to replace this media's clips with:"))); tree = new QTreeView(); layout->addWidget(tree); - use_same_media_in_points = new QCheckBox("Keep the same media in-points"); + use_same_media_in_points = new QCheckBox(tr("Keep the same media in-points")); use_same_media_in_points->setChecked(true); layout->addWidget(use_same_media_in_points); @@ -43,11 +43,11 @@ ReplaceClipMediaDialog::ReplaceClipMediaDialog(QWidget *parent, Media *old_media buttons->addStretch(); - QPushButton* replace_button = new QPushButton("Replace"); + QPushButton* replace_button = new QPushButton(tr("Replace")); connect(replace_button, SIGNAL(clicked(bool)), this, SLOT(replace())); buttons->addWidget(replace_button); - QPushButton* cancel_button = new QPushButton("Cancel"); + QPushButton* cancel_button = new QPushButton(tr("Cancel")); connect(cancel_button, SIGNAL(clicked(bool)), this, SLOT(close())); buttons->addWidget(cancel_button); @@ -63,16 +63,36 @@ ReplaceClipMediaDialog::ReplaceClipMediaDialog(QWidget *parent, Media *old_media void ReplaceClipMediaDialog::replace() { QModelIndexList selected_items = tree->selectionModel()->selectedRows(); if (selected_items.size() != 1) { - QMessageBox::critical(this, "No media selected", "Please select a media to replace with or click 'Cancel'.", QMessageBox::Ok); + QMessageBox::critical( + this, + tr("No media selected"), + tr("Please select a media to replace with or click 'Cancel'."), + QMessageBox::Ok + ); } else { Media* new_item = static_cast(selected_items.at(0).internalPointer()); if (media == new_item) { - QMessageBox::critical(this, "Same media selected", "You selected the same media that you're replacing. Please select a different one or click 'Cancel'.", QMessageBox::Ok); + QMessageBox::critical( + this, + tr("Same media selected"), + tr("You selected the same media that you're replacing. Please select a different one or click 'Cancel'."), + QMessageBox::Ok + ); } else if (new_item->get_type() == MEDIA_TYPE_FOLDER) { - QMessageBox::critical(this, "Folder selected", "You cannot replace footage with a folder.", QMessageBox::Ok); + QMessageBox::critical( + this, + tr("Folder selected"), + tr("You cannot replace footage with a folder."), + QMessageBox::Ok + ); } else { if (new_item->get_type() == MEDIA_TYPE_SEQUENCE && sequence == new_item->to_sequence()) { - QMessageBox::critical(this, "Active sequence selected", "You cannot insert a sequence into itself.", QMessageBox::Ok); + QMessageBox::critical( + this, + tr("Active sequence selected"), + tr("You cannot insert a sequence into itself."), + QMessageBox::Ok + ); } else { ReplaceClipMediaCommand* rcmc = new ReplaceClipMediaCommand( media, diff --git a/dialogs/speeddialog.cpp b/dialogs/speeddialog.cpp index ff4c52a14..a8cede70a 100644 --- a/dialogs/speeddialog.cpp +++ b/dialogs/speeddialog.cpp @@ -19,25 +19,27 @@ #include "project/media.h" SpeedDialog::SpeedDialog(QWidget *parent) : QDialog(parent) { + setWindowTitle(tr("Speed/Duration")); + QVBoxLayout* main_layout = new QVBoxLayout(); setLayout(main_layout); QGridLayout* grid = new QGridLayout(); grid->setSpacing(6); - grid->addWidget(new QLabel("Speed:"), 0, 0); + grid->addWidget(new QLabel(tr("Speed:")), 0, 0); percent = new LabelSlider(); percent->decimal_places = 2; percent->set_display_type(LABELSLIDER_PERCENT); percent->set_default_value(1); grid->addWidget(percent, 0, 1); - grid->addWidget(new QLabel("Frame Rate:"), 1, 0); + grid->addWidget(new QLabel(tr("Frame Rate:")), 1, 0); frame_rate = new LabelSlider(); frame_rate->decimal_places = 3; grid->addWidget(frame_rate, 1, 1); - grid->addWidget(new QLabel("Duration:"), 2, 0); + grid->addWidget(new QLabel(tr("Duration:")), 2, 0); duration = new LabelSlider(); duration->set_display_type(LABELSLIDER_FRAMENUMBER); duration->set_frame_rate(sequence->frame_rate); @@ -45,9 +47,9 @@ SpeedDialog::SpeedDialog(QWidget *parent) : QDialog(parent) { main_layout->addLayout(grid); - reverse = new QCheckBox("Reverse"); - maintain_pitch = new QCheckBox("Maintain Audio Pitch"); - ripple = new QCheckBox("Ripple Changes"); + reverse = new QCheckBox(tr("Reverse")); + maintain_pitch = new QCheckBox(tr("Maintain Audio Pitch")); + ripple = new QCheckBox(tr("Ripple Changes")); main_layout->addWidget(reverse); main_layout->addWidget(maintain_pitch); diff --git a/dialogs/texteditdialog.cpp b/dialogs/texteditdialog.cpp index 508a67c4c..51337a637 100644 --- a/dialogs/texteditdialog.cpp +++ b/dialogs/texteditdialog.cpp @@ -7,7 +7,7 @@ TextEditDialog::TextEditDialog(QWidget *parent, const QString &s) : QDialog(parent) { - setWindowTitle("Edit Text"); + setWindowTitle(tr("Edit Text")); QVBoxLayout* layout = new QVBoxLayout(); setLayout(layout); diff --git a/effects/internal/audionoiseeffect.cpp b/effects/internal/audionoiseeffect.cpp index effd65f6e..0ec1f8a45 100644 --- a/effects/internal/audionoiseeffect.cpp +++ b/effects/internal/audionoiseeffect.cpp @@ -4,12 +4,12 @@ #include AudioNoiseEffect::AudioNoiseEffect(Clip* c, const EffectMeta *em) : Effect(c, em) { - amount_val = add_row("Amount")->add_field(EFFECT_FIELD_DOUBLE, "amount"); + amount_val = add_row(tr("Amount"))->add_field(EFFECT_FIELD_DOUBLE, "amount"); amount_val->set_double_minimum_value(0); amount_val->set_double_maximum_value(100); amount_val->set_double_default_value(20); - mix_val = add_row("Mix")->add_field(EFFECT_FIELD_BOOL, "mix"); + mix_val = add_row(tr("Mix"))->add_field(EFFECT_FIELD_BOOL, "mix"); mix_val->set_bool_value(true); srand(QDateTime::currentMSecsSinceEpoch()); diff --git a/effects/internal/cornerpineffect.cpp b/effects/internal/cornerpineffect.cpp index 5be93b671..1fa328c67 100644 --- a/effects/internal/cornerpineffect.cpp +++ b/effects/internal/cornerpineffect.cpp @@ -8,23 +8,23 @@ CornerPinEffect::CornerPinEffect(Clip *c, const EffectMeta *em) : Effect(c, em) enable_coords = true; enable_shader = true; - EffectRow* top_left = add_row("Top Left"); + EffectRow* top_left = add_row(tr("Top Left")); top_left_x = top_left->add_field(EFFECT_FIELD_DOUBLE, "topleftx"); top_left_y = top_left->add_field(EFFECT_FIELD_DOUBLE, "toplefty"); - EffectRow* top_right = add_row("Top Right"); + EffectRow* top_right = add_row(tr("Top Right")); top_right_x = top_right->add_field(EFFECT_FIELD_DOUBLE, "toprightx"); top_right_y = top_right->add_field(EFFECT_FIELD_DOUBLE, "toprighty"); - EffectRow* bottom_left = add_row("Bottom Left"); + EffectRow* bottom_left = add_row(tr("Bottom Left")); bottom_left_x = bottom_left->add_field(EFFECT_FIELD_DOUBLE, "bottomleftx"); bottom_left_y = bottom_left->add_field(EFFECT_FIELD_DOUBLE, "bottomlefty"); - EffectRow* bottom_right = add_row("Bottom Right"); + EffectRow* bottom_right = add_row(tr("Bottom Right")); bottom_right_x = bottom_right->add_field(EFFECT_FIELD_DOUBLE, "bottomrightx"); bottom_right_y = bottom_right->add_field(EFFECT_FIELD_DOUBLE, "bottomrighty"); - perspective = add_row("Perspective")->add_field(EFFECT_FIELD_BOOL, "perspective"); + perspective = add_row(tr("Perspective"))->add_field(EFFECT_FIELD_BOOL, "perspective"); perspective->set_bool_value(true); top_left_gizmo = add_gizmo(GIZMO_TYPE_DOT); diff --git a/effects/internal/fillleftrighteffect.cpp b/effects/internal/fillleftrighteffect.cpp index d21765e60..15ed2a4bd 100644 --- a/effects/internal/fillleftrighteffect.cpp +++ b/effects/internal/fillleftrighteffect.cpp @@ -4,10 +4,10 @@ #define FILL_TYPE_RIGHT 1 FillLeftRightEffect::FillLeftRightEffect(Clip* c, const EffectMeta *em) : Effect(c, em) { - EffectRow* type_row = add_row("Type"); + EffectRow* type_row = add_row(tr("Type")); fill_type = type_row->add_field(EFFECT_FIELD_COMBO, "type"); - fill_type->add_combo_item("Fill Left with Right", FILL_TYPE_LEFT); - fill_type->add_combo_item("Fill Right with Left", FILL_TYPE_RIGHT); + fill_type->add_combo_item(tr("Fill Left with Right"), FILL_TYPE_LEFT); + fill_type->add_combo_item(tr("Fill Right with Left"), FILL_TYPE_RIGHT); } void FillLeftRightEffect::process_audio(double timecode_start, double timecode_end, quint8* samples, int nb_bytes, int) { diff --git a/effects/internal/paneffect.cpp b/effects/internal/paneffect.cpp index fcb862192..e50d29612 100644 --- a/effects/internal/paneffect.cpp +++ b/effects/internal/paneffect.cpp @@ -9,7 +9,7 @@ #include "ui/collapsiblewidget.h" PanEffect::PanEffect(Clip* c, const EffectMeta *em) : Effect(c, em) { - EffectRow* pan_row = add_row("Pan"); + EffectRow* pan_row = add_row(tr("Pan")); pan_val = pan_row->add_field(EFFECT_FIELD_DOUBLE, "pan"); pan_val->set_double_minimum_value(-100); pan_val->set_double_maximum_value(100); diff --git a/effects/internal/shakeeffect.cpp b/effects/internal/shakeeffect.cpp index 92975fe8a..91e7dfe7c 100644 --- a/effects/internal/shakeeffect.cpp +++ b/effects/internal/shakeeffect.cpp @@ -16,15 +16,15 @@ ShakeEffect::ShakeEffect(Clip *c, const EffectMeta *em) : Effect(c, em) { enable_coords = true; - EffectRow* intensity_row = add_row("Intensity"); + EffectRow* intensity_row = add_row(tr("Intensity")); intensity_val = intensity_row->add_field(EFFECT_FIELD_DOUBLE, "intensity"); intensity_val->set_double_minimum_value(0); - EffectRow* rotation_row = add_row("Rotation"); + EffectRow* rotation_row = add_row(tr("Rotation")); rotation_val = rotation_row->add_field(EFFECT_FIELD_DOUBLE, "rotation"); rotation_val->set_double_minimum_value(0); - EffectRow* frequency_row = add_row("Frequency"); + EffectRow* frequency_row = add_row(tr("Frequency")); frequency_val = frequency_row->add_field(EFFECT_FIELD_DOUBLE, "frequency"); frequency_val->set_double_minimum_value(0); diff --git a/effects/internal/solideffect.cpp b/effects/internal/solideffect.cpp index 512dccda6..41522adaf 100644 --- a/effects/internal/solideffect.cpp +++ b/effects/internal/solideffect.cpp @@ -21,20 +21,20 @@ SolidEffect::SolidEffect(Clip* c, const EffectMeta* em) : Effect(c, em) { enable_superimpose = true; - solid_type = add_row("Type")->add_field(EFFECT_FIELD_COMBO, "type"); - solid_type->add_combo_item("Solid Color", SOLID_TYPE_COLOR); - solid_type->add_combo_item("SMPTE Bars", SOLID_TYPE_BARS); - solid_type->add_combo_item("Checkerboard", SOLID_TYPE_CHECKERBOARD); + solid_type = add_row(tr("Type"))->add_field(EFFECT_FIELD_COMBO, "type"); + solid_type->add_combo_item(tr("Solid Color"), SOLID_TYPE_COLOR); + solid_type->add_combo_item(tr("SMPTE Bars"), SOLID_TYPE_BARS); + solid_type->add_combo_item(tr("Checkerboard"), SOLID_TYPE_CHECKERBOARD); - opacity_field = add_row("Opacity")->add_field(EFFECT_FIELD_DOUBLE, "opacity"); + opacity_field = add_row(tr("Opacity"))->add_field(EFFECT_FIELD_DOUBLE, "opacity"); opacity_field->set_double_minimum_value(0); opacity_field->set_double_maximum_value(100); opacity_field->set_double_default_value(100); - solid_color_field = add_row("Color")->add_field(EFFECT_FIELD_COLOR, "color"); + solid_color_field = add_row(tr("Color"))->add_field(EFFECT_FIELD_COLOR, "color"); solid_color_field->set_color_value(Qt::red); - checkerboard_size_field = add_row("Checkerboard Size")->add_field(EFFECT_FIELD_DOUBLE, "checker_size"); + checkerboard_size_field = add_row(tr("Checkerboard Size"))->add_field(EFFECT_FIELD_DOUBLE, "checker_size"); checkerboard_size_field->set_double_minimum_value(1); checkerboard_size_field->set_double_default_value(10); diff --git a/effects/internal/texteffect.cpp b/effects/internal/texteffect.cpp index 56b609f80..e30c1648c 100644 --- a/effects/internal/texteffect.cpp +++ b/effects/internal/texteffect.cpp @@ -29,49 +29,49 @@ TextEffect::TextEffect(Clip *c, const EffectMeta* em) : enable_superimpose = true; //enable_shader = true; - text_val = add_row("Text")->add_field(EFFECT_FIELD_STRING, "text", 2); + text_val = add_row(tr("Text"))->add_field(EFFECT_FIELD_STRING, "text", 2); QTextEdit* text_widget = static_cast(text_val->ui_element); text_widget->setContextMenuPolicy(Qt::CustomContextMenu); connect(text_widget, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(text_edit_menu())); - set_font_combobox = add_row("Font")->add_field(EFFECT_FIELD_FONT, "font", 2); + set_font_combobox = add_row(tr("Font"))->add_field(EFFECT_FIELD_FONT, "font", 2); - size_val = add_row("Size")->add_field(EFFECT_FIELD_DOUBLE, "size", 2); + size_val = add_row(tr("Size"))->add_field(EFFECT_FIELD_DOUBLE, "size", 2); size_val->set_double_minimum_value(0); - set_color_button = add_row("Color")->add_field(EFFECT_FIELD_COLOR, "color", 2); + set_color_button = add_row(tr("Color"))->add_field(EFFECT_FIELD_COLOR, "color", 2); - EffectRow* alignment_row = add_row("Alignment"); + EffectRow* alignment_row = add_row(tr("Alignment")); halign_field = alignment_row->add_field(EFFECT_FIELD_COMBO, "halign"); - halign_field->add_combo_item("Left", Qt::AlignLeft); - halign_field->add_combo_item("Center", Qt::AlignHCenter); - halign_field->add_combo_item("Right", Qt::AlignRight); - halign_field->add_combo_item("Justify", Qt::AlignJustify); + halign_field->add_combo_item(tr("Left"), Qt::AlignLeft); + halign_field->add_combo_item(tr("Center"), Qt::AlignHCenter); + halign_field->add_combo_item(tr("Right"), Qt::AlignRight); + halign_field->add_combo_item(tr("Justify"), Qt::AlignJustify); valign_field = alignment_row->add_field(EFFECT_FIELD_COMBO, "valign"); - valign_field->add_combo_item("Top", Qt::AlignTop); - valign_field->add_combo_item("Center", Qt::AlignVCenter); - valign_field->add_combo_item("Bottom", Qt::AlignBottom); + valign_field->add_combo_item(tr("Top"), Qt::AlignTop); + valign_field->add_combo_item(tr("Center"), Qt::AlignVCenter); + valign_field->add_combo_item(tr("Bottom"), Qt::AlignBottom); - word_wrap_field = add_row("Word Wrap")->add_field(EFFECT_FIELD_BOOL, "wordwrap", 2); + word_wrap_field = add_row(tr("Word Wrap"))->add_field(EFFECT_FIELD_BOOL, "wordwrap", 2); - outline_bool = add_row("Outline")->add_field(EFFECT_FIELD_BOOL, "outline", 2); - outline_color = add_row("Outline Color")->add_field(EFFECT_FIELD_COLOR, "outlinecolor", 2); - outline_width = add_row("Outline Width")->add_field(EFFECT_FIELD_DOUBLE, "outlinewidth", 2); + outline_bool = add_row(tr("Outline"))->add_field(EFFECT_FIELD_BOOL, "outline", 2); + outline_color = add_row(tr("Outline Color"))->add_field(EFFECT_FIELD_COLOR, "outlinecolor", 2); + outline_width = add_row(tr("Outline Width"))->add_field(EFFECT_FIELD_DOUBLE, "outlinewidth", 2); outline_width->set_double_minimum_value(0); - shadow_bool = add_row("Shadow")->add_field(EFFECT_FIELD_BOOL, "shadow", 2); - shadow_color = add_row("Shadow Color")->add_field(EFFECT_FIELD_COLOR, "shadowcolor", 2); - shadow_distance = add_row("Shadow Distance")->add_field(EFFECT_FIELD_DOUBLE, "shadowdistance", 2); + shadow_bool = add_row(tr("Shadow"))->add_field(EFFECT_FIELD_BOOL, "shadow", 2); + shadow_color = add_row(tr("Shadow Color"))->add_field(EFFECT_FIELD_COLOR, "shadowcolor", 2); + shadow_distance = add_row(tr("Shadow Distance"))->add_field(EFFECT_FIELD_DOUBLE, "shadowdistance", 2); shadow_distance->set_double_minimum_value(0); - shadow_softness = add_row("Shadow Softness")->add_field(EFFECT_FIELD_DOUBLE, "shadowsoftness", 2); + shadow_softness = add_row(tr("Shadow Softness"))->add_field(EFFECT_FIELD_DOUBLE, "shadowsoftness", 2); shadow_softness->set_double_minimum_value(0); - shadow_opacity = add_row("Shadow Opacity")->add_field(EFFECT_FIELD_DOUBLE, "shadowopacity", 2); + shadow_opacity = add_row(tr("Shadow Opacity"))->add_field(EFFECT_FIELD_DOUBLE, "shadowopacity", 2); shadow_opacity->set_double_minimum_value(0); shadow_opacity->set_double_maximum_value(100); size_val->set_double_default_value(48); - text_val->set_string_value("Sample Text"); + text_val->set_string_value(tr("Sample Text")); halign_field->set_combo_index(1); valign_field->set_combo_index(1); word_wrap_field->set_bool_value(true); @@ -207,7 +207,7 @@ void TextEffect::shadow_enable(bool e) { void TextEffect::text_edit_menu() { QMenu menu; - menu.addAction("&Edit Text", this, SLOT(open_text_edit())); + menu.addAction(tr("&Edit Text"), this, SLOT(open_text_edit())); menu.exec(QCursor::pos()); } diff --git a/effects/internal/timecodeeffect.cpp b/effects/internal/timecodeeffect.cpp index baba8c50d..7e8299b76 100644 --- a/effects/internal/timecodeeffect.cpp +++ b/effects/internal/timecodeeffect.cpp @@ -29,33 +29,33 @@ TimecodeEffect::TimecodeEffect(Clip *c, const EffectMeta* em) : enable_always_update = true; enable_superimpose = true; - EffectRow* tc_row = add_row("Timecode"); + EffectRow* tc_row = add_row(tr("Timecode")); tc_select = tc_row->add_field(EFFECT_FIELD_COMBO, "tc_selector"); - tc_select->add_combo_item("Sequence", true); - tc_select->add_combo_item("Media", false); + tc_select->add_combo_item(tr("Sequence"), true); + tc_select->add_combo_item(tr("Media"), false); tc_select->set_combo_index(0); - scale_val = add_row("Scale")->add_field(EFFECT_FIELD_DOUBLE, "scale", 2); + scale_val = add_row(tr("Scale"))->add_field(EFFECT_FIELD_DOUBLE, "scale", 2); scale_val->set_double_minimum_value(1); scale_val->set_double_default_value(100); scale_val->set_double_maximum_value(1000); - color_val = add_row("Color")->add_field(EFFECT_FIELD_COLOR, "color", 2); + color_val = add_row(tr("Color"))->add_field(EFFECT_FIELD_COLOR, "color", 2); color_val->set_color_value(Qt::white); - color_bg_val = add_row("Background Color")->add_field(EFFECT_FIELD_COLOR, "bgcolor", 2); + color_bg_val = add_row(tr("Background Color"))->add_field(EFFECT_FIELD_COLOR, "bgcolor", 2); color_bg_val->set_color_value(Qt::black); - bg_alpha = add_row("Background Opacity")->add_field(EFFECT_FIELD_DOUBLE, "bgalpha", 2); + bg_alpha = add_row(tr("Background Opacity"))->add_field(EFFECT_FIELD_DOUBLE, "bgalpha", 2); bg_alpha->set_double_minimum_value(0); bg_alpha->set_double_maximum_value(100); bg_alpha->set_double_default_value(50); - EffectRow* offset = add_row("Offset"); + EffectRow* offset = add_row(tr("Offset")); offset_x_val = offset->add_field(EFFECT_FIELD_DOUBLE, "offsetx"); offset_y_val = offset->add_field(EFFECT_FIELD_DOUBLE, "offsety"); - prepend_text = add_row("Prepend")->add_field(EFFECT_FIELD_STRING, "prepend", 2); + prepend_text = add_row(tr("Prepend"))->add_field(EFFECT_FIELD_STRING, "prepend", 2); } diff --git a/effects/internal/toneeffect.cpp b/effects/internal/toneeffect.cpp index 1df21ff5c..1ccb03d8a 100644 --- a/effects/internal/toneeffect.cpp +++ b/effects/internal/toneeffect.cpp @@ -9,20 +9,20 @@ #include "debug.h" ToneEffect::ToneEffect(Clip* c, const EffectMeta *em) : Effect(c, em), sinX(INT_MIN) { - type_val = add_row("Type")->add_field(EFFECT_FIELD_COMBO, "type"); + type_val = add_row(tr("Type"))->add_field(EFFECT_FIELD_COMBO, "type"); type_val->add_combo_item("Sine", TONE_TYPE_SINE); - freq_val = add_row("Frequency")->add_field(EFFECT_FIELD_DOUBLE, "frequency"); + freq_val = add_row(tr("Frequency"))->add_field(EFFECT_FIELD_DOUBLE, "frequency"); freq_val->set_double_minimum_value(20); freq_val->set_double_maximum_value(20000); freq_val->set_double_default_value(1000); - amount_val = add_row("Amount")->add_field(EFFECT_FIELD_DOUBLE, "amount"); + amount_val = add_row(tr("Amount"))->add_field(EFFECT_FIELD_DOUBLE, "amount"); amount_val->set_double_minimum_value(0); amount_val->set_double_maximum_value(100); amount_val->set_double_default_value(25); - mix_val = add_row("Mix")->add_field(EFFECT_FIELD_BOOL, "mix"); + mix_val = add_row(tr("Mix"))->add_field(EFFECT_FIELD_BOOL, "mix"); mix_val->set_bool_value(true); } diff --git a/effects/internal/transformeffect.cpp b/effects/internal/transformeffect.cpp index e1cf1dde7..f1c6d2bce 100644 --- a/effects/internal/transformeffect.cpp +++ b/effects/internal/transformeffect.cpp @@ -31,11 +31,11 @@ TransformEffect::TransformEffect(Clip* c, const EffectMeta* em) : Effect(c, em) { enable_coords = true; - EffectRow* position_row = add_row("Position"); + EffectRow* position_row = add_row(tr("Position")); position_x = position_row->add_field(EFFECT_FIELD_DOUBLE, "posx"); // position X position_y = position_row->add_field(EFFECT_FIELD_DOUBLE, "posy"); // position Y - EffectRow* scale_row = add_row("Scale"); + EffectRow* scale_row = add_row(tr("Scale")); scale_x = scale_row->add_field(EFFECT_FIELD_DOUBLE, "scalex"); // scale X (and Y is uniform scale is selected) scale_x->set_double_minimum_value(0); scale_x->set_double_maximum_value(3000); @@ -43,27 +43,27 @@ TransformEffect::TransformEffect(Clip* c, const EffectMeta* em) : Effect(c, em) scale_y->set_double_minimum_value(0); scale_y->set_double_maximum_value(3000); - EffectRow* uniform_scale_row = add_row("Uniform Scale"); + EffectRow* uniform_scale_row = add_row(tr("Uniform Scale")); uniform_scale_field = uniform_scale_row->add_field(EFFECT_FIELD_BOOL, "uniformscale"); // uniform scale option - EffectRow* rotation_row = add_row("Rotation"); + EffectRow* rotation_row = add_row(tr("Rotation")); rotation = rotation_row->add_field(EFFECT_FIELD_DOUBLE, "rotation"); - EffectRow* anchor_point_row = add_row("Anchor Point"); + EffectRow* anchor_point_row = add_row(tr("Anchor Point")); anchor_x_box = anchor_point_row->add_field(EFFECT_FIELD_DOUBLE, "anchorx"); // anchor point X anchor_y_box = anchor_point_row->add_field(EFFECT_FIELD_DOUBLE, "anchory"); // anchor point Y - EffectRow* opacity_row = add_row("Opacity"); + EffectRow* opacity_row = add_row(tr("Opacity")); opacity = opacity_row->add_field(EFFECT_FIELD_DOUBLE, "opacity"); // opacity opacity->set_double_minimum_value(0); opacity->set_double_maximum_value(100); - EffectRow* blend_mode_row = add_row("Blend Mode"); + EffectRow* blend_mode_row = add_row(tr("Blend Mode")); blend_mode_box = blend_mode_row->add_field(EFFECT_FIELD_COMBO, "blendmode"); // blend mode - blend_mode_box->add_combo_item("Normal", BLEND_MODE_NORMAL); - blend_mode_box->add_combo_item("Overlay", BLEND_MODE_OVERLAY); - blend_mode_box->add_combo_item("Screen", BLEND_MODE_SCREEN); - blend_mode_box->add_combo_item("Multiply", BLEND_MODE_MULTIPLY); + blend_mode_box->add_combo_item(tr("Normal"), BLEND_MODE_NORMAL); + blend_mode_box->add_combo_item(tr("Overlay"), BLEND_MODE_OVERLAY); + blend_mode_box->add_combo_item(tr("Screen"), BLEND_MODE_SCREEN); + blend_mode_box->add_combo_item(tr("Multiply"), BLEND_MODE_MULTIPLY); // set up gizmos top_left_gizmo = add_gizmo(GIZMO_TYPE_DOT); diff --git a/effects/internal/voideffect.cpp b/effects/internal/voideffect.cpp index 11a8c25ff..8a4c11f30 100644 --- a/effects/internal/voideffect.cpp +++ b/effects/internal/voideffect.cpp @@ -11,11 +11,11 @@ VoidEffect::VoidEffect(Clip *c, const QString& n) : Effect(c, NULL) { name = n; QString display_name; if (n.isEmpty()) { - display_name = "(unknown)"; + display_name = tr("(unknown)"); } else { display_name = n; } - EffectRow* row = add_row("Missing Effect", false, false); + EffectRow* row = add_row(tr("Missing Effect"), false, false); row->add_widget(new QLabel(display_name)); container->setText(display_name); } diff --git a/effects/internal/volumeeffect.cpp b/effects/internal/volumeeffect.cpp index 48a329c16..997d9a2e6 100644 --- a/effects/internal/volumeeffect.cpp +++ b/effects/internal/volumeeffect.cpp @@ -9,7 +9,7 @@ #include "ui/collapsiblewidget.h" VolumeEffect::VolumeEffect(Clip* c, const EffectMeta *em) : Effect(c, em) { - EffectRow* volume_row = add_row("Volume"); + EffectRow* volume_row = add_row(tr("Volume")); volume_val = volume_row->add_field(EFFECT_FIELD_DOUBLE, "volume"); volume_val->set_double_minimum_value(0); diff --git a/effects/internal/vsthostwin.cpp b/effects/internal/vsthostwin.cpp index 302cb5d34..c1030d878 100644 --- a/effects/internal/vsthostwin.cpp +++ b/effects/internal/vsthostwin.cpp @@ -60,16 +60,16 @@ void VSTHostWin::loadPlugin() { modulePtr = LoadLibrary(dll_fn_w); if(modulePtr == NULL) { DWORD dll_err = GetLastError(); - qCritical() << "Failed to load VST" << dll_fn_w << "-" << dll_err; - QString msg_err = "Failed to load VST plugin \"" + dll_fn + "\": " + QString::number(dll_err); + qCritical() << "Failed to load VST" << dll_fn_w << "-" << dll_err; + QString msg_err = tr("Failed to load VST plugin \"%1\": %2").arg(dll_fn, QString::number(dll_err)); if (dll_err == 193) { #ifdef _WIN64 - msg_err += "\n\nNOTE: You can't load 32-bit VST plugins into a 64-bit build of Olive. Please find a 64-bit version of this plugin or switch to a 32-bit build of Olive."; + msg_err += "\n\n" + tr("NOTE: You can't load 32-bit VST plugins into a 64-bit build of Olive. Please find a 64-bit version of this plugin or switch to a 32-bit build of Olive."); #elif _WIN32 - msg_err += "\n\nNOTE: You can't load 64-bit VST plugins into a 32-bit build of Olive. Please find a 32-bit version of this plugin or switch to a 64-bit build of Olive."; + msg_err += "\n\n" + tr("NOTE: You can't load 64-bit VST plugins into a 32-bit build of Olive. Please find a 32-bit version of this plugin or switch to a 64-bit build of Olive."); #endif } - QMessageBox::critical(mainWindow, "Error loading VST plugin", msg_err); + QMessageBox::critical(mainWindow, tr("Error loading VST plugin"), msg_err); return; } @@ -93,7 +93,7 @@ bool VSTHostWin::configurePluginCallbacks() { // real VST plugin, or is otherwise corrupt. if(plugin->magic != kEffectMagic) { qCritical() << "Plugin's magic number is bad"; - QMessageBox::critical(mainWindow, "VST Error", "Plugin's magic number is invalid"); + QMessageBox::critical(mainWindow, tr("VST Error"), tr("Plugin's magic number is invalid")); return false; } @@ -162,18 +162,18 @@ VSTHostWin::VSTHostWin(Clip* c, const EffectMeta *em) : Effect(c, em) { initializeIO(); - file_field = add_row("Plugin", true, false)->add_field(EFFECT_FIELD_FILE, "filename"); + file_field = add_row(tr("Plugin"), true, false)->add_field(EFFECT_FIELD_FILE, "filename"); connect(file_field, SIGNAL(changed()), this, SLOT(change_plugin())); - EffectRow* interface_row = add_row("Interface", false, false); - show_interface_btn = new QPushButton("Show"); + EffectRow* interface_row = add_row(tr("Interface"), false, false); + show_interface_btn = new QPushButton(tr("Show")); show_interface_btn->setCheckable(true); show_interface_btn->setEnabled(false); connect(show_interface_btn, SIGNAL(toggled(bool)), this, SLOT(show_interface(bool))); interface_row->add_widget(show_interface_btn); dialog = new QDialog(mainWindow); - dialog->setWindowTitle("VST Plugin"); + dialog->setWindowTitle(tr("VST Plugin")); dialog->setAttribute(Qt::WA_NativeWindow, true); dialog->setWindowFlags(dialog->windowFlags() | Qt::MSWindowsFixedSizeDialogHint); connect(dialog, SIGNAL(finished(int)), this, SLOT(uncheck_show_button())); diff --git a/io/exportthread.cpp b/io/exportthread.cpp index 5993f0316..99deaf5ce 100644 --- a/io/exportthread.cpp +++ b/io/exportthread.cpp @@ -49,7 +49,7 @@ bool ExportThread::encode(AVFormatContext* ofmt_ctx, AVCodecContext* codec_ctx, ret = avcodec_send_frame(codec_ctx, frame); if (ret < 0) { qCritical() << "Failed to send frame to encoder." << ret; - ed->export_error = "failed to send frame to encoder (" + QString::number(ret) + ")"; + ed->export_error = tr("failed to send frame to encoder (%1)").arg(QString::number(ret)); return false; } @@ -60,7 +60,7 @@ bool ExportThread::encode(AVFormatContext* ofmt_ctx, AVCodecContext* codec_ctx, } else if (ret < 0) { if (ret != AVERROR_EOF) { qCritical() << "Failed to receive packet from encoder." << ret; - ed->export_error = "failed to receive packet from encoder (" + QString::number(ret) + ")"; + ed->export_error = tr("failed to receive packet from encoder (%1)").arg(QString::number(ret)); } return false; } @@ -81,7 +81,7 @@ bool ExportThread::setupVideo() { vcodec = avcodec_find_encoder((enum AVCodecID) video_codec); if (!vcodec) { qCritical() << "Could not find video encoder"; - ed->export_error = "could not video encoder for " + QString::number(video_codec); + ed->export_error = tr("could not video encoder for %1").arg(QString::number(video_codec)); return false; } @@ -90,7 +90,7 @@ bool ExportThread::setupVideo() { video_stream->id = 0; if (!video_stream) { qCritical() << "Could not allocate video stream"; - ed->export_error = "could not allocate video stream"; + ed->export_error = tr("could not allocate video stream"); return false; } @@ -99,7 +99,7 @@ bool ExportThread::setupVideo() { vcodec_ctx = avcodec_alloc_context3(vcodec); if (!vcodec_ctx) { qCritical() << "Could not allocate video encoding context"; - ed->export_error = "could not allocate video encoding context"; + ed->export_error = tr("could not allocate video encoding context"); return false; } @@ -136,7 +136,7 @@ bool ExportThread::setupVideo() { ret = avcodec_open2(vcodec_ctx, vcodec, NULL); if (ret < 0) { qCritical() << "Could not open output video encoder." << ret; - ed->export_error = "could not open output video encoder (" + QString::number(ret) + ")"; + ed->export_error = tr("could not open output video encoder (%1)").arg(QString::number(ret)); return false; } @@ -144,7 +144,7 @@ bool ExportThread::setupVideo() { ret = avcodec_parameters_from_context(video_stream->codecpar, vcodec_ctx); if (ret < 0) { qCritical() << "Could not copy video encoder parameters to output stream." << ret; - ed->export_error = "could not copy video encoder parameters to output stream (" + QString::number(ret) + ")"; + ed->export_error = tr("could not copy video encoder parameters to output stream (%1)").arg(QString::number(ret)); return false; } @@ -188,7 +188,7 @@ bool ExportThread::setupAudio() { acodec = avcodec_find_encoder(static_cast(audio_codec)); if (!acodec) { qCritical() << "Could not find audio encoder"; - ed->export_error = "could not audio encoder for " + QString::number(audio_codec); + ed->export_error = tr("could not audio encoder for %1").arg(QString::number(audio_codec)); return false; } @@ -197,7 +197,7 @@ bool ExportThread::setupAudio() { audio_stream->id = 1; if (!audio_stream) { qCritical() << "Could not allocate audio stream"; - ed->export_error = "could not allocate audio stream"; + ed->export_error = tr("could not allocate audio stream"); return false; } @@ -206,7 +206,7 @@ bool ExportThread::setupAudio() { acodec_ctx = avcodec_alloc_context3(acodec); if (!acodec_ctx) { qCritical() << "Could not find allocate audio encoding context"; - ed->export_error = "could not allocate audio encoding context"; + ed->export_error = tr("could not allocate audio encoding context"); return false; } @@ -231,7 +231,7 @@ bool ExportThread::setupAudio() { ret = avcodec_open2(acodec_ctx, acodec, NULL); if (ret < 0) { qCritical() << "Could not open output audio encoder." << ret; - ed->export_error = "could not open output audio encoder (" + QString::number(ret) + ")"; + ed->export_error = tr("could not open output audio encoder (%1)").arg(QString::number(ret)); return false; } @@ -239,7 +239,7 @@ bool ExportThread::setupAudio() { ret = avcodec_parameters_from_context(audio_stream->codecpar, acodec_ctx); if (ret < 0) { qCritical() << "Could not copy audio encoder parameters to output stream." << ret; - ed->export_error = "could not copy audio encoder parameters to output stream (" + QString::number(ret) + ")"; + ed->export_error = tr("could not copy audio encoder parameters to output stream (%1)").arg(QString::number(ret)); return false; } @@ -269,7 +269,7 @@ bool ExportThread::setupAudio() { ret = av_frame_get_buffer(audio_frame, 0); if (ret < 0) { qCritical() << "Could not allocate audio buffer." << ret; - ed->export_error = "could not allocate audio buffer (" + QString::number(ret) + ")"; + ed->export_error = tr("could not allocate audio buffer (%1)").arg(QString::number(ret)); return false; } aframe_bytes = av_samples_get_buffer_size(NULL, audio_frame->channels, audio_frame->nb_samples, static_cast(audio_frame->format), 0); @@ -291,7 +291,7 @@ bool ExportThread::setupContainer() { avformat_alloc_output_context2(&fmt_ctx, NULL, NULL, c_filename); if (!fmt_ctx) { qCritical() << "Could not create output context"; - ed->export_error = "could not create output format context"; + ed->export_error = tr("could not create output format context"); return false; } @@ -300,7 +300,7 @@ bool ExportThread::setupContainer() { ret = avio_open(&fmt_ctx->pb, c_filename, AVIO_FLAG_WRITE); if (ret < 0) { qCritical() << "Could not open output file." << ret; - ed->export_error = "could not open output file (" + QString::number(ret) + ")"; + ed->export_error = tr("could not open output file (%1)").arg(QString::number(ret)); return false; } @@ -312,7 +312,7 @@ void ExportThread::run() { if (!panel_sequence_viewer->viewer_widget->context()->makeCurrent(&surface)) { qCritical() << "Make current failed"; - ed->export_error = "could not make OpenGL context current"; + ed->export_error = tr("could not make OpenGL context current"); return; } @@ -331,7 +331,7 @@ void ExportThread::run() { ret = avformat_write_header(fmt_ctx, NULL); if (ret < 0) { qCritical() << "Could not write output file header." << ret; - ed->export_error = "could not write output file header (" + QString::number(ret) + ")"; + ed->export_error = tr("could not write output file header (%1)").arg(QString::number(ret)); continueEncode = false; } } @@ -440,7 +440,7 @@ void ExportThread::run() { ret = av_write_trailer(fmt_ctx); if (ret < 0) { qCritical() << "Could not write output file trailer." << ret; - ed->export_error = "could not write output file trailer (" + QString::number(ret) + ")"; + ed->export_error = tr("could not write output file trailer (%1)").arg(QString::number(ret)); continueEncode = false; } diff --git a/io/loadthread.cpp b/io/loadthread.cpp index 06d0fc3c7..0f8b44865 100644 --- a/io/loadthread.cpp +++ b/io/loadthread.cpp @@ -153,7 +153,12 @@ bool LoadThread::load_worker(QFile& f, QXmlStreamReader& stream, int type) { if (type == LOAD_TYPE_VERSION) { int proj_version = stream.readElementText().toInt(); if (proj_version < MIN_SAVE_VERSION && proj_version > SAVE_VERSION) { - if (QMessageBox::warning(mainWindow, "Version Mismatch", "This project was saved in a different version of Olive and may not be fully compatible with this version. Would you like to attempt loading it anyway?", QMessageBox::Yes, QMessageBox::No) == QMessageBox::No) { + if (QMessageBox::warning( + mainWindow, + tr("Version Mismatch"), + tr("This project was saved in a different version of Olive and may not be fully compatible with this version. Would you like to attempt loading it anyway?"), + QMessageBox::Yes, + QMessageBox::No) == QMessageBox::No) { show_err = false; return false; } @@ -435,7 +440,11 @@ bool LoadThread::load_worker(QFile& f, QXmlStreamReader& stream, int type) { if (!found) { correct_clip->linked.removeAt(j); j--; - if (QMessageBox::warning(mainWindow, "Invalid Clip Link", "This project contains an invalid clip link. It may be corrupt. Would you like to continue loading it?", QMessageBox::Yes, QMessageBox::No) == QMessageBox::No) { + if (QMessageBox::warning(mainWindow, + tr("Invalid Clip Link"), + tr("This project contains an invalid clip link. It may be corrupt. Would you like to continue loading it?"), + QMessageBox::Yes, + QMessageBox::No) == QMessageBox::No) { delete s; return false; } @@ -584,7 +593,7 @@ void LoadThread::run() { xml_error = false; if (show_err) emit error(); } else if (stream.hasError()) { - error_str = stream.errorString() + " - Line: " + QString::number(stream.lineNumber()) + " Col:" + QString::number(stream.columnNumber()); + error_str = tr("%1 - Line: %2 Col: %3").arg(stream.errorString(), QString::number(stream.lineNumber()), QString::number(stream.columnNumber())); xml_error = true; emit error(); cont = false; @@ -624,9 +633,15 @@ void LoadThread::cancel() { void LoadThread::error_func() { if (xml_error) { qCritical() << "Error parsing XML." << error_str; - QMessageBox::critical(mainWindow, "XML Parsing Error", "Couldn't load '" + project_url + "'. " + error_str, QMessageBox::Ok); + QMessageBox::critical(mainWindow, + tr("XML Parsing Error"), + tr("Couldn't load '%1'. %2").arg(project_url, error_str), + QMessageBox::Ok); } else { - QMessageBox::critical(mainWindow, "Project Load Error", "Error loading project: " + error_str, QMessageBox::Ok); + QMessageBox::critical(mainWindow, + tr("Project Load Error"), + tr("Error loading project: %1").arg(error_str), + QMessageBox::Ok); } } diff --git a/io/previewgenerator.cpp b/io/previewgenerator.cpp index cbc386743..247305320 100644 --- a/io/previewgenerator.cpp +++ b/io/previewgenerator.cpp @@ -435,14 +435,14 @@ void PreviewGenerator::run() { if(errCode != 0) { char err[1024]; av_strerror(errCode, err, 1024); - errorStr = "Could not open file - " + QString(err); + errorStr = tr("Could not open file - %1").arg(err); error = true; } else { errCode = avformat_find_stream_info(fmt_ctx, NULL); if (errCode < 0) { char err[1024]; av_strerror(errCode, err, 1024); - errorStr = "Could not find stream information - " + QString(err); + errorStr = tr("Could not find stream information - %1").arg(err); error = true; } else { av_dump_format(fmt_ctx, 0, filename, 0); diff --git a/olive.pro b/olive.pro index 112eb4e83..9451c287d 100644 --- a/olive.pro +++ b/olive.pro @@ -27,6 +27,8 @@ DEFINES += QT_DEPRECATED_WARNINGS # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 +QMAKE_CXXFLAGS += -std=c++11 -Wextra -Wshadow -Wnon-virtual-dtor -pedantic + # Tries to get the current Git short hash system("which git") { GITHASHVAR = $$system(git --git-dir $$PWD/.git --work-tree $$PWD log -1 --format=%h) diff --git a/panels/effectcontrols.cpp b/panels/effectcontrols.cpp index aab9635a2..a596ce09e 100644 --- a/panels/effectcontrols.cpp +++ b/panels/effectcontrols.cpp @@ -34,7 +34,7 @@ EffectControls::EffectControls(QWidget *parent) : QDockWidget(parent), multiple(false), zoom(1), - panel_name("Effects: "), + panel_name(tr("Effects: ")), mode(TA_NO_TRANSITION) { setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); @@ -303,7 +303,7 @@ void EffectControls::setup_ui() { QPushButton* btnAddVideoEffect = new QPushButton(veHeader); btnAddVideoEffect->setIcon(QIcon(":/icons/add-effect.png")); - btnAddVideoEffect->setToolTip("Add Video Effect"); + btnAddVideoEffect->setToolTip(tr("Add Video Effect")); veHeaderLayout->addWidget(btnAddVideoEffect); connect(btnAddVideoEffect, SIGNAL(clicked(bool)), this, SLOT(video_effect_click())); @@ -314,14 +314,14 @@ void EffectControls::setup_ui() { font.setPointSize(9); lblVideoEffects->setFont(font); lblVideoEffects->setAlignment(Qt::AlignCenter); - lblVideoEffects->setText("VIDEO EFFECTS"); + lblVideoEffects->setText(tr("VIDEO EFFECTS")); veHeaderLayout->addWidget(lblVideoEffects); veHeaderLayout->addStretch(); QPushButton* btnAddVideoTransition = new QPushButton(veHeader); btnAddVideoTransition->setIcon(QIcon(":/icons/add-transition.png")); - btnAddVideoTransition->setToolTip("Add Video Transition"); + btnAddVideoTransition->setToolTip(tr("Add Video Transition")); connect(btnAddVideoTransition, SIGNAL(clicked(bool)), this, SLOT(video_transition_click())); veHeaderLayout->addWidget(btnAddVideoTransition); @@ -351,7 +351,7 @@ void EffectControls::setup_ui() { QPushButton* btnAddAudioEffect = new QPushButton(aeHeader); btnAddAudioEffect->setIcon(QIcon(":/icons/add-effect.png")); - btnAddAudioEffect->setToolTip("Add Audio Effect"); + btnAddAudioEffect->setToolTip(tr("Add Audio Effect")); connect(btnAddAudioEffect, SIGNAL(clicked(bool)), this, SLOT(audio_effect_click())); aeHeaderLayout->addWidget(btnAddAudioEffect); @@ -360,14 +360,14 @@ void EffectControls::setup_ui() { QLabel* lblAudioEffects = new QLabel(aeHeader); lblAudioEffects->setFont(font); lblAudioEffects->setAlignment(Qt::AlignCenter); - lblAudioEffects->setText("AUDIO EFFECTS"); + lblAudioEffects->setText(tr("AUDIO EFFECTS")); aeHeaderLayout->addWidget(lblAudioEffects); aeHeaderLayout->addStretch(); QPushButton* btnAddAudioTransition = new QPushButton(aeHeader); btnAddAudioTransition->setIcon(QIcon(":/icons/add-transition.png")); - btnAddAudioTransition->setToolTip("Add Audio Transition"); + btnAddAudioTransition->setToolTip(tr("Add Audio Transition")); connect(btnAddAudioTransition, SIGNAL(clicked(bool)), this, SLOT(audio_transition_click())); aeHeaderLayout->addWidget(btnAddAudioTransition); @@ -384,7 +384,7 @@ void EffectControls::setup_ui() { lblMultipleClipsSelected = new QLabel(effects_area); lblMultipleClipsSelected->setAlignment(Qt::AlignCenter); - lblMultipleClipsSelected->setText("(Multiple clips selected)"); + lblMultipleClipsSelected->setText(tr("(Multiple clips selected)")); effects_area_layout->addWidget(lblMultipleClipsSelected); effects_area_layout->addStretch(); diff --git a/panels/grapheditor.cpp b/panels/grapheditor.cpp index 2cb44f673..c2c56525f 100644 --- a/panels/grapheditor.cpp +++ b/panels/grapheditor.cpp @@ -20,7 +20,7 @@ GraphEditor::GraphEditor(QWidget* parent) : QDockWidget(parent), row(NULL) { setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - setWindowTitle("Graph Editor"); + setWindowTitle(tr("Graph Editor")); resize(720, 480); QWidget* main_widget = new QWidget(); @@ -58,13 +58,13 @@ GraphEditor::GraphEditor(QWidget* parent) : QDockWidget(parent), row(NULL) { left_tool_layout->addWidget(keyframe_nav); left_tool_layout->addStretch(); - linear_button = new QPushButton("Linear"); + linear_button = new QPushButton(tr("Linear")); linear_button->setProperty("type", KEYFRAME_TYPE_LINEAR); linear_button->setCheckable(true); - bezier_button = new QPushButton("Bezier"); + bezier_button = new QPushButton(tr("Bezier")); bezier_button->setProperty("type", KEYFRAME_TYPE_BEZIER); bezier_button->setCheckable(true); - hold_button = new QPushButton("Hold"); + hold_button = new QPushButton(tr("Hold")); hold_button->setProperty("type", KEYFRAME_TYPE_HOLD); hold_button->setCheckable(true); diff --git a/panels/project.cpp b/panels/project.cpp index 8742eecca..562617cef 100644 --- a/panels/project.cpp +++ b/panels/project.cpp @@ -177,7 +177,7 @@ Project::Project(QWidget *parent) : connect(icon_view, SIGNAL(changed_root()), this, SLOT(set_up_dir_enabled())); //retranslateUi(Project); - setWindowTitle(QApplication::translate("Project", "Project", nullptr)); + setWindowTitle(tr("Project")); update_view_type(); } @@ -187,7 +187,7 @@ Project::~Project() { } QString Project::get_next_sequence_name(QString start) { - if (start.isEmpty()) start = "Sequence"; + if (start.isEmpty()) start = tr("Sequence"); int n = 1; bool found = true; @@ -308,7 +308,11 @@ void Project::replace_selected_file() { void Project::replace_media(Media* item, QString filename) { if (filename.isEmpty()) { - filename = QFileDialog::getOpenFileName(this, "Replace '" + item->get_name() + "'", "", "All Files (*)"); + filename = QFileDialog::getOpenFileName( + this, + tr("Replace '%1'").arg(item->get_name()), + "", + tr("All Files") + " (*)"); } if (!filename.isEmpty()) { ReplaceMediaCommand* rmc = new ReplaceMediaCommand(item, filename); @@ -318,13 +322,19 @@ void Project::replace_media(Media* item, QString filename) { void Project::replace_clip_media() { if (sequence == NULL) { - QMessageBox::critical(this, "No active sequence", "No sequence is active, please open the sequence you want to replace clips from.", QMessageBox::Ok); + QMessageBox::critical(this, + tr("No active sequence"), + tr("No sequence is active, please open the sequence you want to replace clips from."), + QMessageBox::Ok); } else { QModelIndexList selected_items = get_current_selected(); if (selected_items.size() == 1) { Media* item = item_to_media(selected_items.at(0)); if (item->get_type() == MEDIA_TYPE_SEQUENCE && sequence == item->to_sequence()) { - QMessageBox::critical(this, "Active sequence selected", "You cannot insert a sequence into itself, so no clips of this media would be in this sequence.", QMessageBox::Ok); + QMessageBox::critical(this, + tr("Active sequence selected"), + tr("You cannot insert a sequence into itself, so no clips of this media would be in this sequence."), + QMessageBox::Ok); } else { ReplaceClipMediaDialog dialog(this, item); dialog.exec(); @@ -353,7 +363,11 @@ void Project::open_properties() { default: { // fall back to renaming - QString new_name = QInputDialog::getText(this, "Rename '" + item->get_name() + "'", "Enter new name:", QLineEdit::Normal, item->get_name()); + QString new_name = QInputDialog::getText(this, + tr("Rename '%1'").arg(item->get_name()), + tr("Enter new name:"), + QLineEdit::Normal, + item->get_name()); if (!new_name.isEmpty()) { MediaRename* mr = new MediaRename(item, new_name); undo_stack.push(mr); @@ -466,11 +480,11 @@ void Project::delete_selected_media() { if (!confirm_delete) { // we found a reference, so we know we'll need to ask if the user wants to delete it QMessageBox confirm(this); - confirm.setWindowTitle("Delete media in use?"); - confirm.setText("The media '" + media->name + "' is currently used in '" + s->name + "'. Deleting it will remove all instances in the sequence. Are you sure you want to do this?"); + confirm.setWindowTitle(tr("Delete media in use?")); + confirm.setText(tr("The media '%1' is currently used in '%2'. Deleting it will remove all instances in the sequence. Are you sure you want to do this?").arg(media->name, s->name)); QAbstractButton* yes_button = confirm.addButton(QMessageBox::Yes); QAbstractButton* skip_button = NULL; - if (items.size() > 1) skip_button = confirm.addButton("Skip", QMessageBox::NoRole); + if (items.size() > 1) skip_button = confirm.addButton(tr("Skip"), QMessageBox::NoRole); QAbstractButton* abort_button = confirm.addButton(QMessageBox::Cancel); confirm.exec(); if (confirm.clickedButton() == yes_button) { @@ -693,7 +707,11 @@ void Project::process_file_list(QStringList& files, bool recursive, Media* repla } if (!found) { image_sequence_urls.append(new_filename); - if (QMessageBox::question(this, "Image sequence detected", "The file '" + file + "' appears to be part of an image sequence. Would you like to import it as such?", QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::Yes) { + if (QMessageBox::question(this, + tr("Image sequence detected"), + tr("The file '%1' appears to be part of an image sequence. Would you like to import it as such?").arg(file), + QMessageBox::Yes | QMessageBox::No, + QMessageBox::Yes) == QMessageBox::Yes) { file = new_filename; image_sequence_importassequence.append(true); } else { @@ -796,7 +814,7 @@ bool Project::reveal_media(Media *media, QModelIndex parent) { } void Project::import_dialog() { - QFileDialog fd(this, "Import media...", "", "All Files (*)"); + QFileDialog fd(this, tr("Import media..."), "", tr("All Files") + " (*)"); fd.setFileMode(QFileDialog::ExistingFiles); if (fd.exec()) { @@ -807,7 +825,10 @@ void Project::import_dialog() { void Project::delete_clips_using_selected_media() { if (sequence == NULL) { - QMessageBox::critical(this, "No active sequence", "No sequence is active, please open the sequence you want to delete clips from.", QMessageBox::Ok); + QMessageBox::critical(this, + tr("No active sequence"), + tr("No sequence is active, please open the sequence you want to delete clips from."), + QMessageBox::Ok); } else { ComboAction* ca = new ComboAction(); bool deleted = false; diff --git a/panels/timeline.cpp b/panels/timeline.cpp index c03d61f12..c45246c33 100644 --- a/panels/timeline.cpp +++ b/panels/timeline.cpp @@ -400,10 +400,11 @@ void Timeline::update_sequence() { addButton->setEnabled(!null_sequence); headers->setEnabled(!null_sequence); + QString title = tr("Timeline: "); if (null_sequence) { - setWindowTitle("Timeline: "); + setWindowTitle(title + tr("")); } else { - setWindowTitle("Timeline: " + sequence->name); + setWindowTitle(title + sequence->name); update_ui(false); } } @@ -1010,15 +1011,15 @@ void Timeline::paste(bool insert) { } if (found >= 0 && ask_conflict) { QMessageBox box(this); - box.setWindowTitle("Effect already exists"); - box.setText("Clip '" + c->name + "' already contains a '" + e->meta->name + "' effect. Would you like to replace it with the pasted one or add it as a separate effect?"); + box.setWindowTitle(tr("Effect already exists")); + box.setText(tr("Clip '%1' already contains a '%2' effect. Would you like to replace it with the pasted one or add it as a separate effect?").arg(c->name, e->meta->name)); box.setIcon(QMessageBox::Icon::Question); - box.addButton("Add", QMessageBox::YesRole); - QPushButton* replace_button = box.addButton("Replace", QMessageBox::NoRole); - QPushButton* skip_button = box.addButton("Skip", QMessageBox::RejectRole); + box.addButton(tr("Add"), QMessageBox::YesRole); + QPushButton* replace_button = box.addButton(tr("Replace"), QMessageBox::NoRole); + QPushButton* skip_button = box.addButton(tr("Skip"), QMessageBox::RejectRole); - QCheckBox* future_box = new QCheckBox("Do this for all conflicts found"); + QCheckBox* future_box = new QCheckBox(tr("Do this for all conflicts found")); box.setCheckBox(future_box); box.exec(); @@ -1392,8 +1393,8 @@ void Timeline::set_marker() { if (!add_marker) { QInputDialog d(this); - d.setWindowTitle("Set Marker"); - d.setLabelText("Set marker name:"); + d.setWindowTitle(tr("Set Marker")); + d.setLabelText(tr("Set marker name:")); d.setInputMode(QInputDialog::TextInput); add_marker = (d.exec() == QDialog::Accepted); marker_name = d.textValue(); @@ -1481,29 +1482,29 @@ void Timeline::add_btn_click() { QMenu add_menu(this); QAction* titleMenuItem = new QAction(&add_menu); - titleMenuItem->setText("Title..."); + titleMenuItem->setText(tr("Title...")); titleMenuItem->setData(ADD_OBJ_TITLE); add_menu.addAction(titleMenuItem); QAction* solidMenuItem = new QAction(&add_menu); - solidMenuItem->setText("Solid Color..."); + solidMenuItem->setText(tr("Solid Color...")); solidMenuItem->setData(ADD_OBJ_SOLID); add_menu.addAction(solidMenuItem); QAction* barsMenuItem = new QAction(&add_menu); - barsMenuItem->setText("Bars..."); + barsMenuItem->setText(tr("Bars...")); barsMenuItem->setData(ADD_OBJ_BARS); add_menu.addAction(barsMenuItem); add_menu.addSeparator(); QAction* toneMenuItem = new QAction(&add_menu); - toneMenuItem->setText("Tone..."); + toneMenuItem->setText(tr("Tone...")); toneMenuItem->setData(ADD_OBJ_TONE); add_menu.addAction(toneMenuItem); QAction* noiseMenuItem = new QAction(&add_menu); - noiseMenuItem->setText("Noise..."); + noiseMenuItem->setText(tr("Noise...")); noiseMenuItem->setData(ADD_OBJ_NOISE); add_menu.addAction(noiseMenuItem); @@ -1525,11 +1526,16 @@ void Timeline::setScroll(int s) { void Timeline::record_btn_click() { if (project_url.isEmpty()) { - QMessageBox::critical(this, "Unsaved Project", "You must save this project before you can record audio in it.", QMessageBox::Ok); + QMessageBox::critical(this, + tr("Unsaved Project"), + tr("You must save this project before you can record audio in it."), + QMessageBox::Ok); } else { creating = true; creating_object = ADD_OBJ_AUDIO; - mainWindow->statusBar()->showMessage("Click on the timeline where you want to start recording (drag to limit the recording to a certain timeframe)", 10000); + mainWindow->statusBar()->showMessage( + tr("Click on the timeline where you want to start recording (drag to limit the recording to a certain timeframe)"), + 10000); } } @@ -1608,7 +1614,7 @@ void Timeline::setup_ui() { arrow_icon.addFile(QStringLiteral(":/icons/arrow-disabled.png"), QSize(), QIcon::Disabled, QIcon::Off); toolArrowButton->setIcon(arrow_icon); toolArrowButton->setCheckable(true); - toolArrowButton->setToolTip("Pointer Tool (V)"); + toolArrowButton->setToolTip(tr("Pointer Tool") + " (V)"); toolArrowButton->setProperty("tool", TIMELINE_TOOL_POINTER); connect(toolArrowButton, SIGNAL(clicked(bool)), this, SLOT(set_tool())); tool_buttons_layout->addWidget(toolArrowButton); @@ -1619,7 +1625,7 @@ void Timeline::setup_ui() { icon1.addFile(QStringLiteral(":/icons/beam-disabled.png"), QSize(), QIcon::Disabled, QIcon::Off); toolEditButton->setIcon(icon1); toolEditButton->setCheckable(true); - toolEditButton->setToolTip("Edit Tool (X)"); + toolEditButton->setToolTip(tr("Edit Tool") + " (X)"); toolEditButton->setProperty("tool", TIMELINE_TOOL_EDIT); connect(toolEditButton, SIGNAL(clicked(bool)), this, SLOT(set_tool())); tool_buttons_layout->addWidget(toolEditButton); @@ -1630,7 +1636,7 @@ void Timeline::setup_ui() { icon2.addFile(QStringLiteral(":/icons/ripple-disabled.png"), QSize(), QIcon::Disabled, QIcon::Off); toolRippleButton->setIcon(icon2); toolRippleButton->setCheckable(true); - toolRippleButton->setToolTip("Ripple Tool (B)"); + toolRippleButton->setToolTip(tr("Ripple Tool") + " (B)"); toolRippleButton->setProperty("tool", TIMELINE_TOOL_RIPPLE); connect(toolRippleButton, SIGNAL(clicked(bool)), this, SLOT(set_tool())); tool_buttons_layout->addWidget(toolRippleButton); @@ -1641,7 +1647,7 @@ void Timeline::setup_ui() { icon4.addFile(QStringLiteral(":/icons/razor-disabled.png"), QSize(), QIcon::Disabled, QIcon::Off); toolRazorButton->setIcon(icon4); toolRazorButton->setCheckable(true); - toolRazorButton->setToolTip("Razor Tool (C)"); + toolRazorButton->setToolTip(tr("Razor Tool") + " (C)"); toolRazorButton->setProperty("tool", TIMELINE_TOOL_RAZOR); connect(toolRazorButton, SIGNAL(clicked(bool)), this, SLOT(set_tool())); tool_buttons_layout->addWidget(toolRazorButton); @@ -1652,7 +1658,7 @@ void Timeline::setup_ui() { icon5.addFile(QStringLiteral(":/icons/slip-disabled.png"), QSize(), QIcon::Disabled, QIcon::On); toolSlipButton->setIcon(icon5); toolSlipButton->setCheckable(true); - toolSlipButton->setToolTip("Slip Tool (Y)"); + toolSlipButton->setToolTip(tr("Slip Tool") + " (Y)"); toolSlipButton->setProperty("tool", TIMELINE_TOOL_SLIP); connect(toolSlipButton, SIGNAL(clicked(bool)), this, SLOT(set_tool())); tool_buttons_layout->addWidget(toolSlipButton); @@ -1663,7 +1669,7 @@ void Timeline::setup_ui() { icon6.addFile(QStringLiteral(":/icons/slide-disabled.png"), QSize(), QIcon::Disabled, QIcon::On); toolSlideButton->setIcon(icon6); toolSlideButton->setCheckable(true); - toolSlideButton->setToolTip("Slide Tool (U)"); + toolSlideButton->setToolTip(tr("Slide Tool") + " (U)"); toolSlideButton->setProperty("tool", TIMELINE_TOOL_SLIDE); connect(toolSlideButton, SIGNAL(clicked(bool)), this, SLOT(set_tool())); tool_buttons_layout->addWidget(toolSlideButton); @@ -1674,7 +1680,7 @@ void Timeline::setup_ui() { icon7.addFile(QStringLiteral(":/icons/hand-disabled.png"), QSize(), QIcon::Disabled, QIcon::On); toolHandButton->setIcon(icon7); toolHandButton->setCheckable(true); - toolHandButton->setToolTip("Hand Tool (H)"); + toolHandButton->setToolTip(tr("Hand Tool") + " (H)"); toolHandButton->setProperty("tool", TIMELINE_TOOL_HAND); connect(toolHandButton, SIGNAL(clicked(bool)), this, SLOT(set_tool())); tool_buttons_layout->addWidget(toolHandButton); @@ -1685,7 +1691,7 @@ void Timeline::setup_ui() { icon8.addFile(QStringLiteral(":/icons/transition-tool-disabled.png"), QSize(), QIcon::Disabled, QIcon::On); toolTransitionButton->setIcon(icon8); toolTransitionButton->setCheckable(true); - toolTransitionButton->setToolTip("Transition Tool (T)"); + toolTransitionButton->setToolTip(tr("Transition Tool") + " (T)"); connect(toolTransitionButton, SIGNAL(clicked(bool)), this, SLOT(transition_tool_click())); tool_buttons_layout->addWidget(toolTransitionButton); @@ -1696,7 +1702,7 @@ void Timeline::setup_ui() { snappingButton->setIcon(icon9); snappingButton->setCheckable(true); snappingButton->setChecked(true); - snappingButton->setToolTip("Snapping (S)"); + snappingButton->setToolTip(tr("Snapping") + " (S)"); connect(snappingButton, SIGNAL(toggled(bool)), this, SLOT(snapping_clicked(bool))); tool_buttons_layout->addWidget(snappingButton); @@ -1705,7 +1711,7 @@ void Timeline::setup_ui() { icon10.addFile(QStringLiteral(":/icons/zoomin.png"), QSize(), QIcon::Normal, QIcon::On); icon10.addFile(QStringLiteral(":/icons/zoomin-disabled.png"), QSize(), QIcon::Disabled, QIcon::On); zoomInButton->setIcon(icon10); - zoomInButton->setToolTip("Zoom In (=)"); + zoomInButton->setToolTip(tr("Zoom In") + " (=)"); connect(zoomInButton, SIGNAL(clicked(bool)), this, SLOT(zoom_in())); tool_buttons_layout->addWidget(zoomInButton); @@ -1714,7 +1720,7 @@ void Timeline::setup_ui() { icon11.addFile(QStringLiteral(":/icons/zoomout.png"), QSize(), QIcon::Normal, QIcon::On); icon11.addFile(QStringLiteral(":/icons/zoomout-disabled.png"), QSize(), QIcon::Disabled, QIcon::On); zoomOutButton->setIcon(icon11); - zoomOutButton->setToolTip("Zoom Out (-)"); + zoomOutButton->setToolTip(tr("Zoom Out") + " (-)"); connect(zoomOutButton, SIGNAL(clicked(bool)), this, SLOT(zoom_out())); tool_buttons_layout->addWidget(zoomOutButton); @@ -1723,7 +1729,7 @@ void Timeline::setup_ui() { icon12.addFile(QStringLiteral(":/icons/record.png"), QSize(), QIcon::Normal, QIcon::On); icon12.addFile(QStringLiteral(":/icons/record-disabled.png"), QSize(), QIcon::Disabled, QIcon::On); recordButton->setIcon(icon12); - recordButton->setToolTip("Record audio"); + recordButton->setToolTip(tr("Record audio")); connect(recordButton, SIGNAL(clicked(bool)), this, SLOT(record_btn_click())); tool_buttons_layout->addWidget(recordButton); @@ -1733,7 +1739,7 @@ void Timeline::setup_ui() { icon13.addFile(QStringLiteral(":/icons/add-button.png"), QSize(), QIcon::Normal, QIcon::On); icon13.addFile(QStringLiteral(":/icons/add-button-disabled.png"), QSize(), QIcon::Disabled, QIcon::On); addButton->setIcon(icon13); - addButton->setToolTip("Add title, solid, bars, etc."); + addButton->setToolTip(tr("Add title, solid, bars, etc.")); connect(addButton, SIGNAL(clicked()), this, SLOT(add_btn_click())); tool_buttons_layout->addWidget(addButton); diff --git a/panels/viewer.cpp b/panels/viewer.cpp index be165cfd7..36a75a881 100644 --- a/panels/viewer.cpp +++ b/panels/viewer.cpp @@ -44,7 +44,7 @@ Viewer::Viewer(QWidget *parent) : seq(NULL), created_sequence(false), cue_recording_internal(false), - panel_name("Viewer: "), + panel_name(tr("Viewer: ")), minimum_zoom(1.0) { setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); @@ -785,7 +785,7 @@ void Viewer::set_sequence(bool main, Sequence *s) { update_playhead_timecode(0); update_end_timecode(); - setWindowTitle(panel_name + "(none)"); + setWindowTitle(panel_name + tr("(none)")); } update_header_zoom(); diff --git a/playback/audio.cpp b/playback/audio.cpp index 71c71b81b..9f96759ec 100644 --- a/playback/audio.cpp +++ b/playback/audio.cpp @@ -292,7 +292,7 @@ bool start_recording() { return false; } - QString audio_path = project_url + " Audio"; + QString audio_path = project_url + " " + QCoreApplication::translate("Audio", "Audio"); QDir audio_dir(audio_path); if (!audio_dir.exists() && !audio_dir.mkpath(".")) { qCritical() << "Failed to create audio directory"; @@ -303,7 +303,7 @@ bool start_recording() { int file_number = 0; do { file_number++; - audio_filename = audio_path + "/Recording " + QString::number(file_number) + ".wav"; + audio_filename = audio_path + "/" + QCoreApplication::translate("Audio", "Recording") + " " + QString::number(file_number) + ".wav"; } while (QFile(audio_filename).exists()); output_recording.setFileName(audio_filename); diff --git a/playback/cacher.cpp b/playback/cacher.cpp index cc6cddd56..6a0cbc0fd 100644 --- a/playback/cacher.cpp +++ b/playback/cacher.cpp @@ -749,7 +749,7 @@ void open_clip_worker(Clip* clip) { bool stabilize = false; if (stabilize) { AVFilterContext* stab_filter; - int stab_ret = avfilter_graph_create_filter(&stab_filter, avfilter_get_by_name("vidstabtransform"), "vidstab", "input=/media/matt/Home/samples/transforms.trf", NULL, clip->filter_graph); + int stab_ret = avfilter_graph_create_filter(&stab_filter, avfilter_get_by_name("vidstabtransform"), "vidstab", "input=", NULL, clip->filter_graph); if (stab_ret < 0) { char err[100]; av_strerror(stab_ret, err, sizeof(err)); diff --git a/project/effect.cpp b/project/effect.cpp index 14400133e..a40393f2c 100644 --- a/project/effect.cpp +++ b/project/effect.cpp @@ -43,6 +43,7 @@ #include #include #include +#include bool shaders_are_enabled = true; QVector effects; @@ -71,7 +72,9 @@ Effect* create_effect(Clip* c, const EffectMeta* em) { } } else { qCritical() << "Invalid effect data"; - QMessageBox::critical(mainWindow, "Invalid effect", "No candidate for effect '" + em->name + "'. This effect may be corrupt. Try reinstalling it or Olive."); + QMessageBox::critical(mainWindow, + QCoreApplication::translate("Effect", "Invalid effect"), + QCoreApplication::translate("Effect", "No candidate for effect '%1'. This effect may be corrupt. Try reinstalling it or Olive.").arg(em->name)); } return NULL; } @@ -86,7 +89,7 @@ const EffectMeta* get_internal_meta(int internal_id, int type) { } void load_internal_effects() { - qWarning() << "Shaders are disabled, some effects may be nonfunctional"; + if (!shaders_are_enabled) qWarning() << "Shaders are disabled, some effects may be nonfunctional"; EffectMeta em; @@ -545,18 +548,18 @@ void Effect::show_context_menu(const QPoint& pos) { int index = get_index_in_clip(); if (index > 0) { - QAction* move_up = menu.addAction("Move &Up"); + QAction* move_up = menu.addAction(tr("Move &Up")); connect(move_up, SIGNAL(triggered(bool)), this, SLOT(move_up())); } if (index < parent_clip->effects.size() - 1) { - QAction* move_down = menu.addAction("Move &Down"); + QAction* move_down = menu.addAction(tr("Move &Down")); connect(move_down, SIGNAL(triggered(bool)), this, SLOT(move_down())); } menu.addSeparator(); - QAction* del_action = menu.addAction("D&elete"); + QAction* del_action = menu.addAction(tr("D&elete")); connect(del_action, SIGNAL(triggered(bool)), this, SLOT(delete_self())); menu.exec(container->title_bar->mapToGlobal(pos)); diff --git a/project/effectrow.cpp b/project/effectrow.cpp index 4735e8def..7ab647d3d 100644 --- a/project/effectrow.cpp +++ b/project/effectrow.cpp @@ -64,7 +64,10 @@ void EffectRow::set_keyframe_enabled(bool enabled) { set_keyframe_now(ca); undo_stack.push(ca); } else { - if (QMessageBox::question(panel_effect_controls, "Disable Keyframes", "Disabling keyframes will delete all current keyframes. Are you sure you want to do this?", QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) { + if (QMessageBox::question(panel_effect_controls, + tr("Disable Keyframes"), + tr("Disabling keyframes will delete all current keyframes. Are you sure you want to do this?"), + QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) { // clear ComboAction* ca = new ComboAction(); for (int i=0;i +#include #include "debug.h" @@ -19,18 +20,18 @@ extern "C" { QString get_interlacing_name(int interlacing) { switch (interlacing) { - case VIDEO_PROGRESSIVE: return "None (Progressive)"; - case VIDEO_TOP_FIELD_FIRST: return "Top Field First"; - case VIDEO_BOTTOM_FIELD_FIRST: return "Bottom Field First"; - default: return "Invalid"; + case VIDEO_PROGRESSIVE: return QCoreApplication::translate("InterlacingName", "None (Progressive)"); + case VIDEO_TOP_FIELD_FIRST: return QCoreApplication::translate("InterlacingName", "Top Field First"); + case VIDEO_BOTTOM_FIELD_FIRST: return QCoreApplication::translate("InterlacingName", "Bottom Field First"); + default: return QCoreApplication::translate("InterlacingName", "Invalid"); } } QString get_channel_layout_name(int channels, uint64_t layout) { switch (channels) { - case 0: return "Invalid"; break; - case 1: return "Mono"; break; - case 2: return "Stereo"; break; + case 0: return QCoreApplication::translate("ChannelLayoutName", "Invalid"); break; + case 1: return QCoreApplication::translate("ChannelLayoutName", "Mono"); break; + case 2: return QCoreApplication::translate("ChannelLayoutName", "Stereo"); break; default: { char buf[50]; av_get_channel_layout_string(buf, sizeof(buf), channels, layout); @@ -76,7 +77,7 @@ void Media::set_sequence(Sequence *s) { } void Media::set_folder() { - if (folder_name.isEmpty()) folder_name = "New Folder"; + if (folder_name.isEmpty()) folder_name = QCoreApplication::translate("Media", "New Folder"); set_icon(QIcon(":/icons/folder.png")); type = MEDIA_TYPE_FOLDER; object = NULL; @@ -95,11 +96,11 @@ void Media::update_tooltip(const QString& error) { case MEDIA_TYPE_FOOTAGE: { Footage* f = to_footage(); - tooltip = "Name: " + f->name + "\nFilename: " + f->url + "\n"; + tooltip = QCoreApplication::translate("Media", "Name:") + " " + f->name + "\n" + QCoreApplication::translate("Media", "Filename:") + " " + f->url + "\n"; if (error.isEmpty()) { if (f->video_tracks.size() > 0) { - tooltip += "Video Dimensions: "; + tooltip += QCoreApplication::translate("Media", "Video Dimensions:") + " "; for (int i=0;ivideo_tracks.size();i++) { if (i > 0) { tooltip += ", "; @@ -109,7 +110,7 @@ void Media::update_tooltip(const QString& error) { tooltip += "\n"; if (!f->video_tracks.at(0).infinite_length) { - tooltip += "Frame Rate: "; + tooltip += QCoreApplication::translate("Media", "Frame Rate:") + " "; for (int i=0;ivideo_tracks.size();i++) { if (i > 0) { tooltip += ", "; @@ -117,14 +118,16 @@ void Media::update_tooltip(const QString& error) { if (f->video_tracks.at(i).video_interlacing == VIDEO_PROGRESSIVE) { tooltip += QString::number(f->video_tracks.at(i).video_frame_rate * f->speed); } else { - tooltip += QString::number(f->video_tracks.at(i).video_frame_rate * f->speed * 2); - tooltip += " fields (" + QString::number(f->video_tracks.at(i).video_frame_rate * f->speed) + " frames)"; + tooltip += QCoreApplication::translate("Media", "%1 fields (%2 frames)").arg( + QString::number(f->video_tracks.at(i).video_frame_rate * f->speed * 2), + QString::number(f->video_tracks.at(i).video_frame_rate * f->speed) + ); } } tooltip += "\n"; } - tooltip += "Interlacing: "; + tooltip += QCoreApplication::translate("Media", "Interlacing:") + " "; for (int i=0;ivideo_tracks.size();i++) { if (i > 0) { tooltip += ", "; @@ -136,7 +139,7 @@ void Media::update_tooltip(const QString& error) { if (f->audio_tracks.size() > 0) { tooltip += "\n"; - tooltip += "Audio Frequency: "; + tooltip += QCoreApplication::translate("Media", "Audio Frequency:") + " "; for (int i=0;iaudio_tracks.size();i++) { if (i > 0) { tooltip += ", "; @@ -145,7 +148,7 @@ void Media::update_tooltip(const QString& error) { } tooltip += "\n"; - tooltip += "Audio Channels: "; + tooltip += QCoreApplication::translate("Media", "Audio Channels:") + " "; for (int i=0;iaudio_tracks.size();i++) { if (i > 0) { tooltip += ", "; @@ -162,11 +165,19 @@ void Media::update_tooltip(const QString& error) { case MEDIA_TYPE_SEQUENCE: { Sequence* s = to_sequence(); - tooltip = "Name: " + s->name - + "\nVideo Dimensions: " + QString::number(s->width) + "x" + QString::number(s->height) - + "\nFrame Rate: " + QString::number(s->frame_rate) - + "\nAudio Frequency: " + QString::number(s->audio_frequency) - + "\nAudio Layout: " + get_channel_layout_name(av_get_channel_layout_nb_channels(s->audio_layout), s->audio_layout); + + tooltip = QCoreApplication::translate("Media", "Name: %1" + "\nVideo Dimensions: %2x%3" + "\nFrame Rate: %4" + "\nAudio Frequency: %5" + "\nAudio Layout: %6").arg( + s->name, + QString::number(s->width), + QString::number(s->height), + QString::number(s->frame_rate), + QString::number(s->audio_frequency), + get_channel_layout_name(av_get_channel_layout_nb_channels(s->audio_layout), s->audio_layout) + ); } break; } @@ -268,9 +279,9 @@ QVariant Media::data(int column, int role) { break; case Qt::DisplayRole: switch (column) { - case 0: return (root) ? "Name" : get_name(); + case 0: return (root) ? QCoreApplication::translate("Media", "Name") : get_name(); case 1: - if (root) return "Duration"; + if (root) return QCoreApplication::translate("Media", "Duration"); if (get_type() == MEDIA_TYPE_SEQUENCE) { Sequence* s = to_sequence(); return frame_to_timecode(s->getEndFrame(), config.timecode_view, s->frame_rate); @@ -287,7 +298,7 @@ QVariant Media::data(int column, int role) { } break; case 2: - if (root) return "Rate"; + if (root) return QCoreApplication::translate("Media", "Rate"); if (get_type() == MEDIA_TYPE_SEQUENCE) return QString::number(get_frame_rate()) + " FPS"; if (get_type() == MEDIA_TYPE_FOOTAGE) { Footage* f = to_footage(); diff --git a/project/sequence.cpp b/project/sequence.cpp index 1a902966d..198878f20 100644 --- a/project/sequence.cpp +++ b/project/sequence.cpp @@ -3,6 +3,8 @@ #include "clip.h" #include "transition.h" +#include + #include "debug.h" Sequence::Sequence() : @@ -24,7 +26,7 @@ Sequence::~Sequence() { Sequence* Sequence::copy() { Sequence* s = new Sequence(); - s->name = name + " (copy)"; + s->name = QCoreApplication::translate("Sequence", "%1 (copy)").arg(name); s->width = width; s->height = height; s->frame_rate = frame_rate; diff --git a/project/sourcescommon.cpp b/project/sourcescommon.cpp index 04d6dc781..ddffd89d2 100644 --- a/project/sourcescommon.cpp +++ b/project/sourcescommon.cpp @@ -49,10 +49,10 @@ void SourcesCommon::show_context_menu(QWidget* parent, const QModelIndexList& it selected_items = items; - QAction* import_action = menu.addAction("Import..."); + QAction* import_action = menu.addAction(tr("Import...")); QObject::connect(import_action, SIGNAL(triggered(bool)), project_parent, SLOT(import_dialog())); - QMenu* new_menu = menu.addMenu("New"); + QMenu* new_menu = menu.addMenu(tr("New")); mainWindow->make_new_menu(new_menu); if (items.size() > 0) { @@ -62,20 +62,20 @@ void SourcesCommon::show_context_menu(QWidget* parent, const QModelIndexList& it // replace footage int type = m->get_type(); if (type == MEDIA_TYPE_FOOTAGE) { - QAction* replace_action = menu.addAction("Replace/Relink Media"); + QAction* replace_action = menu.addAction(tr("Replace/Relink Media")); QObject::connect(replace_action, SIGNAL(triggered(bool)), project_parent, SLOT(replace_selected_file())); #if defined(Q_OS_WIN) - QAction* reveal_in_explorer = menu.addAction("Reveal in Explorer"); + QAction* reveal_in_explorer = menu.addAction(tr("Reveal in Explorer")); #elif defined(Q_OS_MAC) - QAction* reveal_in_explorer = menu.addAction("Reveal in Finder"); + QAction* reveal_in_explorer = menu.addAction(tr("Reveal in Finder")); #else - QAction* reveal_in_explorer = menu.addAction("Reveal in File Manager"); + QAction* reveal_in_explorer = menu.addAction(tr("Reveal in File Manager")); #endif QObject::connect(reveal_in_explorer, SIGNAL(triggered(bool)), this, SLOT(reveal_in_browser())); } if (type != MEDIA_TYPE_FOLDER) { - QAction* replace_clip_media = menu.addAction("Replace Clips Using This Media"); + QAction* replace_clip_media = menu.addAction(tr("Replace Clips Using This Media")); QObject::connect(replace_clip_media, SIGNAL(triggered(bool)), project_parent, SLOT(replace_clip_media())); } } @@ -93,41 +93,41 @@ void SourcesCommon::show_context_menu(QWidget* parent, const QModelIndexList& it } // create sequence from - QAction* create_seq_from = menu.addAction("Create Sequence With This Media"); + QAction* create_seq_from = menu.addAction(tr("Create Sequence With This Media")); QObject::connect(create_seq_from, SIGNAL(triggered(bool)), this, SLOT(create_seq_from_selected())); // ONLY sequences are selected if (all_sequences) { // ONLY sequences are selected - QAction* duplicate_action = menu.addAction("Duplicate"); + QAction* duplicate_action = menu.addAction(tr("Duplicate")); QObject::connect(duplicate_action, SIGNAL(triggered(bool)), project_parent, SLOT(duplicate_selected())); } // ONLY footage is selected if (all_footage) { - QAction* delete_footage_from_sequences = menu.addAction("Delete All Clips Using This Media"); + QAction* delete_footage_from_sequences = menu.addAction(tr("Delete All Clips Using This Media")); QObject::connect(delete_footage_from_sequences, SIGNAL(triggered(bool)), project_parent, SLOT(delete_clips_using_selected_media())); } // delete media - QAction* delete_action = menu.addAction("Delete"); + QAction* delete_action = menu.addAction(tr("Delete")); QObject::connect(delete_action, SIGNAL(triggered(bool)), project_parent, SLOT(delete_selected_media())); if (items.size() == 1) { - QAction* properties_action = menu.addAction("Properties..."); + QAction* properties_action = menu.addAction(tr("Properties...")); QObject::connect(properties_action, SIGNAL(triggered(bool)), project_parent, SLOT(open_properties())); } } menu.addSeparator(); - QAction* tree_view_action = menu.addAction("Tree View"); + QAction* tree_view_action = menu.addAction(tr("Tree View")); connect(tree_view_action, SIGNAL(triggered(bool)), project_parent, SLOT(set_tree_view())); - QAction* icon_view_action = menu.addAction("Icon View"); + QAction* icon_view_action = menu.addAction(tr("Icon View")); connect(icon_view_action, SIGNAL(triggered(bool)), project_parent, SLOT(set_icon_view())); - QAction* toolbar_action = menu.addAction("Show Toolbar"); + QAction* toolbar_action = menu.addAction(tr("Show Toolbar")); toolbar_action->setCheckable(true); toolbar_action->setChecked(project_parent->toolbar_widget->isVisible()); connect(toolbar_action, SIGNAL(triggered(bool)), project_parent->toolbar_widget, SLOT(setVisible(bool))); @@ -183,7 +183,11 @@ void SourcesCommon::dropEvent(QWidget* parent, QDropEvent *event, const QModelIn && m->get_type() == MEDIA_TYPE_FOOTAGE && !QFileInfo(paths.at(0)).isDir() && config.drop_on_media_to_replace - && QMessageBox::question(parent, "Replace Media", "You dropped a file onto '" + m->get_name() + "'. Would you like to replace it with the dropped file?", QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) { + && QMessageBox::question( + parent, + tr("Replace Media"), + tr("You dropped a file onto '%1'. Would you like to replace it with the dropped file?").arg(m->get_name()), + QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) { replace = true; project_parent->replace_media(m, paths.at(0)); } diff --git a/project/transition.cpp b/project/transition.cpp index 3badb5ca3..a76ac53f7 100644 --- a/project/transition.cpp +++ b/project/transition.cpp @@ -19,12 +19,13 @@ #include "panels/timeline.h" #include +#include Transition::Transition(Clip* c, Clip* s, const EffectMeta* em) : Effect(c, em), secondary_clip(s), length(30) { - length_field = add_row("Length:", false)->add_field(EFFECT_FIELD_DOUBLE, "length"); + length_field = add_row(tr("Length:"), false)->add_field(EFFECT_FIELD_DOUBLE, "length"); connect(length_field, SIGNAL(changed()), this, SLOT(set_length_from_slider())); length_field->set_double_default_value(30); length_field->set_double_minimum_value(0); @@ -74,7 +75,10 @@ Transition* get_transition_from_meta(Clip* c, Clip* s, const EffectMeta* em) { } } else { qCritical() << "Invalid transition data"; - QMessageBox::critical(mainWindow, "Invalid transition", "No candidate for transition '" + em->name + "'. This transition may be corrupt. Try reinstalling it or Olive."); + QMessageBox::critical(mainWindow, + QCoreApplication::translate("transition", "Invalid transition"), + QCoreApplication::translate("transition", "No candidate for transition '%1'. This transition may be corrupt. Try reinstalling it or Olive.").arg(em->name) + ); } return NULL; } diff --git a/ui/collapsiblewidget.cpp b/ui/collapsiblewidget.cpp index fddebc040..104e43892 100644 --- a/ui/collapsiblewidget.cpp +++ b/ui/collapsiblewidget.cpp @@ -33,7 +33,7 @@ CollapsibleWidget::CollapsibleWidget(QWidget* parent) : QWidget(parent) { collapse_button = new QPushButton(); collapse_button->setIconSize(QSize(8, 8)); collapse_button->setStyleSheet("QPushButton { border: none; }"); - setText(""); + setText(tr("")); title_bar_layout->addWidget(collapse_button); title_bar_layout->addWidget(enabled_check); title_bar_layout->addWidget(header); diff --git a/ui/colorbutton.cpp b/ui/colorbutton.cpp index 026d1c42d..c48dc8249 100644 --- a/ui/colorbutton.cpp +++ b/ui/colorbutton.cpp @@ -31,7 +31,7 @@ void ColorButton::set_button_color() { } void ColorButton::open_dialog() { - QColor new_color = QColorDialog::getColor(color, NULL, "Set Color"); + QColor new_color = QColorDialog::getColor(color, NULL, tr("Set Color")); if (new_color.isValid() && color != new_color) { set_color(new_color); set_button_color(); diff --git a/ui/embeddedfilechooser.cpp b/ui/embeddedfilechooser.cpp index adb1e8484..140149a25 100644 --- a/ui/embeddedfilechooser.cpp +++ b/ui/embeddedfilechooser.cpp @@ -35,7 +35,7 @@ void EmbeddedFileChooser::setFilename(const QString &s) { } void EmbeddedFileChooser::update_label() { - QString l = "File: "; + QString l = "" + tr("File:") + " "; if (filename.isEmpty()) { l += "(none)"; } else { diff --git a/ui/graphview.cpp b/ui/graphview.cpp index fc1b82db0..efb9aa134 100644 --- a/ui/graphview.cpp +++ b/ui/graphview.cpp @@ -58,14 +58,14 @@ GraphView::GraphView(QWidget* parent) : void GraphView::show_context_menu(const QPoint& pos) { QMenu menu(this); - QAction* zoom_to_selection = menu.addAction("Zoom to Selection"); + QAction* zoom_to_selection = menu.addAction(tr("Zoom to Selection")); if (selected_keys.size() == 0 || row == NULL) { zoom_to_selection->setEnabled(false); } else { connect(zoom_to_selection, SIGNAL(triggered(bool)), this, SLOT(set_view_to_selection())); } - QAction* zoom_to_all = menu.addAction("Zoom to Show All"); + QAction* zoom_to_all = menu.addAction(tr("Zoom to Show All")); if (row == NULL) { zoom_to_all->setEnabled(false); } else { @@ -74,7 +74,7 @@ void GraphView::show_context_menu(const QPoint& pos) { menu.addSeparator(); - QAction* reset_action = menu.addAction("Reset View"); + QAction* reset_action = menu.addAction(tr("Reset View")); if (row == NULL) { reset_action->setEnabled(false); } else { diff --git a/ui/keyframenavigator.cpp b/ui/keyframenavigator.cpp index f5495a135..b3bb95c32 100644 --- a/ui/keyframenavigator.cpp +++ b/ui/keyframenavigator.cpp @@ -53,7 +53,7 @@ KeyframeNavigator::KeyframeNavigator(QWidget *parent) : QWidget(parent) { keyframe_enable->setMaximumSize(button_size); keyframe_enable->setIconSize(clock_size); keyframe_enable->setCheckable(true); - keyframe_enable->setToolTip("Enable Keyframes"); + keyframe_enable->setToolTip(tr("Enable Keyframes")); connect(keyframe_enable, SIGNAL(clicked(bool)), this, SIGNAL(keyframe_enabled_changed(bool))); connect(keyframe_enable, SIGNAL(toggled(bool)), this, SLOT(keyframe_ui_enabled(bool))); connect(keyframe_enable, SIGNAL(clicked(bool)), this, SIGNAL(clicked())); diff --git a/ui/keyframeview.cpp b/ui/keyframeview.cpp index 812e34878..014029b08 100644 --- a/ui/keyframeview.cpp +++ b/ui/keyframeview.cpp @@ -50,11 +50,11 @@ void KeyframeView::show_context_menu(const QPoint& pos) { if (selected_fields.size() > 0) { QMenu menu(this); - QAction* linear = menu.addAction("Linear"); + QAction* linear = menu.addAction(tr("Linear")); linear->setData(KEYFRAME_TYPE_LINEAR); - QAction* bezier = menu.addAction("Bezier"); + QAction* bezier = menu.addAction(tr("Bezier")); bezier->setData(KEYFRAME_TYPE_BEZIER); - QAction* hold = menu.addAction("Hold"); + QAction* hold = menu.addAction(tr("Hold")); hold->setData(KEYFRAME_TYPE_HOLD); menu.addSeparator(); menu.addAction("Graph Editor"); diff --git a/ui/labelslider.cpp b/ui/labelslider.cpp index 7395ad752..d83b2b9f7 100644 --- a/ui/labelslider.cpp +++ b/ui/labelslider.cpp @@ -147,8 +147,8 @@ void LabelSlider::mouseReleaseEvent(QMouseEvent*) { if (display_type == LABELSLIDER_FRAMENUMBER) { QString s = QInputDialog::getText( this, - "Set Value", - "New value:", + tr("Set Value"), + tr("New value:"), QLineEdit::Normal, valueToString(internal_value) ); @@ -158,8 +158,8 @@ void LabelSlider::mouseReleaseEvent(QMouseEvent*) { bool ok; d = QInputDialog::getDouble( this, - "Set Value", - "New value:", + tr("Set Value"), + tr("New value:"), (display_type == LABELSLIDER_PERCENT) ? internal_value * 100 : internal_value, (min_enabled) ? min_value : INT_MIN, (max_enabled) ? max_value : INT_MAX, diff --git a/ui/timelinewidget.cpp b/ui/timelinewidget.cpp index 44b69ffdc..96bd251f1 100644 --- a/ui/timelinewidget.cpp +++ b/ui/timelinewidget.cpp @@ -221,10 +221,12 @@ void TimelineWidget::tooltip_timer_timeout() { Clip* c = sequence->clips.at(tooltip_clip); if (c != NULL) { QToolTip::showText(QCursor::pos(), - c->name - + "\nStart: " + frame_to_timecode(c->timeline_in, config.timecode_view, sequence->frame_rate) - + "\nEnd: " + frame_to_timecode(c->timeline_out, config.timecode_view, sequence->frame_rate) - + "\nDuration: " + frame_to_timecode(c->getLength(), config.timecode_view, sequence->frame_rate)); + tr("%1\nStart: %2\nEnd: %3\nDuration: %4").arg( + c->name, + frame_to_timecode(c->timeline_in, config.timecode_view, sequence->frame_rate), + frame_to_timecode(c->timeline_out, config.timecode_view, sequence->frame_rate), + frame_to_timecode(c->getLength(), config.timecode_view, sequence->frame_rate) + )); } } } @@ -241,8 +243,8 @@ void TimelineWidget::rename_clip() { } if (selected_clips.size() > 0) { QString s = QInputDialog::getText(this, - (selected_clips.size() == 1) ? "Rename '" + selected_clips.at(0)->name + "'" : "Rename multiple clips", - "Enter a new name for this clip:", + (selected_clips.size() == 1) ? tr("Rename '%1'").arg(selected_clips.at(0)->name) : tr("Rename multiple clips"), + tr("Enter a new name for this clip:"), QLineEdit::Normal, selected_clips.at(0)->name ); @@ -275,7 +277,7 @@ void TimelineWidget::open_sequence_properties() { return; } } - QMessageBox::critical(this, "Error", "Couldn't locate media wrapper for sequence."); + QMessageBox::critical(this, tr("Error"), tr("Couldn't locate media wrapper for sequence.")); } bool same_sign(int a, int b) { @@ -827,27 +829,27 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) { switch (panel_timeline->creating_object) { case ADD_OBJ_TITLE: - c->name = "Title"; + c->name = tr("Title"); c->effects.append(create_effect(c, get_internal_meta(EFFECT_INTERNAL_TEXT, EFFECT_TYPE_EFFECT))); break; case ADD_OBJ_SOLID: - c->name = "Solid Color"; + c->name = tr("Solid Color"); c->effects.append(create_effect(c, get_internal_meta(EFFECT_INTERNAL_SOLID, EFFECT_TYPE_EFFECT))); break; case ADD_OBJ_BARS: { - c->name = "Bars"; + c->name = tr("Bars"); Effect* e = create_effect(c, get_internal_meta(EFFECT_INTERNAL_SOLID, EFFECT_TYPE_EFFECT)); e->row(0)->field(0)->set_combo_index(1); c->effects.append(e); } break; case ADD_OBJ_TONE: - c->name = "Tone"; + c->name = tr("Tone"); c->effects.append(create_effect(c, get_internal_meta(EFFECT_INTERNAL_TONE, EFFECT_TYPE_EFFECT))); break; case ADD_OBJ_NOISE: - c->name = "Noise"; + c->name = tr("Noise"); c->effects.append(create_effect(c, get_internal_meta(EFFECT_INTERNAL_NOISE, EFFECT_TYPE_EFFECT))); break; } @@ -1575,7 +1577,7 @@ void TimelineWidget::update_ghosts(const QPoint& mouse_pos, bool lock_frame) { } if (g != NULL) { - tip += " Duration: "; + tip += " " + tr("Duration:") + " "; long len = (g->old_out-g->old_in); if (panel_timeline->trim_in_point) { len -= frame_diff; diff --git a/ui/viewerwidget.cpp b/ui/viewerwidget.cpp index f8adf8313..8736b96fc 100644 --- a/ui/viewerwidget.cpp +++ b/ui/viewerwidget.cpp @@ -87,14 +87,14 @@ void ViewerWidget::set_waveform_scroll(int s) { void ViewerWidget::show_context_menu() { QMenu menu(this); - QAction* save_frame_as_image = menu.addAction("Save Frame as Image..."); + QAction* save_frame_as_image = menu.addAction(tr("Save Frame as Image...")); connect(save_frame_as_image, SIGNAL(triggered(bool)), this, SLOT(save_frame())); - QAction* show_fullscreen_action = menu.addAction("Show Fullscreen"); + QAction* show_fullscreen_action = menu.addAction(tr("Show Fullscreen")); connect(show_fullscreen_action, SIGNAL(triggered()), this, SLOT(show_fullscreen())); - QMenu zoom_menu("Zoom"); - QAction* fit_zoom = zoom_menu.addAction("Fit"); + QMenu zoom_menu(tr("Zoom")); + QAction* fit_zoom = zoom_menu.addAction(tr("Fit")); connect(fit_zoom, SIGNAL(triggered(bool)), this, SLOT(set_fit_zoom())); zoom_menu.addAction("10%")->setData(0.1); zoom_menu.addAction("25%")->setData(0.25); @@ -104,13 +104,13 @@ void ViewerWidget::show_context_menu() { zoom_menu.addAction("150%")->setData(1.5); zoom_menu.addAction("200%")->setData(2.0); zoom_menu.addAction("400%")->setData(4.0); - QAction* custom_zoom = zoom_menu.addAction("Custom"); + QAction* custom_zoom = zoom_menu.addAction(tr("Custom")); connect(custom_zoom, SIGNAL(triggered(bool)), this, SLOT(set_custom_zoom())); connect(&zoom_menu, SIGNAL(triggered(QAction*)), this, SLOT(set_menu_zoom(QAction*))); menu.addMenu(&zoom_menu); if (!viewer->is_main_sequence()) { - menu.addAction("Close Media", viewer, SLOT(close_media())); + menu.addAction(tr("Close Media"), viewer, SLOT(close_media())); } menu.exec(QCursor::pos()); @@ -120,7 +120,7 @@ void ViewerWidget::save_frame() { QFileDialog fd(this); fd.setAcceptMode(QFileDialog::AcceptSave); fd.setFileMode(QFileDialog::AnyFile); - fd.setWindowTitle("Save Frame"); + fd.setWindowTitle(tr("Save Frame")); fd.setNameFilter("Portable Network Graphic (*.png);;JPEG (*.jpg);;Windows Bitmap (*.bmp);;Portable Pixmap (*.ppm);;X11 Bitmap (*.xbm);;X11 Pixmap (*.xpm)"); if (fd.exec()) { @@ -159,7 +159,10 @@ void ViewerWidget::set_fit_zoom() { void ViewerWidget::set_custom_zoom() { bool ok; - double d = QInputDialog::getDouble(this, "Viewer Zoom", "Set Custom Zoom Value:", container->zoom*100, 0, 2147483647, 2, &ok); + double d = QInputDialog::getDouble(this, + tr("Viewer Zoom"), + tr("Set Custom Zoom Value:"), + container->zoom*100, 0, 2147483647, 2, &ok); if (ok) { container->fit = false; container->zoom = d*0.01;