From ddd95cfda00af6e9093b8958af5679cf9b9cc54f Mon Sep 17 00:00:00 2001 From: Kalle Wallin Date: Sun, 6 Jun 2004 11:02:26 +0000 Subject: i18n - ncmpc is now bilingual (sv) git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1349 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/screen.c | 6 +++- src/screen.h | 7 ----- src/screen_file.c | 6 +--- src/screen_help.c | 84 ++++++++++++++++++++++++++++++----------------------- src/screen_keydef.c | 4 +-- src/screen_play.c | 2 +- 6 files changed, 57 insertions(+), 52 deletions(-) (limited to 'src') diff --git a/src/screen.c b/src/screen.c index 94b3dc860..4eac178b7 100644 --- a/src/screen.c +++ b/src/screen.c @@ -709,7 +709,11 @@ screen_cmd(mpd_client_t *c, command_t cmd) switch(cmd) { case CMD_PLAY: - mpd_sendPlayCommand(c->connection, play_get_selected()); + if( screen->mode == SCREEN_PLAY_WINDOW ) + n = play_get_selected(); + else + n = -1; + mpd_sendPlayCommand(c->connection, n); mpd_finishCommand(c->connection); break; case CMD_PAUSE: diff --git a/src/screen.h b/src/screen.h index 00cd35530..75852d36e 100644 --- a/src/screen.h +++ b/src/screen.h @@ -3,13 +3,6 @@ #include #include "list_window.h" -/* top window headers */ -#define TOP_HEADER_PREFIX "Music Player Client - " -#define TOP_HEADER_PLAY TOP_HEADER_PREFIX "Playlist" -#define TOP_HEADER_FILE TOP_HEADER_PREFIX "Browse" -#define TOP_HEADER_HELP TOP_HEADER_PREFIX "Help " -#define TOP_HEADER_SEARCH TOP_HEADER_PREFIX "Search " - /* minumum window size */ #define SCREEN_MIN_COLS 14 #define SCREEN_MIN_ROWS 5 diff --git a/src/screen_file.c b/src/screen_file.c index be5e1eb9e..f86e8df95 100644 --- a/src/screen_file.c +++ b/src/screen_file.c @@ -366,11 +366,7 @@ file_title(void) char *tmp; tmp = utf8_to_locale(basename(mpc->cwd)); - snprintf(buf, TITLESIZE, - "%s : %s ", - _(TOP_HEADER_FILE) , - tmp - ); + snprintf(buf, TITLESIZE, _("Browse: %s"), tmp); g_free(tmp); return buf; diff --git a/src/screen_help.c b/src/screen_help.c index 960638d65..ced66064a 100644 --- a/src/screen_help.c +++ b/src/screen_help.c @@ -22,6 +22,7 @@ #include #include "config.h" +#include "ncmpc.h" #include "libmpdclient.h" #include "mpc.h" #include "command.h" @@ -39,8 +40,8 @@ typedef struct static help_text_row_t help_text[] = { - { 1, CMD_NONE, " Movement keys " }, - { 0, CMD_NONE, " -----------------" }, + { 1, CMD_NONE, N_("Keys - Movement") }, + { 2, CMD_NONE, NULL }, { 0, CMD_LIST_PREVIOUS, NULL }, { 0, CMD_LIST_NEXT, NULL }, { 0, CMD_LIST_PREVIOUS_PAGE, NULL }, @@ -58,8 +59,8 @@ static help_text_row_t help_text[] = { 0, CMD_NONE, NULL }, { 0, CMD_NONE, NULL }, - { 1, CMD_NONE, " General keys " }, - { 0, CMD_NONE, " ----------------" }, + { 1, CMD_NONE, N_("Keys - Global") }, + { 2, CMD_NONE, NULL }, { 0, CMD_STOP, NULL }, { 0, CMD_PAUSE, NULL }, { 0, CMD_TRACK_NEXT, NULL }, @@ -69,56 +70,57 @@ static help_text_row_t help_text[] = { 0, CMD_VOLUME_DOWN, NULL }, { 0, CMD_VOLUME_UP, NULL }, { 0, CMD_NONE, NULL }, - { 0, CMD_SHUFFLE, NULL }, { 0, CMD_REPEAT, NULL }, { 0, CMD_RANDOM, NULL }, { 0, CMD_CROSSFADE, NULL }, + { 0, CMD_SHUFFLE, NULL }, { 0, CMD_DB_UPDATE, NULL }, { 0, CMD_NONE, NULL }, + { 0, CMD_LIST_FIND, NULL }, + { 0, CMD_LIST_RFIND, NULL }, + { 0, CMD_LIST_FIND_NEXT, NULL }, + { 0, CMD_LIST_RFIND_NEXT, NULL }, + { 0, CMD_TOGGLE_FIND_WRAP, NULL }, + { 0, CMD_NONE, NULL }, { 0, CMD_QUIT, NULL }, { 0, CMD_NONE, NULL }, { 0, CMD_NONE, NULL }, - { 1, CMD_NONE, " Keys - Playlist screen " }, - { 0, CMD_NONE, " --------------------------" }, - { 0, CMD_PLAY, "Play" }, + { 1, CMD_NONE, N_("Keys - Playlist screen") }, + { 2, CMD_NONE, NULL }, + { 0, CMD_PLAY, N_("Play") }, { 0, CMD_DELETE, NULL }, { 0, CMD_CLEAR, NULL }, - { 0, CMD_LIST_MOVE_UP, "Move song up" }, - { 0, CMD_LIST_MOVE_DOWN, "Move song down" }, + { 0, CMD_LIST_MOVE_UP, N_("Move song up") }, + { 0, CMD_LIST_MOVE_DOWN, N_("Move song down") }, { 0, CMD_SAVE_PLAYLIST, NULL }, - { 0, CMD_SCREEN_UPDATE, "Center" }, + { 0, CMD_SCREEN_UPDATE, N_("Center") }, { 0, CMD_TOGGLE_AUTOCENTER, NULL }, { 0, CMD_NONE, NULL }, { 0, CMD_NONE, NULL }, - { 1, CMD_NONE, " Keys - Browse screen " }, - { 0, CMD_NONE, " ------------------------" }, - { 0, CMD_PLAY, "Enter directory" }, - { 0, CMD_SELECT, NULL }, - { 0, CMD_DELETE, NULL }, - { 0, CMD_SCREEN_UPDATE, NULL }, - - { 0, CMD_NONE, NULL }, - { 0, CMD_NONE, NULL }, - { 1, CMD_NONE, " Find keys " }, - { 0, CMD_NONE, " -------------" }, - { 0, CMD_LIST_FIND, NULL }, - { 0, CMD_LIST_RFIND, NULL }, - { 0, CMD_LIST_FIND_NEXT, NULL }, - { 0, CMD_LIST_RFIND_NEXT, NULL }, - { 0, CMD_TOGGLE_FIND_WRAP, NULL }, + { 1, CMD_NONE, N_("Keys - Browse screen") }, + { 2, CMD_NONE, NULL }, + { 0, CMD_PLAY, N_("Enter directory") }, + { 0, CMD_SELECT, NULL }, + { 0, CMD_DELETE, NULL }, + { 0, CMD_SCREEN_UPDATE, NULL }, { 0, CMD_NONE, NULL }, { 0, CMD_NONE, NULL }, - { 1, CMD_NONE, " ncmpc build information " }, - { 0, CMD_NONE, " ---------------------------" }, + { 1, CMD_NONE, "ncmpc build information" }, + { 2, CMD_NONE, NULL }, { 0, CMD_NONE, " Version : " VERSION }, { 0, CMD_NONE, " Configuration dirs : ~/.ncmpc, " SYSCONFDIR "/" PACKAGE }, +#ifdef ENABLE_NLS + { 0, CMD_NONE, "NLS support : yes" }, +#else + { 0, CMD_NONE, "NLS support : no" }, +#endif #ifdef ENABLE_KEYDEF_SCREEN - { 0, CMD_NONE, " Key Editor : yes" }, + { 0, CMD_NONE, "Key Editor : yes" }, #else - { 0, CMD_NONE, " Key Editor : no" }, + { 0, CMD_NONE, "Key Editor : no" }, #endif { 0, CMD_NONE, NULL }, @@ -148,15 +150,25 @@ list_callback(int index, int *highlight, void *data) if( help_text[index].command == CMD_NONE ) { if( help_text[index].text ) - return help_text[index].text; - else - return " "; + snprintf(buf, 256, "%28s", _(help_text[index].text)); + else + if( help_text[index].highlight == 2 ) + { + int i; + + for(i=3; i