diff options
author | Kalle Wallin <kaw@linux.se> | 2004-06-06 11:02:26 +0000 |
---|---|---|
committer | Kalle Wallin <kaw@linux.se> | 2004-06-06 11:02:26 +0000 |
commit | ddd95cfda00af6e9093b8958af5679cf9b9cc54f (patch) | |
tree | 37b602b9d774e078179b11542d097e99797b1f79 /src | |
parent | 156229d9a0dda8ec38daf689462638eca3c25497 (diff) | |
download | mpd-ddd95cfda00af6e9093b8958af5679cf9b9cc54f.tar.gz mpd-ddd95cfda00af6e9093b8958af5679cf9b9cc54f.tar.xz mpd-ddd95cfda00af6e9093b8958af5679cf9b9cc54f.zip |
i18n - ncmpc is now bilingual (sv)
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1349 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src')
-rw-r--r-- | src/screen.c | 6 | ||||
-rw-r--r-- | src/screen.h | 7 | ||||
-rw-r--r-- | src/screen_file.c | 6 | ||||
-rw-r--r-- | src/screen_help.c | 84 | ||||
-rw-r--r-- | src/screen_keydef.c | 4 | ||||
-rw-r--r-- | src/screen_play.c | 2 |
6 files changed, 57 insertions, 52 deletions
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 <ncurses.h> #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 <ncurses.h> #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<COLS-3 && i<256; i++) + buf[i]='-'; + buf[i] = '\0'; + } + else + strcpy(buf, " "); + return buf; } if( help_text[index].text ) snprintf(buf, 256, "%20s : %s ", get_key_names(help_text[index].command, TRUE), - help_text[index].text); + _(help_text[index].text)); else snprintf(buf, 256, "%20s : %s ", @@ -191,7 +203,7 @@ help_exit(void) static char * help_title(void) { - return (TOP_HEADER_PREFIX "Help"); + return _("Music Player Client - Help"); } static void diff --git a/src/screen_keydef.c b/src/screen_keydef.c index 3e2c921bc..16311af56 100644 --- a/src/screen_keydef.c +++ b/src/screen_keydef.c @@ -276,10 +276,10 @@ keydef_title(void) static char buf[BUFSIZE]; if( subcmd<0 ) - return _(TOP_HEADER_PREFIX "Edit key bindings"); + return _("Edit key bindings"); snprintf(buf, BUFSIZE, - _(TOP_HEADER_PREFIX "Edit keys for %s"), + _("Edit keys for %s"), cmds[subcmd].name); return buf; } diff --git a/src/screen_play.c b/src/screen_play.c index b4ff58cbe..8ee1c4902 100644 --- a/src/screen_play.c +++ b/src/screen_play.c @@ -151,7 +151,7 @@ play_exit(void) static char * play_title(void) { - return _(TOP_HEADER_PREFIX "Playlist"); + return _("Music Player Client - Playlist"); } static void |