Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix plural handling for translations #1424

Merged
merged 12 commits into from
Apr 12, 2021
Merged
4 changes: 2 additions & 2 deletions app/dialog/preferences/tabs/preferencesdisktab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ PreferencesDiskTab::PreferencesDiskTab()
cache_behavior_layout->addWidget(new QLabel(tr("Cache Ahead:")), row, 0);

cache_ahead_slider_ = new FloatSlider();
cache_ahead_slider_->SetFormat(tr("%1 second(s)"));
cache_ahead_slider_->SetFormat(tr("%1 seconds"));
cache_ahead_slider_->SetMinimum(0);
cache_ahead_slider_->SetValue(Config::Current()["DiskCacheAhead"].value<rational>().toDouble());
cache_behavior_layout->addWidget(cache_ahead_slider_, row, 1);
Expand All @@ -78,7 +78,7 @@ PreferencesDiskTab::PreferencesDiskTab()

cache_behind_slider_ = new FloatSlider();
cache_behind_slider_->SetMinimum(0);
cache_behind_slider_->SetFormat(tr("%1 second(s)"));
cache_behind_slider_->SetFormat(tr("%1 seconds"));
cache_behind_slider_->SetValue(Config::Current()["DiskCacheBehind"].value<rational>().toDouble());
cache_behavior_layout->addWidget(cache_behind_slider_, row, 3);

Expand Down
4 changes: 2 additions & 2 deletions app/dialog/preferences/tabs/preferencesgeneraltab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ PreferencesGeneralTab::PreferencesGeneralTab()

default_still_length_ = new FloatSlider();
default_still_length_->SetMinimum(0.1);
default_still_length_->SetFormat(tr("%1 second(s)"));
default_still_length_->SetFormat(tr("%1 seconds"));
default_still_length_->SetValue(Config::Current()["DefaultStillLength"].value<rational>().toDouble());
timeline_layout->addWidget(default_still_length_);

Expand Down Expand Up @@ -136,7 +136,7 @@ PreferencesGeneralTab::PreferencesGeneralTab()
autorecovery_interval_ = new IntegerSlider();
autorecovery_interval_->SetMinimum(1);
autorecovery_interval_->SetMaximum(60);
autorecovery_interval_->SetFormat(tr("%1 minute(s)"));
autorecovery_interval_->SetFormat(QT_TRANSLATE_N_NOOP("olive::SliderBase", "%n minute(s)"), true);
autorecovery_interval_->SetValue(Config::Current()[QStringLiteral("AutorecoveryInterval")].toLongLong());
autorecovery_layout->addWidget(autorecovery_interval_, row, 1);

Expand Down
7 changes: 3 additions & 4 deletions app/node/project/footage/footage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,9 @@ QString Footage::DescribeVideoStream(const VideoParams &params)

QString Footage::DescribeAudioStream(const AudioParams &params)
{
return tr("%1: Audio - %2 Channel(s), %3Hz")
.arg(QString::number(params.stream_index()),
QString::number(params.channel_count()),
QString::number(params.sample_rate()));
return tr("%1: Audio - %n Channel(s), %2Hz", nullptr, params.channel_count())
.arg(QString::number(params.stream_index()),
QString::number(params.sample_rate()));
}

void Footage::Hash(const QString& output, QCryptographicHash &hash, const rational &time) const
Expand Down
2 changes: 1 addition & 1 deletion app/task/project/import/import.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ProjectImportTask::ProjectImportTask(ProjectViewModel *model, Folder *folder, co

file_count_ = Core::CountFilesInFileList(filenames_);

SetTitle(tr("Importing %1 file(s)").arg(file_count_));
SetTitle(tr("Importing %n file(s)", nullptr, file_count_));
}

const int &ProjectImportTask::GetFileCount() const
Expand Down
Loading