From: G?rer ?z. <ma...@us...> - 2001-12-28 18:21:58
|
Update of /cvsroot/xine/sinek/src In directory usw-pr-cvs1:/tmp/cvs-serv7309/src Modified Files: Makefile.am audio.c control.c keys.c main.c osd.c popup.c prefs.c tune.c video.c Log Message: i18n patch. Index: Makefile.am =================================================================== RCS file: /cvsroot/xine/sinek/src/Makefile.am,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Makefile.am 2001/12/22 08:44:01 1.6 +++ Makefile.am 2001/12/28 18:21:55 1.7 @@ -3,8 +3,11 @@ ## INCLUDES = -I$(top_srcdir)/include +CFLAGS = @CFLAGS@ $(XINE_CFLAGS) $(GTK_CFLAGS) $(INTLDIR) bin_PROGRAMS = sinek + +sinek_LDADD = @LIBS@ $(XINE_LIBS) $(GTK_LIBS) $(INTLLIBS) sinek_SOURCES = \ main.c \ Index: audio.c =================================================================== RCS file: /cvsroot/xine/sinek/src/audio.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- audio.c 2001/12/22 08:44:01 1.3 +++ audio.c 2001/12/28 18:21:55 1.4 @@ -46,7 +46,7 @@ sinek.xine = xine_init(sinek.vd, sinek.ad, sinek.conf); if(!sinek.xine) { - printf("xine init error\n"); + printf(_("xine init error\n")); return 0; } Index: control.c =================================================================== RCS file: /cvsroot/xine/sinek/src/control.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- control.c 2001/12/25 18:43:19 1.9 +++ control.c 2001/12/28 18:21:55 1.10 @@ -307,7 +307,7 @@ if(jump_win) goto out; jump_win = gtk_dialog_new(); - gtk_window_set_title(GTK_WINDOW(jump_win), "Go to..."); + gtk_window_set_title(GTK_WINDOW(jump_win), _("Go to...")); vb = GTK_DIALOG(jump_win)->vbox; gtk_widget_show(vb); @@ -340,7 +340,7 @@ gtk_widget_show(hb); gtk_container_set_border_width(GTK_CONTAINER(hb), 10); - b = gtk_button_new_with_label("GO"); + b = gtk_button_new_with_label(_("GO")); gtk_widget_show(b); gtk_box_pack_start(GTK_BOX(hb), b, TRUE, TRUE, 0); Index: keys.c =================================================================== RCS file: /cvsroot/xine/sinek/src/keys.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- keys.c 2001/12/25 18:43:19 1.8 +++ keys.c 2001/12/28 18:21:55 1.9 @@ -108,7 +108,7 @@ execute_cmd(cmd); return; } -printf("Unhandled key %s, modifier %d.\n", sym, modifier); +printf(_("Unhandled key %s, modifier %d.\n"), sym, modifier); } Index: main.c =================================================================== RCS file: /cvsroot/xine/sinek/src/main.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- main.c 2001/12/25 18:43:19 1.6 +++ main.c 2001/12/28 18:21:55 1.7 @@ -27,9 +27,10 @@ { memset(&sinek, 0, sizeof(sinek)); -// gtk_set_locale(); -// bindtextdomain(PACKAGE, LOCALEDIR); -// textdomain(PACKAGE); + gtk_set_locale(); +// xine_set_locale(); + bindtextdomain(PACKAGE, XINE_LOCALEDIR); + textdomain(PACKAGE); gtk_init(&argc, &argv); @@ -61,6 +62,8 @@ switch(event->type) { case XINE_EVENT_PLAYBACK_FINISHED: - printf("playback finished.\n"); + if(sinek.repeat_one) + video_seek(0); + break; } } Index: osd.c =================================================================== RCS file: /cvsroot/xine/sinek/src/osd.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- osd.c 2001/12/25 18:43:19 1.2 +++ osd.c 2001/12/28 18:21:55 1.3 @@ -112,7 +112,7 @@ if(f) { font = f; - osd_display("Örnektir!"); + osd_display("Sample Subtitle!"); } } gtk_widget_hide(GTK_WIDGET(fsd)); Index: popup.c =================================================================== RCS file: /cvsroot/xine/sinek/src/popup.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- popup.c 2001/12/25 18:43:19 1.4 +++ popup.c 2001/12/28 18:21:55 1.5 @@ -10,52 +10,48 @@ #include "common.h" -static void cb_menu(GtkWidget *widget, guint action); -static void cb_popup(GtkWidget *widget, guint action); - -static GtkItemFactoryEntry menus[] = -{ - { "/Sinek", NULL, NULL, 0, "<Title>" }, - { "/sep", NULL, NULL, 0, "<Separator>" }, - { "/Toggle Windows", NULL, cb_menu, CMD_TOGGLE_GUI, NULL }, - { "/Control", NULL, NULL, 0, "<Branch>" }, - { "/Control/Play", NULL, cb_menu, CMD_PLAY, NULL }, - { "/Control/Pause", NULL, cb_menu, CMD_PAUSE, NULL }, - { "/Control/Stop", NULL, cb_menu, CMD_STOP, NULL }, - { "/Control/Next", NULL, cb_menu, CMD_NEXT, NULL }, - { "/Control/Previous", NULL, cb_menu, CMD_PREVIOUS, NULL }, - { "/Autoplay", NULL, NULL, 0, "<Branch>" }, - { "/Subtitle", NULL, NULL, 0, "<Branch>" }, - { "/Subtitle/Toggle", NULL, cb_menu, CMD_TOGGLE_SUBTITLES, NULL }, - { "/Subtitle/Set Position", NULL, cb_popup, 1, NULL }, - { "/Subtitle/Select Font...", NULL, cb_popup, 0, NULL }, - { "/sep", NULL, NULL, 0, "<Separator>" }, - { "/Tuning...", NULL, cb_menu, CMD_SHOW_TUNER, NULL }, - { "/Preferences...", NULL, cb_menu, CMD_SHOW_PREFS, NULL }, - { "/sep", NULL, NULL, 0, "<Separator>" }, - { "/About", NULL, cb_menu, CMD_SHOW_ABOUT, NULL }, - { "/Quit", NULL, cb_menu, CMD_QUIT, NULL }, -}; - -static GtkAccelGroup *ag; -static GtkItemFactory *fabrika; static GtkWidget *menu, *autoplay; static void create_list(GtkWidget *parent, char **ids, GtkSignalFunc func); static void cb_auto_browse(char *id); +static void cb_menu(GtkWidget *widget, guint action); +static void cb_popup(GtkWidget *widget, guint action); void popup_init(void) { - char **ids; + GtkItemFactoryEntry menus[] = + { + { _("/Sinek"), NULL, NULL, 0, "<Title>" }, + { "/sep", NULL, NULL, 0, "<Separator>" }, + { _("/Toggle Windows"), NULL, cb_menu, CMD_TOGGLE_GUI, NULL }, + { _("/Control"), NULL, NULL, 0, "<Branch>" }, + { _("/Control/Play"), NULL, cb_menu, CMD_PLAY, NULL }, + { _("/Control/Pause"), NULL, cb_menu, CMD_PAUSE, NULL }, + { _("/Control/Stop"), NULL, cb_menu, CMD_STOP, NULL }, + { _("/Control/Next"), NULL, cb_menu, CMD_NEXT, NULL }, + { _("/Control/Previous"), NULL, cb_menu, CMD_PREVIOUS, NULL }, + { _("/Autoplay"), NULL, NULL, 0, "<Branch>" }, + { _("/Subtitle"), NULL, NULL, 0, "<Branch>" }, + { _("/Subtitle/Toggle"), NULL, cb_menu, CMD_TOGGLE_SUBTITLES, NULL }, + { _("/Subtitle/Set Position"), NULL, cb_popup, 1, NULL }, + { _("/Subtitle/Select Font..."), NULL, cb_popup, 0, NULL }, + { "/sep", NULL, NULL, 0, "<Separator>" }, + { _("/Tuning..."), NULL, cb_menu, CMD_SHOW_TUNER, NULL }, + { _("/Preferences..."), NULL, cb_menu, CMD_SHOW_PREFS, NULL }, + { "/sep", NULL, NULL, 0, "<Separator>" }, + { _("/About"), NULL, cb_menu, CMD_SHOW_ABOUT, NULL }, + { _("/Quit"), NULL, cb_menu, CMD_QUIT, NULL }, + }; + GtkItemFactory *fabrika; gint n = sizeof(menus) / sizeof(menus[0]); + char **ids; - ag = gtk_accel_group_new(); - fabrika = gtk_item_factory_new(GTK_TYPE_MENU, "<main>", ag); + fabrika = gtk_item_factory_new(GTK_TYPE_MENU, "<main>", NULL); gtk_item_factory_create_items(fabrika, n, menus, NULL); menu = gtk_item_factory_get_widget(fabrika, "<main>"); - autoplay = gtk_item_factory_get_widget(fabrika, "/Autoplay"); + autoplay = gtk_item_factory_get_widget(fabrika, _("/Autoplay")); ids = xine_get_autoplay_input_plugin_ids(sinek.xine); create_list(autoplay, ids, GTK_SIGNAL_FUNC(cb_auto_browse)); @@ -64,7 +60,7 @@ void popup_pop(int time) { - gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, 3, time); + gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, 0, time); gtk_widget_grab_focus(GTK_WIDGET(menu)); gtk_widget_activate(GTK_WIDGET(menu)); } Index: prefs.c =================================================================== RCS file: /cvsroot/xine/sinek/src/prefs.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- prefs.c 2001/12/26 11:19:53 1.5 +++ prefs.c 2001/12/28 18:21:55 1.6 @@ -32,12 +32,13 @@ static void cb_ok(GtkWidget *w, gpointer data); static void cb_apply(GtkWidget *w, gpointer data); -static char *shortopts = "V:A:hv"; +static char *shortopts = "V:A:lhv"; #ifdef HAVE_GETOPT_LONG static struct option longopts[] = { { "video-driver", required_argument, 0, 'V' }, { "audio-driver", required_argument, 0, 'A' }, + { "loop", 0, 0, 'l' }, { "help", 0, 0, 'h' }, { "version", 0, 0, 'v' }, { 0, 0, 0, 0 } @@ -66,6 +67,10 @@ sinek.video_id = g_strdup(optarg); break; + case 'l': + sinek.repeat_one = 1; + break; + case 'h': print_usage(); @@ -88,23 +93,25 @@ void print_version(void) { - printf("Sinek v"VERSION" (Video Player)\n"); - printf("built with xine library v%d.%d.%d, ", XINE_MAJOR_VERSION, XINE_MINOR_VERSION, XINE_SUB_VERSION); - printf("using v%d.%d.%d.\n", xine_get_major_version(), xine_get_minor_version(), xine_get_sub_version()); + printf(_("Sinek v%s (Video Player)\n"), VERSION); + printf(_("built with xine library v%d.%d.%d, using v%d.%d.%d.\n"), + XINE_MAJOR_VERSION, XINE_MINOR_VERSION, XINE_SUB_VERSION, + xine_get_major_version(), xine_get_minor_version(), xine_get_sub_version()); } static void print_usage(void) { - printf("Usage: Sinek [OPTIONS] [MRL]\n" - " -V, --video-driver <id> Select video driver.\n" - " -A, --audio-driver <id> Select audio driver.\n" - " -h, --help Print this help text and exit.\n" - " -v, --version Print version number and exit.\n" + puts(_("Usage: Sinek [OPTIONS] [MRL]\n")); + puts(_(" -V, --video-driver <id> Select video driver.\n")); + puts(_(" -A, --audio-driver <id> Select audio driver.\n")); + puts(_(" -l, --loop Play mrl continously.\n")); + puts(_(" -h, --help Print this help text and exit.\n")); + puts(_(" -v, --version Print version number and exit.\n")); #ifndef HAVE_GETOPT_LONG - "(long options are not supported on your system)\n" + puts(_("(long options are not supported on your system)\n")); #endif - "Report bugs to <ma...@us...>.\n"); + puts(_("Report bugs to <ma...@us...>.\n")); exit(0); } Index: tune.c =================================================================== RCS file: /cvsroot/xine/sinek/src/tune.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- tune.c 2001/12/26 11:19:53 1.5 +++ tune.c 2001/12/28 18:21:55 1.6 @@ -32,7 +32,7 @@ vidcap = sinek.vd->get_capabilities(sinek.vd); tune_win = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_window_set_title(GTK_WINDOW(tune_win), "Sinek Tuner"); + gtk_window_set_title(GTK_WINDOW(tune_win), _("Sinek Tuner")); gtk_window_set_wmclass(GTK_WINDOW(tune_win), "Sinek Tune", "Sinek"); vb = gtk_vbox_new(FALSE, 0); Index: video.c =================================================================== RCS file: /cvsroot/xine/sinek/src/video.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- video.c 2001/12/25 18:43:19 1.11 +++ video.c 2001/12/28 18:21:55 1.12 @@ -67,7 +67,7 @@ display = XOpenDisplay(gdk_display_name); sinek.display = display; -xfred = ConnectionNumber(display); + xfred = ConnectionNumber(display); screen = gdk_screen; find_best_visual(); XLockDisplay(display); @@ -86,7 +86,7 @@ wm_hint = XAllocWMHints(); if(!wm_hint) { - printf("XAllocWMHints failed.\n"); + printf(_("XAllocWMHints failed.\n")); return 0; } @@ -392,7 +392,7 @@ /* if that fails too, exit with an error */ if(!sinek.vd) { - printf("Cannot load video driver.\n"); + printf(_("Cannot load video driver.\n")); return 0; } @@ -442,7 +442,7 @@ { visual = vinfo.visual; } else { - printf("couldn't find true color visual.\n"); + printf(_("couldn't find true color visual.\n")); depth = DefaultDepth(display, screen); visual = DefaultVisual(display, screen); } @@ -505,7 +505,7 @@ static void create_window(int fs, int w, int h) { - static char *title = _("Sinek Video Output"); + char *title; static Atom XA_WIN_LAYER = None; XSetWindowAttributes attr; // XEvent xev; @@ -513,6 +513,7 @@ MWMHints mwmhints; long data[1]; + title = _("Sinek Video Output"); attr.background_pixel = black.pixel; attr.border_pixel = black.pixel; attr.colormap = colormap; @@ -524,7 +525,7 @@ if(!videowin) { - printf("Cannot create video window!\n"); + printf(_("Cannot create video window!\n")); exit(5); } sinek.video_win = videowin; |