changeset 2764:d45b4beadf6c

Made "bluetooth" and "streambrowser" plugins translatable.
author Stany HENRY <StrassBoy@gmail.com>
date Thu, 03 Jul 2008 09:07:03 +0200
parents bbde87558ec7
children ffb79e3d133a
files src/bluetooth/gui.c src/bluetooth/scan_gui.c src/evdev-plug/ed_ui.c src/streambrowser/gui/streambrowser_win.c src/streambrowser/streambrowser.h
diffstat 5 files changed, 24 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/src/bluetooth/gui.c	Thu Jul 03 02:02:19 2008 +0300
+++ b/src/bluetooth/gui.c	Thu Jul 03 09:07:03 2008 +0200
@@ -128,7 +128,7 @@
 
     /* column for producer */
     renderer = gtk_cell_renderer_text_new ();
-    column = gtk_tree_view_column_new_with_attributes ("Producer",
+    column = gtk_tree_view_column_new_with_attributes (_("Producer"),
             renderer,
             "text",
             COLUMN_PRODUCER,
@@ -200,21 +200,21 @@
         gtk_container_set_border_width (GTK_CONTAINER (hbox_bottom), 4); 
         gtk_container_add (GTK_CONTAINER (mainbox), hbox_bottom);
 
-        headset_frame = gtk_frame_new("Available Headsets");
+        headset_frame = gtk_frame_new(_("Available Headsets"));
         gtk_container_add (GTK_CONTAINER (hbox_top), headset_frame);
 
-        about_frame = gtk_frame_new("Current Headset");
+        about_frame = gtk_frame_new(_("Current Headset"));
         gtk_container_add(GTK_CONTAINER(hbox_top),about_frame);
 
-        refresh = gtk_button_new_with_mnemonic ("_Refresh");
+        refresh = gtk_button_new_with_mnemonic (_("_Refresh"));
         g_signal_connect (refresh, "clicked",G_CALLBACK (refresh_resultsui), NULL);
         gtk_container_add(GTK_CONTAINER(hbox_bottom),refresh);
 
-        connect_button = gtk_button_new_with_mnemonic("_Connect");
+        connect_button = gtk_button_new_with_mnemonic(_("_Connect"));
         g_signal_connect(connect_button,"clicked",G_CALLBACK (connect_call), NULL);
         gtk_container_add(GTK_CONTAINER(hbox_bottom),connect_button);
 
-        close_button = gtk_button_new_with_mnemonic("_Close");
+        close_button = gtk_button_new_with_mnemonic(_("_Close"));
         g_signal_connect(close_button,"clicked",G_CALLBACK (close_call),NULL);
         gtk_container_add(GTK_CONTAINER(hbox_bottom),close_button);
         /* create tree model */
@@ -248,14 +248,14 @@
         gtk_container_add (GTK_CONTAINER (box_about), box_about_right);
 
         /* Left labels  */
-        label_p = gtk_label_new("Name:");
+        label_p = gtk_label_new(_("Name:"));
         gtk_container_add(GTK_CONTAINER(box_about_left),label_p);
 
-        label_c = gtk_label_new("Class");
+        label_c = gtk_label_new(_("Class"));
         gtk_container_add(GTK_CONTAINER(box_about_left),label_c);
 
 
-        label_a = gtk_label_new("Address:");
+        label_a = gtk_label_new(_("Address:"));
         gtk_container_add(GTK_CONTAINER(box_about_left),label_a);
 
 
--- a/src/bluetooth/scan_gui.c	Thu Jul 03 02:02:19 2008 +0300
+++ b/src/bluetooth/scan_gui.c	Thu Jul 03 09:07:03 2008 +0200
@@ -29,7 +29,7 @@
 
 void show_no_devices(){
     if(window ){
-        gtk_label_set_text(GTK_LABEL(scan_label),"No devices found!");
+        gtk_label_set_text(GTK_LABEL(scan_label),_("No devices found!"));
     }
 }
 void destroy_scan_window(){
@@ -67,7 +67,7 @@
         gtk_image_set_pixel_size(GTK_IMAGE(bluetooth_img),-1);
         gtk_container_add(GTK_CONTAINER(scanbox),bluetooth_img);
 
-        scan_label = gtk_label_new_with_mnemonic("Scanning...");
+        scan_label = gtk_label_new_with_mnemonic(_("Scanning..."));
         gtk_container_add(GTK_CONTAINER(scanbox),scan_label);
 
         progress_bar = gtk_progress_bar_new();
@@ -80,10 +80,10 @@
         buttonsbox = gtk_hbox_new(FALSE,2);
         gtk_container_set_border_width(GTK_CONTAINER(buttonsbox),2);
         gtk_container_add(GTK_CONTAINER(progressbox),buttonsbox);
-        rescan_buttton = gtk_button_new_with_mnemonic("Rescan");
+        rescan_buttton = gtk_button_new_with_mnemonic(_("Rescan"));
         g_signal_connect(rescan_buttton,"clicked",G_CALLBACK (refresh_call),NULL);
 
-        close_button = gtk_button_new_with_mnemonic("Close");
+        close_button = gtk_button_new_with_mnemonic(_("Close"));
         gtk_container_add(GTK_CONTAINER(buttonsbox),rescan_buttton);
         gtk_container_add(GTK_CONTAINER(buttonsbox),close_button);
         g_signal_connect(close_button,"clicked",G_CALLBACK (close_window),NULL);
--- a/src/evdev-plug/ed_ui.c	Thu Jul 03 02:02:19 2008 +0300
+++ b/src/evdev-plug/ed_ui.c	Thu Jul 03 09:07:03 2008 +0200
@@ -209,18 +209,18 @@
   switch (is_available)
   {
     case DEVLIST_ISAVAILABLE_DET:
-      g_object_set( renderer , "text" , "Detected" ,
+      g_object_set( renderer , "text" , _("Detected") ,
         "foreground" , "Green" , "foreground-set" , TRUE ,
         "background" , "Black" , "background-set" , TRUE , NULL );
       break;
     case DEVLIST_ISAVAILABLE_CUSTOM:
-      g_object_set( renderer , "text" , "Custom" ,
+      g_object_set( renderer , "text" , _("Custom") ,
         "foreground" , "Yellow" , "foreground-set" , TRUE ,
         "background" , "Black" , "background-set" , TRUE , NULL );
       break;
     case DEVLIST_ISAVAILABLE_NOTDET:
     default:
-      g_object_set( renderer , "text" , "Not Detected" ,
+      g_object_set( renderer , "text" , _("Not Detected") ,
         "foreground" , "Orange" , "foreground-set" , TRUE ,
         "background" , "Black" , "background-set" , TRUE , NULL );
       break;
@@ -401,7 +401,7 @@
           DEVLIST_COL_ISACTIVE , FALSE ,
           DEVLIST_COL_NAME , name ,
           DEVLIST_COL_FILENAME , file ,
-          DEVLIST_COL_PHYS , "(custom)" ,
+          DEVLIST_COL_PHYS , _("(custom)") ,
           DEVLIST_COL_ISAVAILABLE , DEVLIST_ISAVAILABLE_CUSTOM ,
           DEVLIST_COL_BINDINGS , NULL , -1 );
         task_done = TRUE;
--- a/src/streambrowser/gui/streambrowser_win.c	Thu Jul 03 02:02:19 2008 +0300
+++ b/src/streambrowser/gui/streambrowser_win.c	Thu Jul 03 09:07:03 2008 +0200
@@ -47,7 +47,7 @@
 	g_signal_connect(G_OBJECT(notebook), "switch-page", G_CALLBACK(on_notebook_switch_page), NULL);
 	gtk_widget_show(notebook);
 
-	GtkWidget *search_label = gtk_label_new("Search:");
+	GtkWidget *search_label = gtk_label_new(_("Search:"));
 	gtk_widget_show(search_label);
 
 	/* search entry */
@@ -72,7 +72,7 @@
 
 	/* streambrowser window */
 	streambrowser_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
-	gtk_window_set_title(GTK_WINDOW(streambrowser_window), "Stream browser");
+	gtk_window_set_title(GTK_WINDOW(streambrowser_window), _("Stream browser"));
 	gtk_window_set_position(GTK_WINDOW(streambrowser_window), GTK_WIN_POS_CENTER);
 	gtk_window_set_default_size(GTK_WINDOW(streambrowser_window), 700, 400);
 	g_signal_connect(G_OBJECT(streambrowser_window), "delete-event", G_CALLBACK(gtk_widget_hide_on_delete), streambrowser_window);
@@ -213,8 +213,8 @@
 	gtk_tree_view_set_fixed_height_mode(GTK_TREE_VIEW(tree_view), FALSE);
 
 	gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(tree_view), -1, "", cell_renderer_pixbuf, "pixbuf", 0, NULL);
-	gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(tree_view), -1, "Stream name", cell_renderer_text, "text", 1, NULL);
-	gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(tree_view), -1, "Now playing", cell_renderer_text, "text", 2, NULL);
+	gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(tree_view), -1, _("Stream name"), cell_renderer_text, "text", 1, NULL);
+	gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(tree_view), -1, _("Now playing"), cell_renderer_text, "text", 2, NULL);
 
 	g_signal_connect(G_OBJECT(tree_view), "cursor-changed", G_CALLBACK(on_tree_view_cursor_changed), NULL);
 
--- a/src/streambrowser/streambrowser.h	Thu Jul 03 02:02:19 2008 +0300
+++ b/src/streambrowser/streambrowser.h	Thu Jul 03 09:07:03 2008 +0200
@@ -4,6 +4,9 @@
 
 #include <glib.h>
 
+#include <config.h>
+#include <audacious/i18n.h>
+
 #define DEF_STRING_LEN		1024
 #define DEF_BUFFER_SIZE		512
 #define MAX_UPDATE_THREADS	4