~ubuntu-branches/ubuntu/utopic/gnomeradio/utopic

« back to all changes in this revision

Viewing changes to debian/patches/gnomeradio-ngettext.patch

  • Committer: Package Import Robot
  • Author(s): POJAR GEORGE
  • Date: 2013-12-24 10:38:24 UTC
  • Revision ID: package-import@ubuntu.com-20131224103824-ud5r2yrtyblv9ew6
Tags: 1.8-2ubuntu26
* debian/patches/gnomeradio-g_object.patch: Removed useless calls to the
  G_OBJECT() macro. (LP: #1267306)
* Updated debian/patches/gnomeradio-about.patch: Update COPYING file with
  latest versions from gnu.org. (LP: #1266203)
* Updated debian/patches/gnomeradio-gtk_stock.patch: UI make it more sleek, 
  remove relief from the UI buttons. (LP: #1265154)
* Updated debian/patches/gnomeradio-gtk_application.patch: Make the main
  window a GtkApplicationWindow.
* Updated debian/patches/gnomeradio-ngettext.patch: Fix localization, use
  g_dngettext instead of ngettext.
* Updated debian/patches/gnomeradio-record_information.patch: Use GDateTime
  instead of time_t.
* Moved changes from debian/patches/gnomeradio-thread_safe.patch to
  debian/patches/gnomeradio-alsa.patch and removed it as result.
* debian/control: Updated to Standards-Version 3.9.5, no changes needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
## Bug-Debian: 
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
 
5
Forwarded: not-needed
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
11
 
@@ -106,7 +106,11 @@
 
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
 
10
@@ -106,7 +106,14 @@
12
11
        }
13
12
        
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);
 
15
+               guint num;
 
16
+               char *text;
 
17
+
 
18
+               num = g_list_length (fsd->stations) + 1;
 
19
+               text = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE,
 
20
+                                       "%d station found",
 
21
+                                       "%d stations found", num), num);
20
22
+
21
23
                gfloat *f = g_malloc(sizeof(gfloat));
22
24
                gtk_label_set_text(GTK_LABEL(fsd->label), text);
23
25
                g_free(text);
24
 
@@ -171,10 +175,12 @@
 
26
@@ -165,16 +172,19 @@
 
27
                gtk_widget_destroy(data.dialog);
 
28
        } else {
 
29
                if (g_list_length(data.stations) > 0) {
 
30
+                       GtkWidget *dialog;
 
31
+                       GList *l;
 
32
+                       guint num;
 
33
+                       char *text;
 
34
+
 
35
                        gfloat f = *((gfloat*)data.stations->data);
 
36
                        gtk_adjustment_set_value(adj, f*STEPS);
 
37
                        radio_set_freq(f);
25
38
                        
26
 
                        GtkWidget *dialog;
27
 
                        GList *ptr;
 
39
-                       GtkWidget *dialog;
 
40
-                       GList *ptr;
28
41
-                       char *text;
29
 
                        
 
42
-                       
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);
37
49
                        
38
50
                        dialog = gtk_message_dialog_new(GTK_WINDOW(app), DIALOG_FLAGS, GTK_MESSAGE_QUESTION,
39
51
                                        GTK_BUTTONS_YES_NO, "%s", text);
 
52
@@ -183,14 +193,14 @@
 
53
                        int response = gtk_dialog_run(GTK_DIALOG(dialog));
 
54
                        gtk_widget_destroy(dialog);
 
55
 
 
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);
 
64
                                }
 
65
-                               g_free(ptr->data);
 
66
+                               g_free(l->data);
 
67
                        }       
 
68
                }
 
69
        }