comparison Plugins/General/lirc/lirc.c @ 554:8a7a6dda6add trunk

[svn] make lirc strings translatable
author nenolod
date Wed, 01 Feb 2006 13:09:25 -0800
parents 894e9c4a0051
children 3770123787c2
comparison
equal deleted inserted replaced
553:82346a6312c2 554:8a7a6dda6add
37 #include <ctype.h> 37 #include <ctype.h>
38 38
39 #include <gtk/gtk.h> 39 #include <gtk/gtk.h>
40 40
41 #include <glib.h> 41 #include <glib.h>
42 #include <glib/gi18n.h>
42 43
43 #include "audacious/plugin.h" 44 #include "audacious/plugin.h"
44 #include "libaudacious/configdb.h" 45 #include "libaudacious/configdb.h"
45 #include "libaudacious/beepctrl.h" 46 #include "libaudacious/beepctrl.h"
46 47
61 cleanup, 62 cleanup,
62 }; 63 };
63 64
64 GeneralPlugin *get_gplugin_info(void) 65 GeneralPlugin *get_gplugin_info(void)
65 { 66 {
66 lirc_plugin.description = g_strdup_printf("LIRC Plugin"); 67 lirc_plugin.description = g_strdup_printf(_("LIRC Plugin"));
67 return(&lirc_plugin); 68 return(&lirc_plugin);
68 } 69 }
69 70
70 int lirc_fd=-1; 71 int lirc_fd=-1;
71 struct lirc_config *config=NULL; 72 struct lirc_config *config=NULL;
492 int flags; 493 int flags;
493 ConfigDb *db; 494 ConfigDb *db;
494 495
495 if((lirc_fd=lirc_init("audacious",1))==-1) 496 if((lirc_fd=lirc_init("audacious",1))==-1)
496 { 497 {
497 fprintf(stderr,"%s: could not init LIRC support\n", 498 fprintf(stderr,_("%s: could not init LIRC support\n"),
498 plugin_name); 499 plugin_name);
499 return; 500 return;
500 } 501 }
501 if(lirc_readconfig(NULL,&config,NULL)==-1) 502 if(lirc_readconfig(NULL,&config,NULL)==-1)
502 { 503 {
503 lirc_deinit(); 504 lirc_deinit();
504 fprintf(stderr, 505 fprintf(stderr,
505 "%s: could not read LIRC config file\n" 506 _("%s: could not read LIRC config file\n"
506 "%s: please read the documentation of LIRC \n" 507 "%s: please read the documentation of LIRC\n"
507 "%s: how to create a proper config file\n", 508 "%s: how to create a proper config file\n"),
508 plugin_name,plugin_name,plugin_name); 509 plugin_name,plugin_name,plugin_name);
509 return; 510 return;
510 } 511 }
511 input_tag=gdk_input_add(lirc_fd,GDK_INPUT_READ, 512 input_tag=gdk_input_add(lirc_fd,GDK_INPUT_READ,
512 lirc_input_callback,NULL); 513 lirc_input_callback,NULL);
894 /*select_title(sel,0);*/ 895 /*select_title(sel,0);*/
895 } 896 }
896 } 897 }
897 else 898 else
898 { 899 {
899 fprintf(stderr,"%s: unknown command \"%s\"\n", 900 fprintf(stderr,_("%s: unknown command \"%s\"\n"),
900 plugin_name,c); 901 plugin_name,c);
901 } 902 }
902 } 903 }
903 free(code); 904 free(code);
904 if(ret==-1) break; 905 if(ret==-1) break;
905 } 906 }
906 if(ret==-1) 907 if(ret==-1)
907 { 908 {
908 /* something went badly wrong */ 909 /* something went badly wrong */
909 fprintf(stderr,"%s: disconnected from LIRC\n",plugin_name); 910 fprintf(stderr,_("%s: disconnected from LIRC\n"),plugin_name);
910 cleanup(); 911 cleanup();
911 return; 912 return;
912 } 913 }
913 } 914 }
914 915
917 if(!fsd) 918 if(!fsd)
918 { 919 {
919 GtkWidget *window; 920 GtkWidget *window;
920 921
921 window=gtk_font_selection_dialog_new 922 window=gtk_font_selection_dialog_new
922 ("Please choose font for SELECT popup."); 923 (_("Please choose font for SELECT popup."));
923 g_return_if_fail(GTK_IS_FONT_SELECTION_DIALOG(window)); 924 g_return_if_fail(GTK_IS_FONT_SELECTION_DIALOG(window));
924 925
925 fsd=window; 926 fsd=window;
926 gtk_window_position(GTK_WINDOW(fsd),GTK_WIN_POS_MOUSE); 927 gtk_window_position(GTK_WINDOW(fsd),GTK_WIN_POS_MOUSE);
927 gtk_signal_connect(GTK_OBJECT(fsd), "destroy", 928 gtk_signal_connect(GTK_OBJECT(fsd), "destroy",