[nautilus] audio-video-properties:fix string not translatable
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] audio-video-properties:fix string not translatable
- Date: Sat, 11 Jan 2020 19:55:45 +0000 (UTC)
commit 6784266e3dff2269aa522c6749a1cc3be87188b2
Author: Waqar Ahmed <waqar 17a gmail com>
Date: Mon Sep 9 19:40:56 2019 +0500
audio-video-properties:fix string not translatable
"Frames per second" string in audio-video-properties tab was unavailable for translation.
To fix this, handle the string with g_dngettext() and allow for both singular and plural translation.
Closes https://gitlab.gnome.org/GNOME/nautilus/issues/990
extensions/audio-video-properties/bacon-video-widget-properties.c | 3 ++-
extensions/audio-video-properties/meson.build | 3 +++
2 files changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/extensions/audio-video-properties/bacon-video-widget-properties.c
b/extensions/audio-video-properties/bacon-video-widget-properties.c
index 88d62636b..b2b2aaf37 100644
--- a/extensions/audio-video-properties/bacon-video-widget-properties.c
+++ b/extensions/audio-video-properties/bacon-video-widget-properties.c
@@ -25,6 +25,7 @@
#include <gtk/gtk.h>
#include <glib/gi18n-lib.h>
#include <string.h>
+#include <math.h>
#include "bacon-video-widget-properties.h"
@@ -230,7 +231,7 @@ bacon_video_widget_properties_set_framerate (BaconVideoWidgetProperties *props,
g_return_if_fail (BACON_IS_VIDEO_WIDGET_PROPERTIES (props));
if (framerate > 1.0) {
- temp = g_strdup_printf ("%0.2f frames per second", framerate);
+ temp = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE, "%0.2f frame per second", "%0.2f frames
per second", (int) (ceilf (framerate))), framerate);
} else {
temp = g_strdup (C_("Frame rate", "N/A"));
}
diff --git a/extensions/audio-video-properties/meson.build b/extensions/audio-video-properties/meson.build
index 0b8dcdc7f..b67de9d56 100644
--- a/extensions/audio-video-properties/meson.build
+++ b/extensions/audio-video-properties/meson.build
@@ -7,6 +7,8 @@ resources = gnome.compile_resources(
c_name: 'nautilus_audio_video_properties',
)
+libm = cc.find_library('m')
+
libtotem_properties_page_sources = files(
'totem-properties-main.c',
'totem-properties-view.c',
@@ -15,6 +17,7 @@ libtotem_properties_page_sources = files(
) + resources
libtotem_properties_page_deps = [
+ libm,
gst_tag_dep,
gst_pbutils_dep,
]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]