From 97e8354fb06746e633155153f5bb60c548c9d4d5 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 2 Oct 2018 19:45:09 -0400 Subject: [PATCH] configure_audio: Add disambiguation comment for the volume percentage string Disambiguates what the string represents to help translators more easily understand what it is that they're translating. While we're at it, we can move the code to its own function, so that we don't need to specify the same string twice. --- src/citra_qt/configuration/configure_audio.cpp | 11 +++++++---- src/citra_qt/configuration/configure_audio.h | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/citra_qt/configuration/configure_audio.cpp b/src/citra_qt/configuration/configure_audio.cpp index 0aee1cb5e3..98191fbe4c 100644 --- a/src/citra_qt/configuration/configure_audio.cpp +++ b/src/citra_qt/configuration/configure_audio.cpp @@ -19,9 +19,8 @@ ConfigureAudio::ConfigureAudio(QWidget* parent) ui->output_sink_combo_box->addItem(sink_detail.id); } - connect(ui->volume_slider, &QSlider::valueChanged, [this] { - ui->volume_indicator->setText(tr("%1 %").arg(ui->volume_slider->sliderPosition())); - }); + connect(ui->volume_slider, &QSlider::valueChanged, this, + &ConfigureAudio::setVolumeIndicatorText); this->setConfiguration(); connect(ui->output_sink_combo_box, @@ -57,7 +56,11 @@ void ConfigureAudio::setConfiguration() { ui->audio_device_combo_box->setCurrentIndex(new_device_index); ui->volume_slider->setValue(Settings::values.volume * ui->volume_slider->maximum()); - ui->volume_indicator->setText(tr("%1 %").arg(ui->volume_slider->sliderPosition())); + setVolumeIndicatorText(ui->volume_slider->sliderPosition()); +} + +void ConfigureAudio::setVolumeIndicatorText(int percentage) { + ui->volume_indicator->setText(tr("%1%", "Volume percentage (e.g. 50%)").arg(percentage)); } void ConfigureAudio::applyConfiguration() { diff --git a/src/citra_qt/configuration/configure_audio.h b/src/citra_qt/configuration/configure_audio.h index d4790db5c3..714634ce04 100644 --- a/src/citra_qt/configuration/configure_audio.h +++ b/src/citra_qt/configuration/configure_audio.h @@ -26,6 +26,7 @@ public slots: private: void setConfiguration(); + void setVolumeIndicatorText(int percentage); std::unique_ptr ui; };