diff options
author | Amar Takhar <mplayer@darkbeer.org> | 2009-07-06 02:41:23 +0300 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-07-07 01:28:07 +0300 |
commit | b5972d6f14c04384d88d3f813b435d484562403f (patch) | |
tree | af30d63d0bca01c2132cd54f43b51e444948abc0 /libmenu | |
parent | 7394680e4eb7b21cd8bf38b973ff66881889be26 (diff) | |
download | mpv-b5972d6f14c04384d88d3f813b435d484562403f.tar.bz2 mpv-b5972d6f14c04384d88d3f813b435d484562403f.tar.xz |
Translation system changes part 1: wrap translated strings
Replace mp_msg() calls which have a translated string as the format
argument with mp_tmsg and add _() around all other translated strings.
Diffstat (limited to 'libmenu')
-rw-r--r-- | libmenu/menu.c | 26 | ||||
-rw-r--r-- | libmenu/menu_cmdlist.c | 8 | ||||
-rw-r--r-- | libmenu/menu_console.c | 16 | ||||
-rw-r--r-- | libmenu/menu_filesel.c | 12 | ||||
-rw-r--r-- | libmenu/menu_param.c | 12 | ||||
-rw-r--r-- | libmenu/menu_pt.c | 4 | ||||
-rw-r--r-- | libmenu/menu_txt.c | 8 | ||||
-rw-r--r-- | libmenu/vf_menu.c | 4 |
8 files changed, 45 insertions, 45 deletions
diff --git a/libmenu/menu.c b/libmenu/menu.c index 9fd9a40729..5c65bd02f0 100644 --- a/libmenu/menu.c +++ b/libmenu/menu.c @@ -114,7 +114,7 @@ static int menu_parse_config(char* buffer, struct m_config *mconfig) while(1) { r = asx_get_element(parser,&buffer,&element,&body,&attribs); if(r < 0) { - mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_SyntaxErrorAtLine,parser->line); + mp_tmsg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_SyntaxErrorAtLine,parser->line); asx_parser_free(parser); return 0; } else if(r == 0) { @@ -124,7 +124,7 @@ static int menu_parse_config(char* buffer, struct m_config *mconfig) // Has it a name ? name = asx_get_attrib("name",attribs); if(!name) { - mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_MenuDefinitionsNeedANameAttrib,parser->line); + mp_tmsg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_MenuDefinitionsNeedANameAttrib,parser->line); free(element); if(body) free(body); asx_free_attribs(attribs); @@ -156,7 +156,7 @@ static int menu_parse_config(char* buffer, struct m_config *mconfig) for(;;) { r = asx_get_element(parser,&bd,&element,&b,&attribs); if(r < 0) { - mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_SyntaxErrorAtLine, + mp_tmsg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_SyntaxErrorAtLine, parser->line); free(body); asx_parser_free(parser); @@ -209,13 +209,13 @@ static int menu_parse_config(char* buffer, struct m_config *mconfig) for(i = 0 ; attribs[2*i] ; i++) { if(strcasecmp(attribs[2*i],"name") == 0) continue; if(!m_struct_set(&minfo->priv_st,menu_list[menu_count].cfg,attribs[2*i], attribs[2*i+1])) - mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_BadAttrib,attribs[2*i],attribs[2*i+1], + mp_tmsg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_BadAttrib,attribs[2*i],attribs[2*i+1], name,parser->line); } menu_count++; memset(&menu_list[menu_count],0,sizeof(menu_def_t)); } else { - mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_UnknownMenuType,element,parser->line); + mp_tmsg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_UnknownMenuType,element,parser->line); free(name); if(body) free(body); } @@ -243,7 +243,7 @@ int menu_init(struct MPContext *mpctx, struct m_config *mconfig, #endif fd = open(cfg_file, O_RDONLY); if(fd < 0) { - mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_CantOpenConfigFile,cfg_file); + mp_tmsg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_CantOpenConfigFile,cfg_file); return 0; } buffer = malloc(bl); @@ -251,7 +251,7 @@ int menu_init(struct MPContext *mpctx, struct m_config *mconfig, int r; if(bl - br < BUF_MIN) { if(bl >= BUF_MAX) { - mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_ConfigFileIsTooBig,BUF_MAX/1024); + mp_tmsg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_ConfigFileIsTooBig,BUF_MAX/1024); close(fd); free(buffer); return 0; @@ -264,7 +264,7 @@ int menu_init(struct MPContext *mpctx, struct m_config *mconfig, br += r; } if(!br) { - mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_ConfigFileIsEmpty); + mp_tmsg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_ConfigFileIsEmpty); return 0; } buffer[br-1] = '\0'; @@ -329,7 +329,7 @@ menu_t* menu_open(char *name) { break; } if(menu_list[i].name == NULL) { - mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_MenuNotFound,name); + mp_tmsg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_MenuNotFound,name); return NULL; } m = calloc(1,sizeof(menu_t)); @@ -344,7 +344,7 @@ menu_t* menu_open(char *name) { if(m->priv) m_struct_free(m->priv_st,m->priv); free(m); - mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_MenuInitFailed,name); + mp_tmsg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_MenuInitFailed,name); return NULL; } @@ -482,7 +482,7 @@ void menu_draw_text(mp_image_t* mpi,char* txt, int x, int y) { int font; if(!draw_alpha) { - mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_UnsupportedOutformat); + mp_tmsg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_UnsupportedOutformat); return; } @@ -516,7 +516,7 @@ void menu_draw_text_full(mp_image_t* mpi,char* txt, draw_alpha_f draw_alpha = get_draw_alpha(mpi->imgfmt); if(!draw_alpha) { - mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_UnsupportedOutformat); + mp_tmsg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_UnsupportedOutformat); return; } @@ -758,7 +758,7 @@ void menu_draw_box(mp_image_t* mpi,unsigned char grey,unsigned char alpha, int x int g; if(!draw_alpha) { - mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_UnsupportedOutformat); + mp_tmsg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_UnsupportedOutformat); return; } diff --git a/libmenu/menu_cmdlist.c b/libmenu/menu_cmdlist.c index b2faa0b583..e4896866fc 100644 --- a/libmenu/menu_cmdlist.c +++ b/libmenu/menu_cmdlist.c @@ -119,19 +119,19 @@ static int parse_args(menu_t* menu,char* args) { while(1) { r = asx_get_element(parser,&args,&element,&body,&attribs); if(r < 0) { - mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_SyntaxErrorAtLine,parser->line); + mp_tmsg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_SyntaxErrorAtLine,parser->line); asx_parser_free(parser); return -1; } else if(r == 0) { asx_parser_free(parser); if(!m) - mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_NoEntryFoundInTheMenuDefinition); + mp_tmsg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_NoEntryFoundInTheMenuDefinition); return m ? 1 : 0; } // Has it a name ? name = asx_get_attrib("name",attribs); if(!name) { - mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_ListMenuEntryDefinitionsNeedAName,parser->line); + mp_tmsg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_ListMenuEntryDefinitionsNeedAName,parser->line); free(element); if(body) free(body); asx_free_attribs(attribs); @@ -157,7 +157,7 @@ static int open_cmdlist(menu_t* menu, char* args) { menu->close = close_menu; if(!args) { - mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_ListMenuNeedsAnArgument); + mp_tmsg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_ListMenuNeedsAnArgument); return 0; } diff --git a/libmenu/menu_console.c b/libmenu/menu_console.c index bba777cc4d..c83872f789 100644 --- a/libmenu/menu_console.c +++ b/libmenu/menu_console.c @@ -265,10 +265,10 @@ static void check_child(menu_t* menu) { mpriv->prompt = mpriv->mp_prompt; //add_line(mpriv,"Child process exited"); } - else mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_WaitPidError,strerror(errno)); + else mp_tmsg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_WaitPidError,strerror(errno)); } } else if(r < 0) { - mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_SelectError); + mp_tmsg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_SelectError); return; } @@ -278,7 +278,7 @@ static void check_child(menu_t* menu) { if(w) mpriv->add_line = 1; r = read(mpriv->child_fd[i],buffer,255); if(r < 0) - mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_ReadErrorOnChildFD, i == 1 ? "stdout":"stderr"); + mp_tmsg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_ReadErrorOnChildFD, i == 1 ? "stdout":"stderr"); else if(r>0) { buffer[r] = '\0'; add_string(mpriv,buffer); @@ -296,9 +296,9 @@ static int run_shell_cmd(menu_t* menu, char* cmd) { #ifndef __MINGW32__ int in[2],out[2],err[2]; - mp_msg(MSGT_GLOBAL,MSGL_INFO,MSGTR_LIBMENU_ConsoleRun,cmd); + mp_tmsg(MSGT_GLOBAL,MSGL_INFO,MSGTR_LIBMENU_ConsoleRun,cmd); if(mpriv->child) { - mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_AChildIsAlreadyRunning); + mp_tmsg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_AChildIsAlreadyRunning); return 0; } @@ -308,7 +308,7 @@ static int run_shell_cmd(menu_t* menu, char* cmd) { mpriv->child = fork(); if(mpriv->child < 0) { - mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_ForkFailed); + mp_tmsg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_ForkFailed); close_pipe(in); close_pipe(out); close_pipe(err); @@ -382,14 +382,14 @@ static void read_cmd(menu_t* menu,int cmd) { while(l > 0) { int w = write(mpriv->child_fd[0],str,l); if(w < 0) { - mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_WriteError); + mp_tmsg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_WriteError); break; } l -= w; str += w; } if(write(mpriv->child_fd[0],"\n",1) < 0) - mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_WriteError); + mp_tmsg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_WriteError); enter_cmd(menu); return; } diff --git a/libmenu/menu_filesel.c b/libmenu/menu_filesel.c index 346937dc87..734e61bbb4 100644 --- a/libmenu/menu_filesel.c +++ b/libmenu/menu_filesel.c @@ -249,7 +249,7 @@ static int open_dir(menu_t* menu,char* args) { mpriv->p.title = replace_path(mpriv->title,mpriv->dir,0); if ((dirp = opendir (mpriv->dir)) == NULL){ - mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_OpendirError, strerror(errno)); + mp_tmsg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_OpendirError, strerror(errno)); return 0; } @@ -291,7 +291,7 @@ static int open_dir(menu_t* menu,char* args) { if(n%20 == 0){ // Get some more mem if((tp = (char **) realloc(namelist, (n+20) * sizeof (char *))) == NULL) { - mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_ReallocError, strerror(errno)); + mp_tmsg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_ReallocError, strerror(errno)); n--; goto bailout; } @@ -300,7 +300,7 @@ static int open_dir(menu_t* menu,char* args) { namelist[n] = (char *) malloc(strlen(dp->d_name) + 2); if(namelist[n] == NULL){ - mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_MallocError, strerror(errno)); + mp_tmsg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_MallocError, strerror(errno)); n--; goto bailout; } @@ -318,7 +318,7 @@ bailout: qsort(namelist, n, sizeof(char *), (kill_warn)compare); if (n < 0) { - mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_ReaddirError,strerror(errno)); + mp_tmsg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_ReaddirError,strerror(errno)); return 0; } while(n--) { @@ -329,7 +329,7 @@ bailout: e->d = 1; menu_list_add_entry(menu,e); }else{ - mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_MallocError, strerror(errno)); + mp_tmsg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_MallocError, strerror(errno)); } free(namelist[n]); } @@ -368,7 +368,7 @@ static void read_cmd(menu_t* menu,int cmd) { } menu_list_uninit(menu,free_entry); if(!open_dir(menu,p)) { - mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_CantOpenDirectory,p); + mp_tmsg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_CantOpenDirectory,p); menu->cl = 1; } free(p); diff --git a/libmenu/menu_param.c b/libmenu/menu_param.c index 1ab7a59592..af828c20f0 100644 --- a/libmenu/menu_param.c +++ b/libmenu/menu_param.c @@ -117,13 +117,13 @@ static int parse_args(menu_t* menu,char* args) { while(1) { r = asx_get_element(parser,&args,&element,&body,&attribs); if(r < 0) { - mp_msg(MSGT_OSD_MENU,MSGL_ERR,MSGTR_LIBMENU_SyntaxErrorAtLine,parser->line); + mp_tmsg(MSGT_OSD_MENU,MSGL_ERR,MSGTR_LIBMENU_SyntaxErrorAtLine,parser->line); asx_parser_free(parser); return -1; } else if(r == 0) { asx_parser_free(parser); if(!m) - mp_msg(MSGT_OSD_MENU,MSGL_WARN,MSGTR_LIBMENU_NoEntryFoundInTheMenuDefinition); + mp_tmsg(MSGT_OSD_MENU,MSGL_WARN,MSGTR_LIBMENU_NoEntryFoundInTheMenuDefinition); m = calloc(1,sizeof(struct list_entry_s)); m->p.txt = strdup("Back"); menu_list_add_entry(menu,m); @@ -132,7 +132,7 @@ static int parse_args(menu_t* menu,char* args) { if(!strcmp(element,"menu")) { name = asx_get_attrib("menu",attribs); if(!name) { - mp_msg(MSGT_OSD_MENU,MSGL_WARN,MSGTR_LIBMENU_SubmenuDefinitionNeedAMenuAttribut); + mp_tmsg(MSGT_OSD_MENU,MSGL_WARN,MSGTR_LIBMENU_SubmenuDefinitionNeedAMenuAttribut); goto next_element; } m = calloc(1,sizeof(struct list_entry_s)); @@ -147,13 +147,13 @@ static int parse_args(menu_t* menu,char* args) { name = asx_get_attrib("property",attribs); opt = NULL; if(name && mp_property_do(name,M_PROPERTY_GET_TYPE,&opt,menu->ctx) <= 0) { - mp_msg(MSGT_OSD_MENU,MSGL_WARN,MSGTR_LIBMENU_InvalidProperty, + mp_tmsg(MSGT_OSD_MENU,MSGL_WARN,MSGTR_LIBMENU_InvalidProperty, name,parser->line); goto next_element; } txt = asx_get_attrib("txt",attribs); if(!(name || txt)) { - mp_msg(MSGT_OSD_MENU,MSGL_WARN,MSGTR_LIBMENU_PrefMenuEntryDefinitionsNeed,parser->line); + mp_tmsg(MSGT_OSD_MENU,MSGL_WARN,MSGTR_LIBMENU_PrefMenuEntryDefinitionsNeed,parser->line); if(txt) free(txt), txt = NULL; goto next_element; } @@ -278,7 +278,7 @@ static int openMenu(menu_t* menu, char* args) { if(!args) { - mp_msg(MSGT_OSD_MENU,MSGL_ERR,MSGTR_LIBMENU_PrefMenuNeedsAnArgument); + mp_tmsg(MSGT_OSD_MENU,MSGL_ERR,MSGTR_LIBMENU_PrefMenuNeedsAnArgument); return 0; } diff --git a/libmenu/menu_pt.c b/libmenu/menu_pt.c index 5c408361c7..67e129d7ca 100644 --- a/libmenu/menu_pt.c +++ b/libmenu/menu_pt.c @@ -98,7 +98,7 @@ static void read_cmd(menu_t* menu,int cmd) { d--; } if(i == NULL) { - mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_CantfindTheTargetItem); + mp_tmsg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_CantfindTheTargetItem); break; } } @@ -111,7 +111,7 @@ static void read_cmd(menu_t* menu,int cmd) { mp_input_queue_cmd(menu->input_ctx, c); } else - mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_FailedToBuildCommand,str); + mp_tmsg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_FailedToBuildCommand,str); } break; default: menu_list_read_cmd(menu,cmd); diff --git a/libmenu/menu_txt.c b/libmenu/menu_txt.c index 74648ff7c7..4ebc4e3355 100644 --- a/libmenu/menu_txt.c +++ b/libmenu/menu_txt.c @@ -141,13 +141,13 @@ static int open_txt(menu_t* menu, char* args) { menu->read_cmd = read_cmd; if(!mpriv->file) { - mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_MenuTxtNeedATxtFileName); + mp_tmsg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_MenuTxtNeedATxtFileName); return 0; } fd = fopen(mpriv->file,"r"); if(!fd) { - mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_MenuTxtCantOpen,mpriv->file); + mp_tmsg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_MenuTxtCantOpen,mpriv->file); return 0; } @@ -178,7 +178,7 @@ static int open_txt(menu_t* menu, char* args) { mpriv->num_lines++; } if(pos >= BUF_SIZE-1) { - mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_WarningTooLongLineSplitting); + mp_tmsg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_WarningTooLongLineSplitting); mpriv->lines = realloc(mpriv->lines,(mpriv->num_lines + 1)*sizeof(char*)); mpriv->lines[mpriv->num_lines] = strdup(buf); mpriv->num_lines++; @@ -186,7 +186,7 @@ static int open_txt(menu_t* menu, char* args) { } } - mp_msg(MSGT_GLOBAL,MSGL_INFO,MSGTR_LIBMENU_ParsedLines,mpriv->num_lines); + mp_tmsg(MSGT_GLOBAL,MSGL_INFO,MSGTR_LIBMENU_ParsedLines,mpriv->num_lines); return 1; } diff --git a/libmenu/vf_menu.c b/libmenu/vf_menu.c index 6ce0c37fd8..2eadad6741 100644 --- a/libmenu/vf_menu.c +++ b/libmenu/vf_menu.c @@ -99,7 +99,7 @@ static int cmd_filter(mp_cmd_t* cmd, int paused, struct vf_priv_s * priv) { else if(strcmp(arg,"hide") == 0 || strcmp(arg,"toggle") == 0) priv->current->show = 0; else - mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_UnknownMenuCommand,arg); + mp_tmsg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_UnknownMenuCommand,arg); return 1; } case MP_CMD_SET_MENU : { @@ -107,7 +107,7 @@ static int cmd_filter(mp_cmd_t* cmd, int paused, struct vf_priv_s * priv) { menu_t* l = priv->current; priv->current = menu_open(menu); if(!priv->current) { - mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_FailedToOpenMenu,menu); + mp_tmsg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_FailedToOpenMenu,menu); priv->current = l; priv->current->show = 0; } else { |