Fix plural handling for translations (#1424)
* .arg() doesn't handle plurals, replace %1 with %n and pass number to tr(), but only if there is an accompanying word for that we want singular/plural translations and only for whole numbers.
* Qt's translation methods only accept integers and we don't know what grammatical number form would be correct for floating-point numbers in different languages anyway.
* Add optional 2nd argument to SliderBase::SetFormat() to activate deferred plural handling:
SetFormat(QT_TRANSLATE_N_NOOP("olive::SliderBase", "%n unit(s)"), true)
* Generate en_US.ts with lupdate's -pluralonly option. Only source strings that require plural handling need to be translated (as long as the source language is American English).
This commit is contained in:
@@ -295,10 +295,9 @@ QString Footage::DescribeVideoStream(const VideoParams ¶ms)
|
||||
|
||||
QString Footage::DescribeAudioStream(const AudioParams ¶ms)
|
||||
{
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user