[pulseaudio-commits] src/channelwidget.cc
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Feb 25 16:33:57 UTC 2019
src/channelwidget.cc | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
New commits:
commit ce36a44a1d5366a161e9f1b8600079eba66ed42a
Author: Karl Ove Hufthammer <karl at huftis.org>
Date: Sat Jan 12 14:05:33 2019 +0100
channelwidget: Make volume strings translatable and add missing space
The volume strings (e.g. ‘86% (-3.81dB)’) shown to the right of each
volume slider is now translatable/localisable. (The similar string
‘100% (0dB)’, centred *below* each slider, was already translatable.)
Also, the English strings now include a space between the decibel value
and the unit, e.g. ‘-3.81 dB’ instead of ‘-3.81dB’.
Fixes: https://gitlab.freedesktop.org/pulseaudio/pavucontrol/issues/52
diff --git a/src/channelwidget.cc b/src/channelwidget.cc
index fe94c11..cc9988b 100644
--- a/src/channelwidget.cc
+++ b/src/channelwidget.cc
@@ -65,12 +65,12 @@ void ChannelWidget::setVolume(pa_volume_t volume) {
if (can_decibel) {
double dB = pa_sw_volume_to_dB(volume);
if (dB > PA_DECIBEL_MININFTY)
- snprintf(txt, sizeof(txt), "<small>%0.0f%% (%0.2fdB)</small>", v, dB);
+ snprintf(txt, sizeof(txt), _("<small>%0.0f%% (%0.2f dB)</small>"), v, dB);
else
- snprintf(txt, sizeof(txt), "<small>%0.0f%% (-∞dB)</small>", v);
+ snprintf(txt, sizeof(txt), _("<small>%0.0f%% (-∞ dB)</small>"), v);
}
else
- snprintf(txt, sizeof(txt), "%0.0f%%", v);
+ snprintf(txt, sizeof(txt), _("%0.0f%%"), v);
volumeLabel->set_markup(txt);
volumeScaleEnabled = false;
@@ -105,7 +105,7 @@ void ChannelWidget::setBaseVolume(pa_volume_t v) {
gtk_scale_add_mark(GTK_SCALE(volumeScale->gobj()), (double)PA_VOLUME_MUTED, (GtkPositionType) GTK_POS_BOTTOM,
last ? (can_decibel ? _("<small>Silence</small>") : _("<small>Min</small>")) : NULL);
gtk_scale_add_mark(GTK_SCALE(volumeScale->gobj()), (double)PA_VOLUME_NORM, (GtkPositionType) GTK_POS_BOTTOM,
- last ? _("<small>100% (0dB)</small>") : NULL);
+ last ? _("<small>100% (0 dB)</small>") : NULL);
if (v > PA_VOLUME_MUTED && v < PA_VOLUME_NORM) {
gtk_scale_add_mark(GTK_SCALE(volumeScale->gobj()), (double)v, (GtkPositionType) GTK_POS_BOTTOM,
More information about the pulseaudio-commits
mailing list