Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/effects/effectmanifest.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ class EffectManifest {
m_name = name;
}

virtual const QString& shortName() const {
return m_shortName;
}
virtual void setShortName(const QString& shortName) {
m_shortName = shortName;
}

virtual const QString& author() const {
return m_author;
}
Expand Down Expand Up @@ -114,6 +121,7 @@ class EffectManifest {

QString m_id;
QString m_name;
QString m_shortName;
QString m_author;
QString m_version;
QString m_description;
Expand Down
8 changes: 8 additions & 0 deletions src/effects/effectmanifestparameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ class EffectManifestParameter {
m_name = name;
}

virtual const QString& shortName() const {
return m_shortName;
}
virtual void setShortName(const QString& shortName) {
m_shortName = shortName;
}

virtual const QString& description() const {
return m_description;
}
Expand Down Expand Up @@ -179,6 +186,7 @@ class EffectManifestParameter {

QString m_id;
QString m_name;
QString m_shortName;
QString m_description;

ControlHint m_controlHint;
Expand Down
4 changes: 4 additions & 0 deletions src/effects/effectparameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ const QString EffectParameter::name() const {
return m_parameter.name();
}

const QString EffectParameter::shortName() const {
return m_parameter.shortName();
}

const QString EffectParameter::description() const {
return m_parameter.description();
}
Expand Down
1 change: 1 addition & 0 deletions src/effects/effectparameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class EffectParameter : public QObject {
const EffectManifestParameter& manifest() const;
const QString id() const;
const QString name() const;
const QString shortName() const;
const QString description() const;

///////////////////////////////////////////////////////////////////////////
Expand Down
7 changes: 7 additions & 0 deletions src/effects/effectparameterslotbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ QString EffectParameterSlotBase::name() const {
return QString();
}

QString EffectParameterSlotBase::shortName() const {
if (m_pEffectParameter) {
return m_pEffectParameter->shortName();
}
return QString();
}

QString EffectParameterSlotBase::description() const {
if (m_pEffectParameter) {
return m_pEffectParameter->description();
Expand Down
1 change: 1 addition & 0 deletions src/effects/effectparameterslotbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class EffectParameterSlotBase : public QObject {
virtual ~EffectParameterSlotBase();

QString name() const;
QString shortName() const;
QString description() const;
const EffectManifestParameter getManifest();

Expand Down
1 change: 1 addition & 0 deletions src/effects/native/autopaneffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ EffectManifest AutoPanEffect::getManifest() {
EffectManifestParameter* smoothing = manifest.addParameter();
smoothing->setId("smoothing");
smoothing->setName(QObject::tr("Smoothing"));
smoothing->setShortName(QObject::tr("Smooth"));
smoothing->setDescription(
QObject::tr("How fast the signal goes from a channel to an other"));
smoothing->setControlHint(EffectManifestParameter::CONTROL_KNOB_LOGARITHMIC);
Expand Down
1 change: 1 addition & 0 deletions src/effects/native/bessel4lvmixeqeffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ EffectManifest Bessel4LVMixEQEffect::getManifest() {
EffectManifest manifest;
manifest.setId(getId());
manifest.setName(QObject::tr("Bessel4 LV-Mix EQ"));
manifest.setShortName(QObject::tr("Bessel4 EQ"));
manifest.setAuthor("The Mixxx Team");
manifest.setVersion("1.0");
manifest.setDescription(QObject::tr(
Expand Down
1 change: 1 addition & 0 deletions src/effects/native/bessel8lvmixeqeffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ EffectManifest Bessel8LVMixEQEffect::getManifest() {
EffectManifest manifest;
manifest.setId(getId());
manifest.setName(QObject::tr("Bessel8 LV-Mix EQ"));
manifest.setShortName(QObject::tr("Bessel8 EQ"));
manifest.setAuthor("The Mixxx Team");
manifest.setVersion("1.0");
manifest.setDescription(QObject::tr(
Expand Down
1 change: 1 addition & 0 deletions src/effects/native/bitcrushereffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ EffectManifest BitCrusherEffect::getManifest() {
EffectManifestParameter* frequency = manifest.addParameter();
frequency->setId("downsample");
frequency->setName(QObject::tr("Downsampling"));
frequency->setShortName(QObject::tr("Down"));
frequency->setDescription(QObject::tr("Adjusts the sample rate, to which the signal is downsampled."));
frequency->setControlHint(EffectManifestParameter::CONTROL_KNOB_LOGARITHMIC);
frequency->setSemanticHint(EffectManifestParameter::SEMANTIC_UNKNOWN);
Expand Down
3 changes: 2 additions & 1 deletion src/effects/native/filtereffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ EffectManifest FilterEffect::getManifest() {

EffectManifestParameter* q = manifest.addParameter();
q->setId("q");
q->setName(QObject::tr("Q"));
q->setName(QObject::tr("Resonance"));
q->setShortName(QObject::tr("Q"));
q->setDescription(QObject::tr("Resonance of the filters, default = Flat top"));
q->setControlHint(EffectManifestParameter::CONTROL_KNOB_LOGARITHMIC);
q->setSemanticHint(EffectManifestParameter::SEMANTIC_UNKNOWN);
Expand Down
1 change: 1 addition & 0 deletions src/effects/native/linkwitzriley8eqeffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ EffectManifest LinkwitzRiley8EQEffect::getManifest() {
EffectManifest manifest;
manifest.setId(getId());
manifest.setName(QObject::tr("LinkwitzRiley8 EQ"));
manifest.setShortName(QObject::tr("LR8 EQ"));
manifest.setAuthor("The Mixxx Team");
manifest.setVersion("1.0");
manifest.setDescription(QObject::tr(
Expand Down
2 changes: 2 additions & 0 deletions src/effects/native/moogladder4filtereffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ EffectManifest MoogLadder4FilterEffect::getManifest() {
EffectManifest manifest;
manifest.setId(getId());
manifest.setName(QObject::tr("Moog Ladder 4 Filter"));
manifest.setShortName(QObject::tr("Moog Filter"));
manifest.setAuthor("The Mixxx Team");
manifest.setVersion("1.0");
manifest.setDescription(QObject::tr(
Expand All @@ -39,6 +40,7 @@ EffectManifest MoogLadder4FilterEffect::getManifest() {
EffectManifestParameter* q = manifest.addParameter();
q->setId("resonance");
q->setName(QObject::tr("Resonance"));
q->setShortName(QObject::tr("Res"));
q->setDescription(QObject::tr("Resonance of the filters. 4 = self oscillating"));
q->setControlHint(EffectManifestParameter::CONTROL_KNOB_LOGARITHMIC);
q->setSemanticHint(EffectManifestParameter::SEMANTIC_UNKNOWN);
Expand Down
1 change: 1 addition & 0 deletions src/effects/native/reverbeffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ EffectManifest ReverbEffect::getManifest() {
EffectManifestParameter* time = manifest.addParameter();
time->setId("bandwidth");
time->setName(QObject::tr("Bandwidth"));
time->setShortName(QObject::tr("BW"));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really a common abbreviation. We cant expect translators to guess what this means.
Up to 11 characters are used for short name Moog Filter, can`t we use just Bandwidth then?

The transifex translation service allows to set a character limit. We can use that, and/or add a comment for translator in the code, hinting that they have $ characters max. and should use an abbreviation where appropriate.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Moog Filter" is for a short effect name, this is for a short parameter name. There's less space for parameter names than effect names.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@esbrandt what's the latest way to add a hint to translators? Could we address it that way?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(by "it" here I mean the problem that "BW" is not a common abbreviation)

Do these annotations actually make it into transifex?
http://doc.qt.io/qt-4.8/i18n-source-translation.html#translator-comments

time->setDescription(QObject::tr("Higher bandwidth values cause more "
"bright (high-frequency) tones to be included"));
time->setControlHint(EffectManifestParameter::CONTROL_KNOB_LINEAR);
Expand Down
10 changes: 8 additions & 2 deletions src/widget/weffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,14 @@ void WEffect::effectUpdated() {
EffectPointer pEffect = m_pEffectSlot->getEffect();
if (pEffect) {
const EffectManifest& manifest = pEffect->getManifest();
name = manifest.name();
description = manifest.description();
if (!manifest.shortName().isEmpty()) {
name = manifest.shortName();
//: %1 = effect name; %2 = effect description
description = tr("%1: %2").arg(manifest.name(), manifest.description());
} else {
name = manifest.name();
description = manifest.description();
}
}
} else {
name = tr("None");
Expand Down
12 changes: 10 additions & 2 deletions src/widget/weffectparameterbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,16 @@ void WEffectParameterBase::setEffectParameterSlot(

void WEffectParameterBase::parameterUpdated() {
if (m_pEffectParameterSlot) {
setText(m_pEffectParameterSlot->name());
setBaseTooltip(m_pEffectParameterSlot->description());
if (!m_pEffectParameterSlot->shortName().isEmpty()) {
setText(m_pEffectParameterSlot->shortName());
//: %1 = effect name; %2 = effect description
setBaseTooltip(tr("%1: %2").arg(
m_pEffectParameterSlot->name(),
m_pEffectParameterSlot->description()));
} else {
setText(m_pEffectParameterSlot->name());
setBaseTooltip(m_pEffectParameterSlot->description());
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be nice to setBaseTooltip as something like <name>: <description> so it's easy to learn the full name. (same in WEffect)

} else {
setText(tr("None"));
setBaseTooltip(tr("No effect loaded."));
Expand Down