[pulseaudio-commits] [Git][pulseaudio/pavucontrol][master] channelwidget: Make volume strings translatable and add missing space

Tanu Kaskinen gitlab at gitlab.freedesktop.org
Mon Feb 25 16:33:57 UTC 2019


Tanu Kaskinen pushed to branch master at PulseAudio / pavucontrol


Commits:
ce36a44a by Karl Ove Hufthammer at 2019-02-25T16:25:09Z
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

- - - - -


1 changed file:

- src/channelwidget.cc


Changes:

=====================================
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,



View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pavucontrol/commit/ce36a44a1d5366a161e9f1b8600079eba66ed42a

-- 
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pavucontrol/commit/ce36a44a1d5366a161e9f1b8600079eba66ed42a
You're receiving this email because of your account on gitlab.freedesktop.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20190225/06382097/attachment-0001.html>


More information about the pulseaudio-commits mailing list