1
## Description: Adds ngettext support for messages strings.
2
## Origin: upstream, https://bugzilla.gnome.org/attachment.cgi?id=211463&action=diff
3
## Bug-Ubuntu: http://launchpad.net/bugs/980633
5
## Author: Daniel Mustieles
6
## Forwarded: not-needed
1
Description: Adds ngettext support for messages strings.
2
Origin: upstream, https://bugzilla.gnome.org/attachment.cgi?id=211463&action=diff
3
Bug-Ubuntu: http://launchpad.net/bugs/980633
4
Author: Daniel Mustieles
7
6
Index: gnomeradio-1.8/src/gui.c
8
7
===================================================================
9
--- gnomeradio-1.8.orig/src/gui.c 2013-07-24 19:02:23.665888000 +0000
10
+++ gnomeradio-1.8/src/gui.c 2013-07-24 19:32:55.152566096 +0000
8
--- gnomeradio-1.8.orig/src/gui.c 2013-12-31 09:41:52.126411492 +0000
9
+++ gnomeradio-1.8/src/gui.c 2013-12-31 09:57:17.206383992 +0000
14
13
if (radio_check_station(freq)) {
15
14
- char *text = g_strdup_printf(_("%d stations found"), g_list_length(fsd->stations) + 1);
16
+ char *text = g_strdup_printf(ngettext("%d station found",
17
+ "%d stations found",
18
+ g_list_length(fsd->stations) + 1),
19
+ g_list_length(fsd->stations) + 1);
18
+ num = g_list_length (fsd->stations) + 1;
19
+ text = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE,
21
+ "%d stations found", num), num);
21
23
gfloat *f = g_malloc(sizeof(gfloat));
22
24
gtk_label_set_text(GTK_LABEL(fsd->label), text);
27
gtk_widget_destroy(data.dialog);
29
if (g_list_length(data.stations) > 0) {
35
gfloat f = *((gfloat*)data.stations->data);
36
gtk_adjustment_set_value(adj, f*STEPS);
30
43
- text = g_strdup_printf(_("%d stations found. \nDo you want to add them as presets?\n"),
31
44
- g_list_length(data.stations));
32
+ char *text = g_strdup_printf (ngettext ("%d station found.\n"
33
+ "Do you want to add it as preset?",
34
+ "%d stations found.\n"
35
+ "Do you want to add them as presets?", g_list_length (data.stations)),
36
+ g_list_length (data.stations));
45
+ num = g_list_length (data.stations);
46
+ text = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE,
47
+ "%d station found.\nDo you want to add it as preset?",
48
+ "%d stations found.\nDo you want to add them as presets?", num), num);
38
50
dialog = gtk_message_dialog_new(GTK_WINDOW(app), DIALOG_FLAGS, GTK_MESSAGE_QUESTION,
39
51
GTK_BUTTONS_YES_NO, "%s", text);
53
int response = gtk_dialog_run(GTK_DIALOG(dialog));
54
gtk_widget_destroy(dialog);
56
- for (ptr = data.stations; ptr; ptr = ptr->next) {
57
+ for (l = data.stations; l; l = l->next) {
58
if (response == GTK_RESPONSE_YES) {
59
preset *ps = g_malloc0(sizeof(preset));
60
ps->title = g_strdup(_("unnamed"));
61
- ps->freq = *((gfloat*)ptr->data);
62
+ ps->freq = *((gfloat*)l->data);
63
settings.presets = g_list_append(settings.presets, ps);