Skip to content

Commit

Permalink
Patch: introduce proper plural form strings and fix typo (#1622)
Browse files Browse the repository at this point in the history
* fix typo in fisheye UI

“othographic” → “orthographic”

* subtitles: use builtin plural support

Currently, the source code on subtitles either assumes subtitle items
to be always in plural form or tries determines plural form by itself.

This commit fixes that by using builtin `QObject::tr` plural support.

* glow: fix typo

“shne” → “shine”

* fisheye: fix typo

“Seperate” → “Separate”

* mainwindow: remove incidental `notr`
  • Loading branch information
rschiang authored Jan 28, 2025
1 parent 5a04984 commit 045e7cb
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/commands/subtitlecommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ OverwriteSubtitlesCommand::OverwriteSubtitlesCommand(SubtitlesModel &model, int
if (m_newSubtitles.size() == 1) {
setText(QObject::tr("Add subtitle"));
} else {
setText(QObject::tr("Add %1 subtitles").arg(m_newSubtitles.size()));
setText(QObject::tr("Add %n subtitles", nullptr, m_newSubtitles.size()));
}

if (m_newSubtitles.size() <= 0) {
Expand Down Expand Up @@ -155,7 +155,7 @@ RemoveSubtitlesCommand::RemoveSubtitlesCommand(SubtitlesModel &model, int trackI
if (m_items.size() == 1) {
setText(QObject::tr("Remove subtitle"));
} else {
setText(QObject::tr("Remove %1 subtitles").arg(m_items.size()));
setText(QObject::tr("Remove %n subtitles", nullptr, m_items.size()));
}
}

Expand Down Expand Up @@ -288,7 +288,7 @@ MoveSubtitlesCommand::MoveSubtitlesCommand(SubtitlesModel &model, int trackIndex
if (m_oldSubtitles.size() == 1) {
setText(QObject::tr("Move subtitle"));
} else {
setText(QObject::tr("Move %1 subtitles").arg(m_oldSubtitles.size()));
setText(QObject::tr("Move %n subtitles", nullptr, m_oldSubtitles.size()));
}
// Create a list of subtitles with the new times
int64_t delta = msTime - m_oldSubtitles[0].start;
Expand Down
4 changes: 2 additions & 2 deletions src/docks/subtitlesdock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ void SubtitlesDock::importSrtFromFile(const QString &srtPath, const QString &tra

m_model->importSubtitlesToNewTrack(track, items);

MAIN.showStatusMessage(QObject::tr("Imported %1 subtitle items").arg(items.size()));
MAIN.showStatusMessage(QObject::tr("Imported %1 subtitle item(s)", nullptr, items.size()));
}

void SubtitlesDock::addSubtitleTrack()
Expand Down Expand Up @@ -624,7 +624,7 @@ void SubtitlesDock::importSubtitles()
}
ensureTrackExists();
m_model->importSubtitles(m_trackCombo->currentIndex(), msTime, items);
MAIN.showStatusMessage(QObject::tr("Imported %1 subtitle items").arg(items.size()));
MAIN.showStatusMessage(QObject::tr("Imported %n subtitle item(s)", nullptr, items.size()));
}

void SubtitlesDock::exportSubtitles()
Expand Down
2 changes: 1 addition & 1 deletion src/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@
<bool>true</bool>
</property>
<property name="text">
<string notr="true">Lanczos (best)</string>
<string>Lanczos (best)</string>
</property>
</action>
<action name="actionProfileAutomatic">
Expand Down
4 changes: 2 additions & 2 deletions src/qml/filters/fisheye/ui.qml
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ Item {
}

ListElement {
text: qsTr('Ortographic')
text: qsTr('Orthographic')
value: 0.333
}

Expand Down Expand Up @@ -854,7 +854,7 @@ Item {
visible: scaleYShowSlider

Shotcut.HoverTip {
text: qsTr('Seperate Y scale')
text: qsTr('Separate Y scale')
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/qml/filters/glow/meta_movit.qml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import org.shotcut.qml
Metadata {
type: Metadata.Filter
name: qsTr("Glow")
keywords: qsTr('shne blur', 'search keywords for the Glow video filter') + ' glow gpu'
keywords: qsTr('shine blur', 'search keywords for the Glow video filter') + ' glow gpu'
mlt_service: "movit.glow"
needsGPU: true
qml: "ui_movit.qml"
Expand Down

0 comments on commit 045e7cb

Please sign in to comment.