From b5972d6f14c04384d88d3f813b435d484562403f Mon Sep 17 00:00:00 2001 From: Amar Takhar Date: Mon, 6 Jul 2009 02:41:23 +0300 Subject: 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. --- codec-cfg.c | 58 +++++++++--------- command.c | 142 ++++++++++++++++++++++---------------------- edl.c | 16 ++--- input/appleir.c | 8 +-- input/input.c | 60 +++++++++---------- input/joystick.c | 18 +++--- input/lirc.c | 6 +- libaf/af_ladspa.c | 28 ++++----- libaf/af_lavcac3enc.c | 6 +- libaf/af_scaletempo.c | 20 +++---- libaf/format.c | 2 +- libao2/ao_alsa.c | 100 +++++++++++++++---------------- libao2/ao_alsa5.c | 46 +++++++------- libao2/ao_arts.c | 12 ++-- libao2/ao_dxr2.c | 4 +- libao2/ao_esd.c | 6 +- libao2/ao_ivtv.c | 2 +- libao2/ao_mpegpes.c | 4 +- libao2/ao_oss.c | 24 ++++---- libao2/ao_pcm.c | 6 +- libao2/ao_sdl.c | 12 ++-- libao2/ao_sgi.c | 28 ++++----- libao2/ao_sun.c | 8 +-- libao2/ao_v4l2.c | 2 +- libao2/audio_out.c | 10 ++-- libmenu/menu.c | 26 ++++---- libmenu/menu_cmdlist.c | 8 +-- libmenu/menu_console.c | 16 ++--- libmenu/menu_filesel.c | 12 ++-- libmenu/menu_param.c | 12 ++-- libmenu/menu_pt.c | 4 +- libmenu/menu_txt.c | 8 +-- libmenu/vf_menu.c | 4 +- libmpcodecs/ad_acm.c | 4 +- libmpcodecs/ad_dmo.c | 2 +- libmpcodecs/ad_dshow.c | 2 +- libmpcodecs/ad_dvdpcm.c | 2 +- libmpcodecs/ad_ffmpeg.c | 6 +- libmpcodecs/ad_libdv.c | 2 +- libmpcodecs/ad_realaud.c | 2 +- libmpcodecs/ae_lame.c | 26 ++++---- libmpcodecs/ae_lavc.c | 8 +-- libmpcodecs/dec_audio.c | 32 +++++----- libmpcodecs/dec_video.c | 26 ++++---- libmpcodecs/vd.c | 14 ++--- libmpcodecs/vd_dmo.c | 8 +-- libmpcodecs/vd_dshow.c | 8 +-- libmpcodecs/vd_ffmpeg.c | 22 +++---- libmpcodecs/vd_realvid.c | 2 +- libmpcodecs/vd_vfw.c | 2 +- libmpcodecs/ve_lavc.c | 8 +-- libmpcodecs/ve_raw.c | 2 +- libmpcodecs/ve_vfw.c | 12 ++-- libmpcodecs/vf.c | 14 ++--- libmpcodecs/vf_ass.c | 4 +- libmpcodecs/vf_crop.c | 2 +- libmpcodecs/vf_cropdetect.c | 2 +- libmpcodecs/vf_expand.c | 6 +- libmpcodecs/vf_format.c | 2 +- libmpcodecs/vf_framestep.c | 2 +- libmpcodecs/vf_lavc.c | 4 +- libmpcodecs/vf_noformat.c | 2 +- libmpcodecs/vf_palette.c | 2 +- libmpcodecs/vf_test.c | 2 +- libmpcodecs/vf_tile.c | 2 +- libmpcodecs/vf_yuy2.c | 2 +- libmpcodecs/vf_yvu9.c | 2 +- libmpdemux/asfheader.c | 28 ++++----- libmpdemux/aviheader.c | 50 ++++++++-------- libmpdemux/demux_asf.c | 6 +- libmpdemux/demux_audio.c | 2 +- libmpdemux/demux_avi.c | 24 ++++---- libmpdemux/demux_demuxers.c | 2 +- libmpdemux/demux_lavf.c | 6 +- libmpdemux/demux_lmlm4.c | 4 +- libmpdemux/demux_mkv.c | 32 +++++----- libmpdemux/demux_mov.c | 14 ++--- libmpdemux/demux_mpg.c | 8 +-- libmpdemux/demux_nut.c | 4 +- libmpdemux/demux_real.c | 10 ++-- libmpdemux/demux_ty.c | 2 +- libmpdemux/demux_viv.c | 4 +- libmpdemux/demux_xmms.c | 6 +- libmpdemux/demuxer.c | 50 ++++++++-------- libmpdemux/muxer.c | 8 +-- libmpdemux/muxer_avi.c | 8 +-- libmpdemux/muxer_lavf.c | 4 +- libmpdemux/muxer_mpeg.c | 4 +- libmpdemux/muxer_rawaudio.c | 6 +- libmpdemux/video.c | 22 +++---- libvo/aspect.c | 4 +- libvo/font_load_ft.c | 16 ++--- libvo/mga_common.c | 24 ++++---- libvo/sub.c | 26 ++++---- libvo/vesa_lvo.c | 10 ++-- libvo/video_out.c | 6 +- libvo/vo_3dfx.c | 18 +++--- libvo/vo_aa.c | 4 +- libvo/vo_dxr3.c | 106 ++++++++++++++++----------------- libvo/vo_jpeg.c | 42 ++++++------- libvo/vo_md5sum.c | 14 ++--- libvo/vo_mga.c | 4 +- libvo/vo_null.c | 2 +- libvo/vo_png.c | 10 ++-- libvo/vo_pnm.c | 46 +++++++------- libvo/vo_sdl.c | 26 ++++---- libvo/vo_svga.c | 20 +++---- libvo/vo_tdfx_vid.c | 42 ++++++------- libvo/vo_tdfxfb.c | 20 +++---- libvo/vo_tga.c | 2 +- libvo/vo_vesa.c | 76 ++++++++++++------------ libvo/vo_xv.c | 16 ++--- libvo/vo_yuv4mpeg.c | 22 +++---- libvo/vosub_vidix.c | 26 ++++---- libvo/x11_common.c | 6 +- loader/ldt_keeper.c | 2 +- m_config.c | 28 ++++----- m_property.c | 6 +- mencoder.c | 138 +++++++++++++++++++++--------------------- mixer.c | 6 +- mpcommon.c | 4 +- mplayer.c | 140 +++++++++++++++++++++---------------------- osdep/priority.c | 2 +- parser-mecmd.c | 8 +-- parser-mpcmd.c | 10 ++-- stream/ai_alsa.c | 26 ++++---- stream/ai_alsa1x.c | 32 +++++----- stream/ai_oss.c | 20 +++---- stream/asf_mmst_streaming.c | 52 ++++++++-------- stream/asf_streaming.c | 54 ++++++++--------- stream/audio_in.c | 12 ++-- stream/cache2.c | 2 +- stream/cdinfo.c | 6 +- stream/network.c | 34 +++++------ stream/stream.c | 2 +- stream/stream_cdda.c | 6 +- stream/stream_cddb.c | 74 +++++++++++------------ stream/stream_cue.c | 40 ++++++------- stream/stream_dvd.c | 56 ++++++++--------- stream/stream_dvdnav.c | 6 +- stream/stream_file.c | 4 +- stream/stream_live555.c | 2 +- stream/stream_radio.c | 128 +++++++++++++++++++-------------------- stream/stream_smb.c | 4 +- stream/stream_vcd.c | 6 +- stream/tcp.c | 20 +++---- stream/tv.c | 82 ++++++++++++------------- stream/tvi_bsdbt848.c | 62 +++++++++---------- stream/tvi_dshow.c | 84 +++++++++++++------------- stream/tvi_vbi.c | 6 +- stream/url.c | 22 +++---- 151 files changed, 1517 insertions(+), 1517 deletions(-) diff --git a/codec-cfg.c b/codec-cfg.c index 659108ff3a..23db052359 100644 --- a/codec-cfg.c +++ b/codec-cfg.c @@ -94,13 +94,13 @@ static int add_to_fourcc(char *s, char *alias, unsigned int *fourcc, goto err_out_parse_error; return 1; err_out_duplicated: - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_DuplicateFourcc); + mp_tmsg(MSGT_CODECCFG,MSGL_ERR,MSGTR_DuplicateFourcc); return 0; err_out_too_many: - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_TooManyFourccs); + mp_tmsg(MSGT_CODECCFG,MSGL_ERR,MSGTR_TooManyFourccs); return 0; err_out_parse_error: - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseError); + mp_tmsg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseError); return 0; } @@ -113,20 +113,20 @@ static int add_to_format(char *s, char *alias,unsigned int *fourcc, unsigned int for (i = 0; i < CODECS_MAX_FOURCC && fourcc[i] != 0xffffffff; i++) /* NOTHING */; if (i == CODECS_MAX_FOURCC) { - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_TooManyFourccs); + mp_tmsg(MSGT_CODECCFG,MSGL_ERR,MSGTR_TooManyFourccs); return 0; } fourcc[i]=strtoul(s,&endptr,0); if (*endptr != '\0') { - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseErrorFIDNotNumber); + mp_tmsg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseErrorFIDNotNumber); return 0; } if(alias){ fourccmap[i]=strtoul(alias,&endptr,0); if (*endptr != '\0') { - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseErrorFIDAliasNotNumber); + mp_tmsg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseErrorFIDAliasNotNumber); return 0; } } else @@ -134,7 +134,7 @@ static int add_to_format(char *s, char *alias,unsigned int *fourcc, unsigned int for (j = 0; j < i; j++) if (fourcc[j] == fourcc[i]) { - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_DuplicateFID); + mp_tmsg(MSGT_CODECCFG,MSGL_ERR,MSGTR_DuplicateFID); return 0; } @@ -254,10 +254,10 @@ static int add_to_inout(char *sfmt, char *sflags, unsigned int *outfmt, return 1; err_out_too_many: - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_TooManyOut); + mp_tmsg(MSGT_CODECCFG,MSGL_ERR,MSGTR_TooManyOut); return 0; err_out_parse_error: - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseError); + mp_tmsg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseError); return 0; } @@ -338,7 +338,7 @@ static int validate_codec(codecs_t *c, int type) /* NOTHING */; if (i < strlen(tmp_name)) { - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_InvalidCodecName, c->name); + mp_tmsg(MSGT_CODECCFG,MSGL_ERR,MSGTR_InvalidCodecName, c->name); return 0; } @@ -347,13 +347,13 @@ static int validate_codec(codecs_t *c, int type) #if 0 if (c->fourcc[0] == 0xffffffff) { - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecLacksFourcc, c->name); + mp_tmsg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecLacksFourcc, c->name); return 0; } #endif if (!c->drv) { - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecLacksDriver, c->name); + mp_tmsg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecLacksDriver, c->name); return 0; } @@ -362,7 +362,7 @@ static int validate_codec(codecs_t *c, int type) #warning Where are they defined ???????????? if (!c->dll && (c->driver == 4 || (c->driver == 2 && type == TYPE_VIDEO))) { - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecNeedsDLL, c->name); + mp_tmsg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecNeedsDLL, c->name); return 0; } #warning Can guid.f1 be 0? How does one know that it was not given? @@ -370,7 +370,7 @@ static int validate_codec(codecs_t *c, int type) if (type == TYPE_VIDEO) if (c->outfmt[0] == 0xffffffff) { - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecNeedsOutfmt, c->name); + mp_tmsg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecNeedsOutfmt, c->name); return 0; } #endif @@ -388,7 +388,7 @@ static int add_comment(char *s, char **d) (*d)[pos++] = '\n'; } if (!(*d = realloc(*d, pos + strlen(s) + 1))) { - mp_msg(MSGT_CODECCFG,MSGL_FATAL,MSGTR_CantAllocateComment); + mp_tmsg(MSGT_CODECCFG,MSGL_FATAL,MSGTR_CantAllocateComment); return 0; } strcpy(*d + pos, s); @@ -437,7 +437,7 @@ static int get_token(int min, int max) char c; if (max >= MAX_NR_TOKEN) { - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_GetTokenMaxNotLessThanMAX_NR_TOKEN); + mp_tmsg(MSGT_CODECCFG,MSGL_ERR,MSGTR_GetTokenMaxNotLessThanMAX_NR_TOKEN); goto out_eof; } @@ -521,15 +521,15 @@ int parse_codec_cfg(const char *cfgfile) #endif } - mp_msg(MSGT_CODECCFG,MSGL_V,MSGTR_ReadingFile, cfgfile); + mp_tmsg(MSGT_CODECCFG,MSGL_V,MSGTR_ReadingFile, cfgfile); if ((fp = fopen(cfgfile, "r")) == NULL) { - mp_msg(MSGT_CODECCFG,MSGL_V,MSGTR_CantOpenFileError, cfgfile, strerror(errno)); + mp_tmsg(MSGT_CODECCFG,MSGL_V,MSGTR_CantOpenFileError, cfgfile, strerror(errno)); return 0; } if ((line = malloc(MAX_LINE_LEN + 1)) == NULL) { - mp_msg(MSGT_CODECCFG,MSGL_FATAL,MSGTR_CantGetMemoryForLine, strerror(errno)); + mp_tmsg(MSGT_CODECCFG,MSGL_FATAL,MSGTR_CantGetMemoryForLine, strerror(errno)); return 0; } read_nextline = 1; @@ -587,7 +587,7 @@ int parse_codec_cfg(const char *cfgfile) } if (!(*codecsp = realloc(*codecsp, sizeof(codecs_t) * (*nr_codecsp + 2)))) { - mp_msg(MSGT_CODECCFG,MSGL_FATAL,MSGTR_CantReallocCodecsp, strerror(errno)); + mp_tmsg(MSGT_CODECCFG,MSGL_FATAL,MSGTR_CantReallocCodecsp, strerror(errno)); goto err_out; } codec=*codecsp + *nr_codecsp; @@ -602,19 +602,19 @@ int parse_codec_cfg(const char *cfgfile) for (i = 0; i < *nr_codecsp - 1; i++) { if(( (*codecsp)[i].name!=NULL) && (!strcmp(token[0], (*codecsp)[i].name)) ) { - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecNameNotUnique, token[0]); + mp_tmsg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecNameNotUnique, token[0]); goto err_out_print_linenum; } } if (!(codec->name = strdup(token[0]))) { - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupName, strerror(errno)); + mp_tmsg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupName, strerror(errno)); goto err_out; } } else if (!strcmp(token[0], "info")) { if (codec->info || get_token(1, 1) < 0) goto err_out_parse_error; if (!(codec->info = strdup(token[0]))) { - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupInfo, strerror(errno)); + mp_tmsg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupInfo, strerror(errno)); goto err_out; } } else if (!strcmp(token[0], "comment")) { @@ -638,14 +638,14 @@ int parse_codec_cfg(const char *cfgfile) if (get_token(1, 1) < 0) goto err_out_parse_error; if (!(codec->drv = strdup(token[0]))) { - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupDriver, strerror(errno)); + mp_tmsg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupDriver, strerror(errno)); goto err_out; } } else if (!strcmp(token[0], "dll")) { if (get_token(1, 1) < 0) goto err_out_parse_error; if (!(codec->dll = strdup(token[0]))) { - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupDLL, strerror(errno)); + mp_tmsg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupDLL, strerror(errno)); goto err_out; } } else if (!strcmp(token[0], "guid")) { @@ -714,7 +714,7 @@ int parse_codec_cfg(const char *cfgfile) } if (!validate_codec(codec, codec_type)) goto err_out_not_valid; - mp_msg(MSGT_CODECCFG,MSGL_INFO,MSGTR_AudioVideoCodecTotals, nr_acodecs, nr_vcodecs); + mp_tmsg(MSGT_CODECCFG,MSGL_INFO,MSGTR_AudioVideoCodecTotals, nr_acodecs, nr_vcodecs); if(video_codecs) video_codecs[nr_vcodecs].name = NULL; if(audio_codecs) audio_codecs[nr_acodecs].name = NULL; out: @@ -724,7 +724,7 @@ out: return 1; err_out_parse_error: - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseError); + mp_tmsg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseError); err_out_print_linenum: PRINT_LINENUM; err_out: @@ -736,10 +736,10 @@ err_out: fclose(fp); return 0; err_out_not_valid: - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecDefinitionIncorrect); + mp_tmsg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecDefinitionIncorrect); goto err_out_print_linenum; err_out_release_num: - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_OutdatedCodecsConf); + mp_tmsg(MSGT_CODECCFG,MSGL_ERR,MSGTR_OutdatedCodecsConf); goto err_out_print_linenum; } diff --git a/command.c b/command.c index 88f0a663dd..4753a7b9e7 100644 --- a/command.c +++ b/command.c @@ -442,13 +442,13 @@ static int mp_property_chapter(m_option_t *prop, int action, void *arg, } if (chapter_name) set_osd_msg(OSD_MSG_TEXT, 1, opts->osd_duration, - MSGTR_OSDChapter, chapter + 1, chapter_name); + _(MSGTR_OSDChapter), chapter + 1, chapter_name); } else if (step_all > 0) mpctx->rel_seek_secs = 1000000000.; else set_osd_msg(OSD_MSG_TEXT, 1, opts->osd_duration, - MSGTR_OSDChapter, 0, MSGTR_Unknown); + _(MSGTR_OSDChapter), 0, _(MSGTR_Unknown)); if (chapter_name) talloc_free(chapter_name); return M_PROPERTY_OK; @@ -522,7 +522,7 @@ static int mp_property_angle(m_option_t *prop, int action, void *arg, } angle = demuxer_set_angle(mpctx->demuxer, angle); set_osd_msg(OSD_MSG_TEXT, 1, opts->osd_duration, - MSGTR_OSDAngle, angle, angles); + _(MSGTR_OSDAngle), angle, angles); if (angle_name) free(angle_name); return M_PROPERTY_OK; @@ -681,7 +681,7 @@ static int mp_property_mute(m_option_t *prop, int action, void *arg, if (!arg) return M_PROPERTY_ERROR; if (mpctx->edl_muted) { - *(char **) arg = strdup(MSGTR_EnabledEdl); + *(char **) arg = strdup(_(MSGTR_EnabledEdl)); return M_PROPERTY_OK; } default: @@ -856,9 +856,9 @@ static int mp_property_audio(m_option_t *prop, int action, void *arg, return M_PROPERTY_ERROR; if (opts->audio_id < 0) - *(char **) arg = strdup(MSGTR_Disabled); + *(char **) arg = strdup(_(MSGTR_Disabled)); else { - char lang[40] = MSGTR_Unknown; + char lang[40] = _(MSGTR_Unknown); sh_audio_t* sh = mpctx->sh_audio; if (sh && sh->lang) av_strlcpy(lang, sh->lang, 40); @@ -935,9 +935,9 @@ static int mp_property_video(m_option_t *prop, int action, void *arg, return M_PROPERTY_ERROR; if (opts->video_id < 0) - *(char **) arg = strdup(MSGTR_Disabled); + *(char **) arg = strdup(_(MSGTR_Disabled)); else { - char lang[40] = MSGTR_Unknown; + char lang[40] = _(MSGTR_Unknown); *(char **) arg = malloc(64); snprintf(*(char **) arg, 64, "(%d) %s", opts->video_id, lang); } @@ -1161,9 +1161,9 @@ static int mp_property_framedropping(m_option_t *prop, int action, case M_PROPERTY_PRINT: if (!arg) return M_PROPERTY_ERROR; - *(char **) arg = strdup(frame_dropping == 1 ? MSGTR_Enabled : - (frame_dropping == 2 ? MSGTR_HardFrameDrop : - MSGTR_Disabled)); + *(char **) arg = strdup(frame_dropping == 1 ? _(MSGTR_Enabled) : + (frame_dropping == 2 ? _(MSGTR_HardFrameDrop) : + _(MSGTR_Disabled))); return M_PROPERTY_OK; default: return m_property_choice(prop, action, arg, &frame_dropping); @@ -1411,16 +1411,16 @@ static int mp_property_sub(m_option_t *prop, int action, void *arg, || mpctx->demuxer->type == DEMUXER_TYPE_OGG) && d_sub && d_sub->sh && opts->sub_id >= 0) { const char* lang = ((sh_sub_t*)d_sub->sh)->lang; - if (!lang) lang = MSGTR_Unknown; + if (!lang) lang = _(MSGTR_Unknown); snprintf(*(char **) arg, 63, "(%d) %s", opts->sub_id, lang); return M_PROPERTY_OK; } if (vo_vobsub && vobsub_id >= 0) { - const char *language = MSGTR_Unknown; + const char *language = _(MSGTR_Unknown); language = vobsub_get_id(vo_vobsub, (unsigned int) vobsub_id); snprintf(*(char **) arg, 63, "(%d) %s", - vobsub_id, language ? language : MSGTR_Unknown); + vobsub_id, language ? language : _(MSGTR_Unknown)); return M_PROPERTY_OK; } #ifdef CONFIG_DVDREAD @@ -1436,10 +1436,10 @@ static int mp_property_sub(m_option_t *prop, int action, void *arg, } #endif if (opts->sub_id >= 0) { - snprintf(*(char **) arg, 63, "(%d) %s", opts->sub_id, MSGTR_Unknown); + snprintf(*(char **) arg, 63, "(%d) %s", opts->sub_id, _(MSGTR_Unknown)); return M_PROPERTY_OK; } - snprintf(*(char **) arg, 63, MSGTR_Disabled); + snprintf(*(char **) arg, 63, _(MSGTR_Disabled)); return M_PROPERTY_OK; case M_PROPERTY_SET: @@ -1571,16 +1571,16 @@ static int mp_property_sub_source(m_option_t *prop, int action, void *arg, switch (sub_source(mpctx)) { case SUB_SOURCE_SUBS: - snprintf(*(char **) arg, 63, MSGTR_SubSourceFile); + snprintf(*(char **) arg, 63, _(MSGTR_SubSourceFile)); break; case SUB_SOURCE_VOBSUB: - snprintf(*(char **) arg, 63, MSGTR_SubSourceVobsub); + snprintf(*(char **) arg, 63, _(MSGTR_SubSourceVobsub)); break; case SUB_SOURCE_DEMUX: - snprintf(*(char **) arg, 63, MSGTR_SubSourceDemux); + snprintf(*(char **) arg, 63, _(MSGTR_SubSourceDemux)); break; default: - snprintf(*(char **) arg, 63, MSGTR_Disabled); + snprintf(*(char **) arg, 63, _(MSGTR_Disabled)); } return M_PROPERTY_OK; case M_PROPERTY_SET: @@ -1668,7 +1668,7 @@ static int mp_property_sub_by_type(m_option_t *prop, int action, void *arg, return mp_property_sub(prop, M_PROPERTY_PRINT, arg, mpctx); *(char **) arg = malloc(64); (*(char **) arg)[63] = 0; - snprintf(*(char **) arg, 63, MSGTR_Disabled); + snprintf(*(char **) arg, 63, _(MSGTR_Disabled)); return M_PROPERTY_OK; case M_PROPERTY_SET: if (!arg) @@ -1740,7 +1740,7 @@ static int mp_property_sub_delay(m_option_t *prop, int action, void *arg, static int mp_property_sub_alignment(m_option_t *prop, int action, void *arg, MPContext *mpctx) { - char *name[] = { MSGTR_Top, MSGTR_Center, MSGTR_Bottom }; + char *name[] = { _(MSGTR_Top), _(MSGTR_Center), _(MSGTR_Bottom) }; if (!mpctx->sh_video || mpctx->global_sub_pos < 0 || sub_source(mpctx) != SUB_SOURCE_SUBS) @@ -2234,51 +2234,51 @@ static struct { const char *osd_msg; } set_prop_cmd[] = { // general - { "loop", MP_CMD_LOOP, 0, 0, -1, MSGTR_LoopStatus }, + { "loop", MP_CMD_LOOP, 0, 0, -1, _(MSGTR_LoopStatus) }, { "chapter", MP_CMD_SEEK_CHAPTER, 0, -1, -1, NULL }, { "angle", MP_CMD_SWITCH_ANGLE, 0, 0, -1, NULL }, { "pause", MP_CMD_PAUSE, 0, 0, -1, NULL }, // audio - { "volume", MP_CMD_VOLUME, 0, OSD_VOLUME, -1, MSGTR_Volume }, - { "mute", MP_CMD_MUTE, 1, 0, -1, MSGTR_MuteStatus }, - { "audio_delay", MP_CMD_AUDIO_DELAY, 0, 0, -1, MSGTR_AVDelayStatus }, - { "switch_audio", MP_CMD_SWITCH_AUDIO, 1, 0, -1, MSGTR_OSDAudio }, - { "balance", MP_CMD_BALANCE, 0, OSD_BALANCE, -1, MSGTR_Balance }, + { "volume", MP_CMD_VOLUME, 0, OSD_VOLUME, -1, _(MSGTR_Volume) }, + { "mute", MP_CMD_MUTE, 1, 0, -1, _(MSGTR_MuteStatus) }, + { "audio_delay", MP_CMD_AUDIO_DELAY, 0, 0, -1, _(MSGTR_AVDelayStatus) }, + { "switch_audio", MP_CMD_SWITCH_AUDIO, 1, 0, -1, _(MSGTR_OSDAudio) }, + { "balance", MP_CMD_BALANCE, 0, OSD_BALANCE, -1, _(MSGTR_Balance) }, // video { "fullscreen", MP_CMD_VO_FULLSCREEN, 1, 0, -1, NULL }, - { "panscan", MP_CMD_PANSCAN, 0, OSD_PANSCAN, -1, MSGTR_Panscan }, - { "ontop", MP_CMD_VO_ONTOP, 1, 0, -1, MSGTR_OnTopStatus }, - { "rootwin", MP_CMD_VO_ROOTWIN, 1, 0, -1, MSGTR_RootwinStatus }, - { "border", MP_CMD_VO_BORDER, 1, 0, -1, MSGTR_BorderStatus }, - { "framedropping", MP_CMD_FRAMEDROPPING, 1, 0, -1, MSGTR_FramedroppingStatus }, - { "gamma", MP_CMD_GAMMA, 0, OSD_BRIGHTNESS, -1, MSGTR_Gamma }, - { "brightness", MP_CMD_BRIGHTNESS, 0, OSD_BRIGHTNESS, -1, MSGTR_Brightness }, - { "contrast", MP_CMD_CONTRAST, 0, OSD_CONTRAST, -1, MSGTR_Contrast }, - { "saturation", MP_CMD_SATURATION, 0, OSD_SATURATION, -1, MSGTR_Saturation }, - { "hue", MP_CMD_HUE, 0, OSD_HUE, -1, MSGTR_Hue }, - { "vsync", MP_CMD_SWITCH_VSYNC, 1, 0, -1, MSGTR_VSyncStatus }, + { "panscan", MP_CMD_PANSCAN, 0, OSD_PANSCAN, -1, _(MSGTR_Panscan) }, + { "ontop", MP_CMD_VO_ONTOP, 1, 0, -1, _(MSGTR_OnTopStatus) }, + { "rootwin", MP_CMD_VO_ROOTWIN, 1, 0, -1, _(MSGTR_RootwinStatus) }, + { "border", MP_CMD_VO_BORDER, 1, 0, -1, _(MSGTR_BorderStatus) }, + { "framedropping", MP_CMD_FRAMEDROPPING, 1, 0, -1, _(MSGTR_FramedroppingStatus) }, + { "gamma", MP_CMD_GAMMA, 0, OSD_BRIGHTNESS, -1, _(MSGTR_Gamma) }, + { "brightness", MP_CMD_BRIGHTNESS, 0, OSD_BRIGHTNESS, -1, _(MSGTR_Brightness) }, + { "contrast", MP_CMD_CONTRAST, 0, OSD_CONTRAST, -1, _(MSGTR_Contrast) }, + { "saturation", MP_CMD_SATURATION, 0, OSD_SATURATION, -1, _(MSGTR_Saturation) }, + { "hue", MP_CMD_HUE, 0, OSD_HUE, -1, _(MSGTR_Hue) }, + { "vsync", MP_CMD_SWITCH_VSYNC, 1, 0, -1, _(MSGTR_VSyncStatus) }, // subs - { "sub", MP_CMD_SUB_SELECT, 1, 0, -1, MSGTR_SubSelectStatus }, - { "sub_source", MP_CMD_SUB_SOURCE, 1, 0, -1, MSGTR_SubSourceStatus }, - { "sub_vob", MP_CMD_SUB_VOB, 1, 0, -1, MSGTR_SubSelectStatus }, - { "sub_demux", MP_CMD_SUB_DEMUX, 1, 0, -1, MSGTR_SubSelectStatus }, - { "sub_file", MP_CMD_SUB_FILE, 1, 0, -1, MSGTR_SubSelectStatus }, - { "sub_pos", MP_CMD_SUB_POS, 0, 0, -1, MSGTR_SubPosStatus }, - { "sub_alignment", MP_CMD_SUB_ALIGNMENT, 1, 0, -1, MSGTR_SubAlignStatus }, - { "sub_delay", MP_CMD_SUB_DELAY, 0, 0, OSD_MSG_SUB_DELAY, MSGTR_SubDelayStatus }, - { "sub_visibility", MP_CMD_SUB_VISIBILITY, 1, 0, -1, MSGTR_SubVisibleStatus }, - { "sub_forced_only", MP_CMD_SUB_FORCED_ONLY, 1, 0, -1, MSGTR_SubForcedOnlyStatus }, + { "sub", MP_CMD_SUB_SELECT, 1, 0, -1, _(MSGTR_SubSelectStatus) }, + { "sub_source", MP_CMD_SUB_SOURCE, 1, 0, -1, _(MSGTR_SubSourceStatus) }, + { "sub_vob", MP_CMD_SUB_VOB, 1, 0, -1, _(MSGTR_SubSelectStatus) }, + { "sub_demux", MP_CMD_SUB_DEMUX, 1, 0, -1, _(MSGTR_SubSelectStatus) }, + { "sub_file", MP_CMD_SUB_FILE, 1, 0, -1, _(MSGTR_SubSelectStatus) }, + { "sub_pos", MP_CMD_SUB_POS, 0, 0, -1, _(MSGTR_SubPosStatus) }, + { "sub_alignment", MP_CMD_SUB_ALIGNMENT, 1, 0, -1, _(MSGTR_SubAlignStatus) }, + { "sub_delay", MP_CMD_SUB_DELAY, 0, 0, OSD_MSG_SUB_DELAY, _(MSGTR_SubDelayStatus) }, + { "sub_visibility", MP_CMD_SUB_VISIBILITY, 1, 0, -1, _(MSGTR_SubVisibleStatus) }, + { "sub_forced_only", MP_CMD_SUB_FORCED_ONLY, 1, 0, -1, _(MSGTR_SubForcedOnlyStatus) }, #ifdef CONFIG_FREETYPE - { "sub_scale", MP_CMD_SUB_SCALE, 0, 0, -1, MSGTR_SubScale}, + { "sub_scale", MP_CMD_SUB_SCALE, 0, 0, -1, _(MSGTR_SubScale)}, #endif #ifdef CONFIG_ASS { "ass_use_margins", MP_CMD_ASS_USE_MARGINS, 1, 0, -1, NULL }, #endif #ifdef CONFIG_TV - { "tv_brightness", MP_CMD_TV_SET_BRIGHTNESS, 0, OSD_BRIGHTNESS, -1, MSGTR_Brightness }, - { "tv_hue", MP_CMD_TV_SET_HUE, 0, OSD_HUE, -1, MSGTR_Hue }, - { "tv_saturation", MP_CMD_TV_SET_SATURATION, 0, OSD_SATURATION, -1, MSGTR_Saturation }, - { "tv_contrast", MP_CMD_TV_SET_CONTRAST, 0, OSD_CONTRAST, -1, MSGTR_Contrast }, + { "tv_brightness", MP_CMD_TV_SET_BRIGHTNESS, 0, OSD_BRIGHTNESS, -1, _(MSGTR_Brightness) }, + { "tv_hue", MP_CMD_TV_SET_HUE, 0, OSD_HUE, -1, _(MSGTR_Hue) }, + { "tv_saturation", MP_CMD_TV_SET_SATURATION, 0, OSD_SATURATION, -1, _(MSGTR_Saturation) }, + { "tv_contrast", MP_CMD_TV_SET_CONTRAST, 0, OSD_CONTRAST, -1, _(MSGTR_Contrast) }, #endif { NULL, 0, 0, 0, -1, NULL } }; @@ -2484,13 +2484,13 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) playing_audio_pts(mpctx); if (mpctx->begin_skip == MP_NOPTS_VALUE) { mpctx->begin_skip = v; - mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_EdloutStartSkip); + mp_tmsg(MSGT_CPLAYER, MSGL_INFO, MSGTR_EdloutStartSkip); } else { if (mpctx->begin_skip > v) - mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_EdloutBadStop); + mp_tmsg(MSGT_CPLAYER, MSGL_WARN, MSGTR_EdloutBadStop); else { fprintf(edl_fd, "%f %f %d\n", mpctx->begin_skip, v, 0); - mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_EdloutEndSkip); + mp_tmsg(MSGT_CPLAYER, MSGL_INFO, MSGTR_EdloutEndSkip); } mpctx->begin_skip = MP_NOPTS_VALUE; } @@ -2511,7 +2511,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) float v = cmd->args[0].v.f; opts->playback_speed += v; build_afilter_chain(mpctx, sh_audio, &ao_data); - set_osd_msg(OSD_MSG_SPEED, 1, osd_duration, MSGTR_OSDSpeed, + set_osd_msg(OSD_MSG_SPEED, 1, osd_duration, _(MSGTR_OSDSpeed), opts->playback_speed); } break; @@ -2519,7 +2519,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) float v = cmd->args[0].v.f; opts->playback_speed *= v; build_afilter_chain(mpctx, sh_audio, &ao_data); - set_osd_msg(OSD_MSG_SPEED, 1, osd_duration, MSGTR_OSDSpeed, + set_osd_msg(OSD_MSG_SPEED, 1, osd_duration, _(MSGTR_OSDSpeed), opts->playback_speed); } break; @@ -2527,7 +2527,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) float v = cmd->args[0].v.f; opts->playback_speed = v; build_afilter_chain(mpctx, sh_audio, &ao_data); - set_osd_msg(OSD_MSG_SPEED, 1, osd_duration, MSGTR_OSDSpeed, + set_osd_msg(OSD_MSG_SPEED, 1, osd_duration, _(MSGTR_OSDSpeed), opts->playback_speed); } break; @@ -2614,7 +2614,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) sub_delay) * 1000 + .5, movement) / 1000.; #endif set_osd_msg(OSD_MSG_SUB_DELAY, 1, osd_duration, - MSGTR_OSDSubDelay, ROUND(sub_delay * 1000)); + _(MSGTR_OSDSubDelay), ROUND(sub_delay * 1000)); } break; @@ -2636,9 +2636,9 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) argument is given to the OSD command, i.e. in slave mode. */ if (v == -1 && opts->osd_level <= 1) set_osd_msg(OSD_MSG_OSD_STATUS, 0, osd_duration, - MSGTR_OSDosd, - opts->osd_level ? MSGTR_OSDenabled : - MSGTR_OSDdisabled); + _(MSGTR_OSDosd), + opts->osd_level ? _(MSGTR_OSDenabled) : + _(MSGTR_OSDdisabled)); else rm_osd_msg(OSD_MSG_OSD_STATUS); } @@ -2688,7 +2688,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) case MP_CMD_LOADLIST:{ play_tree_t *e = parse_playlist_file(mpctx->mconfig, cmd->args[0].v.s); if (!e) - mp_msg(MSGT_CPLAYER, MSGL_ERR, + mp_tmsg(MSGT_CPLAYER, MSGL_ERR, MSGTR_PlaylistLoadUnable, cmd->args[0].v.s); else { if (cmd->args[1].v.i) // append @@ -2728,7 +2728,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) RADIO_CHANNEL_LOWER); if (radio_get_channel_name(mpctx->demuxer->stream)) { set_osd_msg(OSD_MSG_RADIO_CHANNEL, 1, osd_duration, - MSGTR_OSDChannel, + _(MSGTR_OSDChannel), radio_get_channel_name(mpctx->demuxer->stream)); } } @@ -2739,7 +2739,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) radio_set_channel(mpctx->demuxer->stream, cmd->args[0].v.s); if (radio_get_channel_name(mpctx->demuxer->stream)) { set_osd_msg(OSD_MSG_RADIO_CHANNEL, 1, osd_duration, - MSGTR_OSDChannel, + _(MSGTR_OSDChannel), radio_get_channel_name(mpctx->demuxer->stream)); } } @@ -2809,7 +2809,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) } if (tv_channel_list) { set_osd_msg(OSD_MSG_TV_CHANNEL, 1, osd_duration, - MSGTR_OSDChannel, tv_channel_current->name); + _(MSGTR_OSDChannel), tv_channel_current->name); //vo_osd_changed(OSDTYPE_SUBTITLE); } } @@ -2849,7 +2849,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) cmd->args[0].v.s); if (tv_channel_list) { set_osd_msg(OSD_MSG_TV_CHANNEL, 1, osd_duration, - MSGTR_OSDChannel, tv_channel_current->name); + _(MSGTR_OSDChannel), tv_channel_current->name); //vo_osd_changed(OSDTYPE_SUBTITLE); } } @@ -2882,7 +2882,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) tv_last_channel((tvi_handle_t *) (mpctx->demuxer->priv)); if (tv_channel_list) { set_osd_msg(OSD_MSG_TV_CHANNEL, 1, osd_duration, - MSGTR_OSDChannel, tv_channel_current->name); + _(MSGTR_OSDChannel), tv_channel_current->name); //vo_osd_changed(OSDTYPE_SUBTITLE); } } @@ -2943,7 +2943,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) if (v < 0) { for (v = 0; v < mpctx->set_of_sub_size; ++v) { subd = mpctx->set_of_subtitles[v]; - mp_msg(MSGT_CPLAYER, MSGL_STATUS, + mp_tmsg(MSGT_CPLAYER, MSGL_STATUS, MSGTR_RemovedSubtitleFile, v + 1, filename_recode(subd->filename)); sub_free(subd); diff --git a/edl.c b/edl.c index 7ed58c7821..9ad50d787c 100644 --- a/edl.c +++ b/edl.c @@ -19,7 +19,7 @@ static edl_record_ptr edl_alloc_new(edl_record_ptr next_edl_record) { edl_record_ptr new_record = calloc(1, sizeof(struct edl_record)); if (!new_record) { - mp_msg(MSGT_CPLAYER, MSGL_FATAL, MSGTR_EdlOutOfMem); + mp_tmsg(MSGT_CPLAYER, MSGL_FATAL, MSGTR_EdlOutOfMem); exit(1); } @@ -78,24 +78,24 @@ edl_record_ptr edl_parse_file(void) if ((sscanf(line, "%f %f %d", &start, &stop, &action)) != 3) { - mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_EdlBadlyFormattedLine, + mp_tmsg(MSGT_CPLAYER, MSGL_WARN, MSGTR_EdlBadlyFormattedLine, lineCount); continue; } if (next_edl_record && start <= next_edl_record->stop_sec) { - mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_EdlNOValidLine, line); - mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_EdlBadLineOverlap, + mp_tmsg(MSGT_CPLAYER, MSGL_WARN, MSGTR_EdlNOValidLine, line); + mp_tmsg(MSGT_CPLAYER, MSGL_WARN, MSGTR_EdlBadLineOverlap, next_edl_record->stop_sec, start); continue; } if (stop <= start) { - mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_EdlNOValidLine, + mp_tmsg(MSGT_CPLAYER, MSGL_WARN, MSGTR_EdlNOValidLine, line); - mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_EdlBadLineBadStop); + mp_tmsg(MSGT_CPLAYER, MSGL_WARN, MSGTR_EdlBadLineBadStop); continue; } @@ -131,9 +131,9 @@ edl_record_ptr edl_parse_file(void) } if (edl_records) - mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_EdlRecordsNo, record_count); + mp_tmsg(MSGT_CPLAYER, MSGL_INFO, MSGTR_EdlRecordsNo, record_count); else - mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_EdlQueueEmpty); + mp_tmsg(MSGT_CPLAYER, MSGL_INFO, MSGTR_EdlQueueEmpty); return edl_records; } diff --git a/input/appleir.c b/input/appleir.c index 756c66047d..f0b848ceff 100644 --- a/input/appleir.c +++ b/input/appleir.c @@ -79,11 +79,11 @@ int mp_input_appleir_init (char *dev) if (dev) { - mp_msg (MSGT_INPUT, MSGL_V, MSGTR_INPUT_APPLE_IR_Init, dev); + mp_tmsg (MSGT_INPUT, MSGL_V, MSGTR_INPUT_APPLE_IR_Init, dev); fd = open (dev, O_RDONLY | O_NONBLOCK); if (fd < 0) { - mp_msg (MSGT_INPUT, MSGL_ERR, + mp_tmsg (MSGT_INPUT, MSGL_ERR, MSGTR_INPUT_APPLE_IR_CantOpen, strerror (errno)); return -1; } @@ -108,13 +108,13 @@ int mp_input_appleir_init (char *dev) id.vendor == USB_VENDOR_APPLE && (id.product == USB_DEV_APPLE_IR ||id.product == USB_DEV_APPLE_IR_2)) { - mp_msg (MSGT_INPUT, MSGL_V, MSGTR_INPUT_APPLE_IR_Detect, file); + mp_tmsg (MSGT_INPUT, MSGL_V, MSGTR_INPUT_APPLE_IR_Detect, file); return fd; } close (fd); } - mp_msg (MSGT_INPUT, MSGL_ERR, + mp_tmsg (MSGT_INPUT, MSGL_ERR, MSGTR_INPUT_APPLE_IR_CantOpen, strerror (errno)); } diff --git a/input/input.c b/input/input.c index 9296a714e5..9009293daf 100644 --- a/input/input.c +++ b/input/input.c @@ -650,7 +650,7 @@ int mp_input_add_cmd_fd(struct input_ctx *ictx, int fd, int select, mp_cmd_func_t read_func, mp_close_func_t close_func) { if (ictx->num_cmd_fd == MP_MAX_CMD_FD) { - mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrCantRegister2ManyCmdFds,fd); + mp_tmsg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrCantRegister2ManyCmdFds,fd); return 0; } if (select && fd < 0) { @@ -716,7 +716,7 @@ int mp_input_add_key_fd(struct input_ctx *ictx, int fd, int select, void *ctx) { if (ictx->num_key_fd == MP_MAX_KEY_FD) { - mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrCantRegister2ManyKeyFds,fd); + mp_tmsg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrCantRegister2ManyKeyFds,fd); return 0; } if (select && fd < 0) { @@ -829,7 +829,7 @@ mp_input_parse_cmd(char* str) { errno = 0; cmd->args[i].v.i = atoi(ptr); if(errno != 0) { - mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrArgMustBeInt,cmd_def->name,i+1); + mp_tmsg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrArgMustBeInt,cmd_def->name,i+1); ptr = NULL; } break; @@ -837,7 +837,7 @@ mp_input_parse_cmd(char* str) { errno = 0; cmd->args[i].v.f = atof(ptr); if(errno != 0) { - mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrArgMustBeFloat,cmd_def->name,i+1); + mp_tmsg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrArgMustBeFloat,cmd_def->name,i+1); ptr = NULL; } break; @@ -859,7 +859,7 @@ mp_input_parse_cmd(char* str) { } if(term != ' ' && (!e || e[0] == '\0')) { - mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrUnterminatedArg,cmd_def->name,i+1); + mp_tmsg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrUnterminatedArg,cmd_def->name,i+1); ptr = NULL; break; } else if(!e) e = ptr+strlen(ptr); @@ -877,14 +877,14 @@ mp_input_parse_cmd(char* str) { ptr = NULL; break; default : - mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrUnknownArg,i); + mp_tmsg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrUnknownArg,i); } } cmd->nargs = i; if(cmd_def->nargs > cmd->nargs) { /* mp_msg(MSGT_INPUT,MSGL_ERR,"Got command '%s' but\n",str); */ - mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_Err2FewArgs,cmd_def->name,cmd_def->nargs,cmd->nargs); + mp_tmsg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_Err2FewArgs,cmd_def->name,cmd_def->nargs,cmd->nargs); mp_cmd_free(cmd); return NULL; } @@ -924,7 +924,7 @@ static int read_cmd(mp_input_fd_t* mp_fd, char** ret) switch(r) { case MP_INPUT_ERROR: case MP_INPUT_DEAD: - mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrReadingCmdFd,mp_fd->fd,strerror(errno)); + mp_tmsg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrReadingCmdFd,mp_fd->fd,strerror(errno)); case MP_INPUT_NOTHING: return r; case MP_INPUT_RETRY: @@ -950,7 +950,7 @@ static int read_cmd(mp_input_fd_t* mp_fd, char** ret) if(!end) { // If buffer is full we must drop all until the next \n if(mp_fd->size - mp_fd->pos <= 1) { - mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrCmdBufferFullDroppingContent,mp_fd->fd); + mp_tmsg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrCmdBufferFullDroppingContent,mp_fd->fd); mp_fd->pos = 0; mp_fd->drop = 1; } @@ -1067,7 +1067,7 @@ static mp_cmd_t *get_cmd_from_keys(struct input_ctx *ictx, int n, int *keys, cmd = find_bind_for_key(def_cmd_binds,n,keys); if(cmd == NULL) { - mp_msg(MSGT_INPUT,MSGL_WARN,MSGTR_NoBindFound, get_key_name(keys[0], + mp_tmsg(MSGT_INPUT,MSGL_WARN,MSGTR_NoBindFound, get_key_name(keys[0], key_buf)); if(n > 1) { int s; @@ -1080,7 +1080,7 @@ static mp_cmd_t *get_cmd_from_keys(struct input_ctx *ictx, int n, int *keys, if (strcmp(cmd, "ignore") == 0) return NULL; ret = mp_input_parse_cmd(cmd); if(!ret) { - mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrInvalidCommandForKey, + mp_tmsg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrInvalidCommandForKey, get_key_name(ictx->key_down[0], key_buf)); if (ictx->num_key_down > 1) { unsigned int s; @@ -1109,7 +1109,7 @@ static mp_cmd_t* interpret_key(struct input_ctx *ictx, int code, int paused) if(code & MP_KEY_DOWN) { if (ictx->num_key_down > MP_MAX_KEY_DOWN) { - mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_Err2ManyKeyDowns); + mp_tmsg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_Err2ManyKeyDowns); return NULL; } code &= ~MP_KEY_DOWN; @@ -1135,7 +1135,7 @@ static mp_cmd_t* interpret_key(struct input_ctx *ictx, int code, int paused) } if (j == ictx->num_key_down) { // key was not in the down keys : add it if (ictx->num_key_down > MP_MAX_KEY_DOWN) { - mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_Err2ManyKeyDowns); + mp_tmsg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_Err2ManyKeyDowns); return NULL; } ictx->key_down[ictx->num_key_down] = code; @@ -1239,7 +1239,7 @@ static mp_cmd_t *read_events(struct input_ctx *ictx, int time, int paused) time_val = NULL; if (select(max_fd + 1, &fds, NULL, NULL, time_val) < 0) { if (errno != EINTR) - mp_msg(MSGT_INPUT, MSGL_ERR, MSGTR_INPUT_INPUT_ErrSelect, + mp_tmsg(MSGT_INPUT, MSGL_ERR, MSGTR_INPUT_INPUT_ErrSelect, strerror(errno)); FD_ZERO(&fds); } @@ -1264,10 +1264,10 @@ static mp_cmd_t *read_events(struct input_ctx *ictx, int time, int paused) return ret; } else if (code == MP_INPUT_ERROR) - mp_msg(MSGT_INPUT, MSGL_ERR, MSGTR_INPUT_INPUT_ErrOnKeyInFd, + mp_tmsg(MSGT_INPUT, MSGL_ERR, MSGTR_INPUT_INPUT_ErrOnKeyInFd, key_fds[i].fd); else if (code == MP_INPUT_DEAD) { - mp_msg(MSGT_INPUT, MSGL_ERR, MSGTR_INPUT_INPUT_ErrDeadKeyOnFd, + mp_tmsg(MSGT_INPUT, MSGL_ERR, MSGTR_INPUT_INPUT_ErrDeadKeyOnFd, key_fds[i].fd); key_fds[i].dead = 1; } @@ -1291,7 +1291,7 @@ static mp_cmd_t *read_events(struct input_ctx *ictx, int time, int paused) return ret; } else if (r == MP_INPUT_ERROR) - mp_msg(MSGT_INPUT, MSGL_ERR, MSGTR_INPUT_INPUT_ErrOnCmdFd, + mp_tmsg(MSGT_INPUT, MSGL_ERR, MSGTR_INPUT_INPUT_ErrOnCmdFd, cmd_fds[i].fd); else if (r == MP_INPUT_DEAD) cmd_fds[i].dead = 1; @@ -1538,7 +1538,7 @@ static int parse_config(struct input_ctx *ictx, char *file) if(r < 0) { if(errno == EINTR) continue; - mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrReadingInputConfig,file,strerror(errno)); + mp_tmsg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrReadingInputConfig,file,strerror(errno)); close(fd); return 0; } else if(r == 0) { @@ -1591,9 +1591,9 @@ static int parse_config(struct input_ctx *ictx, char *file) if(end[0] == '\0') { // Key name doesn't fit in the buffer if(buffer == iter) { if(eof && (buffer-iter) == bs) - mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrUnfinishedBinding,iter); + mp_tmsg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrUnfinishedBinding,iter); else - mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrBuffer2SmallForKeyName,iter); + mp_tmsg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrBuffer2SmallForKeyName,iter); return 0; } memmove(buffer,iter,end-iter); @@ -1605,7 +1605,7 @@ static int parse_config(struct input_ctx *ictx, char *file) strncpy(name,iter,end-iter); name[end-iter] = '\0'; if (!get_input_from_name(name,keys)) { - mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrUnknownKey,name); + mp_tmsg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrUnknownKey,name); close(fd); return 0; } @@ -1620,10 +1620,10 @@ static int parse_config(struct input_ctx *ictx, char *file) if(iter[0] == '\n' || iter[0] == '\r') { int i; char key_buf[12]; - mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrNoCmdForKey, get_key_name(keys[0], key_buf)); + mp_tmsg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrNoCmdForKey, get_key_name(keys[0], key_buf)); for(i = 1; keys[i] != 0 ; i++) mp_msg(MSGT_INPUT,MSGL_ERR,"-%s", get_key_name(keys[i], key_buf)); - mp_msg(MSGT_INPUT,MSGL_ERR,"\n"); + mp_msg(MSGT_INPUT,MSGL_ERR,"\n"); keys[0] = 0; if(iter > buffer) { memmove(buffer,iter,bs- (iter-buffer)); @@ -1635,7 +1635,7 @@ static int parse_config(struct input_ctx *ictx, char *file) /* NOTHING */; if(end[0] == '\0' && ! (eof && ((end+1) - buffer) == bs)) { if(iter == buffer) { - mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrBuffer2SmallForCmd,buffer); + mp_tmsg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrBuffer2SmallForCmd,buffer); close(fd); return 0; } @@ -1660,7 +1660,7 @@ static int parse_config(struct input_ctx *ictx, char *file) continue; } } - mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrWhyHere); + mp_tmsg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrWhyHere); close(fd); mp_input_set_section(ictx, NULL); return 0; @@ -1736,7 +1736,7 @@ struct input_ctx *mp_input_init(struct input_conf *input_conf, int use_gui) if (input_conf->use_joystick) { int fd = mp_input_joystick_init(input_conf->js_dev); if(fd < 0) - mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrCantInitJoystick); + mp_tmsg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrCantInitJoystick); else mp_input_add_key_fd(ictx, fd, 1, mp_input_joystick_read, (mp_close_func_t)close,NULL); @@ -1763,7 +1763,7 @@ struct input_ctx *mp_input_init(struct input_conf *input_conf, int use_gui) #ifdef CONFIG_APPLE_REMOTE if (input_conf->use_ar) { if(mp_input_ar_init() < 0) - mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrCantInitAppleRemote); + mp_tmsg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrCantInitAppleRemote); else mp_input_add_key_fd(ictx, -1, 0, mp_input_ar_read, mp_input_ar_close, NULL); @@ -1774,7 +1774,7 @@ struct input_ctx *mp_input_init(struct input_conf *input_conf, int use_gui) if (input_conf->use_ar) { int fd = mp_input_appleir_init(input_conf->ar_dev); if(fd < 0) - mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrCantInitAppleRemote); + mp_tmsg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrCantInitAppleRemote); else mp_input_add_key_fd(ictx, fd, 1, mp_input_appleir_read, (mp_close_func_t)close, NULL); @@ -1784,7 +1784,7 @@ struct input_ctx *mp_input_init(struct input_conf *input_conf, int use_gui) if (input_conf->in_file) { struct stat st; if (stat(input_conf->in_file, &st)) - mp_msg(MSGT_INPUT, MSGL_ERR, MSGTR_INPUT_INPUT_ErrCantStatFile, input_conf->in_file, strerror(errno)); + mp_tmsg(MSGT_INPUT, MSGL_ERR, MSGTR_INPUT_INPUT_ErrCantStatFile, input_conf->in_file, strerror(errno)); else { int in_file_fd = open(input_conf->in_file, S_ISFIFO(st.st_mode) ? O_RDWR : O_RDONLY); @@ -1792,7 +1792,7 @@ struct input_ctx *mp_input_init(struct input_conf *input_conf, int use_gui) mp_input_add_cmd_fd(ictx, in_file_fd, 1, NULL, (mp_close_func_t)close); else - mp_msg(MSGT_INPUT, MSGL_ERR, MSGTR_INPUT_INPUT_ErrCantOpenFile, + mp_tmsg(MSGT_INPUT, MSGL_ERR, MSGTR_INPUT_INPUT_ErrCantOpenFile, input_conf->in_file, strerror(errno)); } } diff --git a/input/joystick.c b/input/joystick.c index b49214c95c..c2a1e91de1 100644 --- a/input/joystick.c +++ b/input/joystick.c @@ -51,11 +51,11 @@ int mp_input_joystick_init(char* dev) { int initialized = 0; struct js_event ev; - mp_msg(MSGT_INPUT,MSGL_V,MSGTR_INPUT_JOYSTICK_Opening,dev ? dev : JS_DEV); + mp_tmsg(MSGT_INPUT,MSGL_V,MSGTR_INPUT_JOYSTICK_Opening,dev ? dev : JS_DEV); fd = open( dev ? dev : JS_DEV , O_RDONLY | O_NONBLOCK ); if(fd < 0) { - mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_JOYSTICK_CantOpen,dev ? dev : JS_DEV,strerror(errno)); + mp_tmsg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_JOYSTICK_CantOpen,dev ? dev : JS_DEV,strerror(errno)); return -1; } @@ -70,7 +70,7 @@ int mp_input_joystick_init(char* dev) { initialized = 1; break; } - mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_JOYSTICK_ErrReading,strerror(errno)); + mp_tmsg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_JOYSTICK_ErrReading,strerror(errno)); close(fd); return -1; } @@ -78,7 +78,7 @@ int mp_input_joystick_init(char* dev) { } if((unsigned int)l < sizeof(struct js_event)) { if(l > 0) - mp_msg(MSGT_INPUT,MSGL_WARN,MSGTR_INPUT_JOYSTICK_LoosingBytes,l); + mp_tmsg(MSGT_INPUT,MSGL_WARN,MSGTR_INPUT_JOYSTICK_LoosingBytes,l); break; } if(ev.type == JS_EVENT_BUTTON) @@ -102,9 +102,9 @@ int mp_input_joystick_read(void *ctx, int fd) { else if(errno == EAGAIN) return MP_INPUT_NOTHING; if( r < 0) - mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_JOYSTICK_ErrReading,strerror(errno)); + mp_tmsg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_JOYSTICK_ErrReading,strerror(errno)); else - mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_JOYSTICK_ErrReading,"EOF"); + mp_tmsg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_JOYSTICK_ErrReading,"EOF"); return MP_INPUT_DEAD; } l += r; @@ -112,12 +112,12 @@ int mp_input_joystick_read(void *ctx, int fd) { if((unsigned int)l < sizeof(struct js_event)) { if(l > 0) - mp_msg(MSGT_INPUT,MSGL_WARN,MSGTR_INPUT_JOYSTICK_LoosingBytes,l); + mp_tmsg(MSGT_INPUT,MSGL_WARN,MSGTR_INPUT_JOYSTICK_LoosingBytes,l); return MP_INPUT_NOTHING; } if(ev.type & JS_EVENT_INIT) { - mp_msg(MSGT_INPUT,MSGL_WARN,MSGTR_INPUT_JOYSTICK_WarnLostSync); + mp_tmsg(MSGT_INPUT,MSGL_WARN,MSGTR_INPUT_JOYSTICK_WarnLostSync); ev.type &= ~JS_EVENT_INIT; if(ev.type == JS_EVENT_BUTTON) { int s = (btns >> ev.number) & 1; @@ -154,7 +154,7 @@ int mp_input_joystick_read(void *ctx, int fd) { } else return MP_INPUT_NOTHING; } else { - mp_msg(MSGT_INPUT,MSGL_WARN,MSGTR_INPUT_JOYSTICK_WarnUnknownEvent,ev.type); + mp_tmsg(MSGT_INPUT,MSGL_WARN,MSGTR_INPUT_JOYSTICK_WarnUnknownEvent,ev.type); return MP_INPUT_ERROR; } diff --git a/input/lirc.c b/input/lirc.c index 4e60f01182..3af77d536f 100644 --- a/input/lirc.c +++ b/input/lirc.c @@ -40,9 +40,9 @@ mp_input_lirc_init(void) { int lirc_sock; int mode; - mp_msg(MSGT_LIRC,MSGL_V,MSGTR_SettingUpLIRC); + mp_tmsg(MSGT_LIRC,MSGL_V,MSGTR_SettingUpLIRC); if((lirc_sock=lirc_init("mplayer",1))==-1){ - mp_msg(MSGT_LIRC,MSGL_ERR,MSGTR_LIRCopenfailed); + mp_tmsg(MSGT_LIRC,MSGL_ERR,MSGTR_LIRCopenfailed); return -1; } @@ -55,7 +55,7 @@ mp_input_lirc_init(void) { } if(lirc_readconfig( lirc_configfile,&lirc_config,NULL )!=0 ){ - mp_msg(MSGT_LIRC,MSGL_ERR,MSGTR_LIRCcfgerr, + mp_tmsg(MSGT_LIRC,MSGL_ERR,MSGTR_LIRCcfgerr, lirc_configfile == NULL ? "~/.lircrc" : lirc_configfile); lirc_deinit(); return -1; diff --git a/libaf/af_ladspa.c b/libaf/af_ladspa.c index 34cf0a6d19..5d43784c21 100644 --- a/libaf/af_ladspa.c +++ b/libaf/af_ladspa.c @@ -213,7 +213,7 @@ static int af_ladspa_parse_plugin(af_ladspa_t *setup) { if (setup->ninputs == 0) { mp_msg(MSGT_AFILTER, MSGL_WARN, "%s: %s\n", setup->myname, - MSGTR_AF_LADSPA_WarnNoInputs); + _(MSGTR_AF_LADSPA_WarnNoInputs)); } else if (setup->ninputs == 1) { mp_msg(MSGT_AFILTER, MSGL_V, "%s: this is a mono effect\n", setup->myname); } else if (setup->ninputs == 2) { @@ -225,13 +225,13 @@ static int af_ladspa_parse_plugin(af_ladspa_t *setup) { if (setup->noutputs == 0) { mp_msg(MSGT_AFILTER, MSGL_ERR, "%s: %s\n", setup->myname, - MSGTR_AF_LADSPA_ErrNoOutputs); + _(MSGTR_AF_LADSPA_ErrNoOutputs)); return AF_ERROR; } if (setup->noutputs != setup->ninputs ) { mp_msg(MSGT_AFILTER, MSGL_ERR, "%s: %s\n", setup->myname, - MSGTR_AF_LADSPA_ErrInOutDiff); + _(MSGTR_AF_LADSPA_ErrInOutDiff)); return AF_ERROR; } @@ -391,7 +391,7 @@ static int af_ladspa_load_plugin(af_ladspa_t *setup) { if (!setup->libhandle) { mp_msg(MSGT_AFILTER, MSGL_ERR, "%s: %s %s\n\t%s\n", setup->myname, - MSGTR_AF_LADSPA_ErrFailedToLoad, setup->file, dlerror() ); + _(MSGTR_AF_LADSPA_ErrFailedToLoad), setup->file, dlerror() ); return AF_ERROR; } @@ -404,7 +404,7 @@ static int af_ladspa_load_plugin(af_ladspa_t *setup) { if (!descriptor_function) { mp_msg(MSGT_AFILTER, MSGL_ERR, "%s: %s\n\t%s\n", setup->myname, - MSGTR_AF_LADSPA_ErrNoDescriptor, dlerror()); + _(MSGTR_AF_LADSPA_ErrNoDescriptor), dlerror()); return AF_ERROR; } @@ -412,7 +412,7 @@ static int af_ladspa_load_plugin(af_ladspa_t *setup) { if (strcmp(setup->label, "help") == 0) { mp_msg(MSGT_AFILTER, MSGL_INFO, "%s: %s %s:\n", setup->myname, - MSGTR_AF_LADSPA_AvailableLabels, setup->file); + _(MSGTR_AF_LADSPA_AvailableLabels), setup->file); for (i=0; ; i++) { ladspa_descriptor = descriptor_function(i); if (ladspa_descriptor == NULL) { @@ -432,7 +432,7 @@ static int af_ladspa_load_plugin(af_ladspa_t *setup) { ladspa_descriptor = descriptor_function(i); if (ladspa_descriptor == NULL) { mp_msg(MSGT_AFILTER, MSGL_ERR, "%s: %s\n", setup->myname, - MSGTR_AF_LADSPA_ErrLabelNotFound); + _(MSGTR_AF_LADSPA_ErrLabelNotFound)); return AF_ERROR; } if (strcmp(ladspa_descriptor->Label, setup->label) == 0) { @@ -520,7 +520,7 @@ static int control(struct af_instance_s *af, int cmd, void *arg) { if (!arg) { mp_msg(MSGT_AFILTER, MSGL_ERR, "%s: %s\n", setup->myname, - MSGTR_AF_LADSPA_ErrNoSuboptions); + _(MSGTR_AF_LADSPA_ErrNoSuboptions)); return AF_ERROR; } @@ -532,7 +532,7 @@ static int control(struct af_instance_s *af, int cmd, void *arg) { sscanf(arg, "%[^:]", buf); if (buf[0] == '\0') { mp_msg(MSGT_AFILTER, MSGL_ERR, "%s: %s\n", setup->myname, - MSGTR_AF_LADSPA_ErrNoLibFile); + _(MSGTR_AF_LADSPA_ErrNoLibFile)); free(buf); return AF_ERROR; } @@ -548,7 +548,7 @@ static int control(struct af_instance_s *af, int cmd, void *arg) { sscanf(arg, "%[^:]", buf); if (buf[0] == '\0') { mp_msg(MSGT_AFILTER, MSGL_ERR, "%s: %s\n", setup->myname, - MSGTR_AF_LADSPA_ErrNoLabel); + _(MSGTR_AF_LADSPA_ErrNoLabel)); free(buf); return AF_ERROR; } @@ -584,14 +584,14 @@ static int control(struct af_instance_s *af, int cmd, void *arg) { for(i=0; ininputcontrols; i++) { if (!arg || (*(char*)arg != ':') ) { mp_msg(MSGT_AFILTER, MSGL_ERR, "%s: %s\n", setup->myname, - MSGTR_AF_LADSPA_ErrNotEnoughControls); + _(MSGTR_AF_LADSPA_ErrNotEnoughControls)); return AF_ERROR; } arg++; r = sscanf(arg, "%f", &val); if (r!=1) { mp_msg(MSGT_AFILTER, MSGL_ERR, "%s: %s\n", setup->myname, - MSGTR_AF_LADSPA_ErrNotEnoughControls); + _(MSGTR_AF_LADSPA_ErrNotEnoughControls)); return AF_ERROR; } setup->inputcontrols[setup->inputcontrolsmap[i]] = val; @@ -617,13 +617,13 @@ static int control(struct af_instance_s *af, int cmd, void *arg) { if (LADSPA_IS_HINT_BOUNDED_BELOW(hint.HintDescriptor) && val < hint.LowerBound) { - mp_msg(MSGT_AFILTER, MSGL_ERR, MSGTR_AF_LADSPA_ErrControlBelow, + mp_tmsg(MSGT_AFILTER, MSGL_ERR, MSGTR_AF_LADSPA_ErrControlBelow, setup->myname, i, hint.LowerBound); return AF_ERROR; } if (LADSPA_IS_HINT_BOUNDED_ABOVE(hint.HintDescriptor) && val > hint.UpperBound) { - mp_msg(MSGT_AFILTER, MSGL_ERR, MSGTR_AF_LADSPA_ErrControlAbove, + mp_tmsg(MSGT_AFILTER, MSGL_ERR, MSGTR_AF_LADSPA_ErrControlAbove, setup->myname, i, hint.UpperBound); return AF_ERROR; } diff --git a/libaf/af_lavcac3enc.c b/libaf/af_lavcac3enc.c index 36a19dad60..dde841c9a1 100644 --- a/libaf/af_lavcac3enc.c +++ b/libaf/af_lavcac3enc.c @@ -98,7 +98,7 @@ static int control(struct af_instance_s *af, int cmd, void *arg) s->lavc_actx->bit_rate = bit_rate; if(avcodec_open(s->lavc_actx, s->lavc_acodec) < 0) { - mp_msg(MSGT_AFILTER, MSGL_ERR, MSGTR_CouldntOpenCodec, "ac3", bit_rate); + mp_tmsg(MSGT_AFILTER, MSGL_ERR, MSGTR_CouldntOpenCodec, "ac3", bit_rate); return AF_ERROR; } } @@ -295,13 +295,13 @@ static int af_open(af_instance_t* af){ s->lavc_acodec = avcodec_find_encoder_by_name("ac3"); if (!s->lavc_acodec) { - mp_msg(MSGT_AFILTER, MSGL_ERR, MSGTR_LavcAudioCodecNotFound, "ac3"); + mp_tmsg(MSGT_AFILTER, MSGL_ERR, MSGTR_LavcAudioCodecNotFound, "ac3"); return AF_ERROR; } s->lavc_actx = avcodec_alloc_context(); if (!s->lavc_actx) { - mp_msg(MSGT_AFILTER, MSGL_ERR, MSGTR_CouldntAllocateLavcContext); + mp_tmsg(MSGT_AFILTER, MSGL_ERR, MSGTR_CouldntAllocateLavcContext); return AF_ERROR; } diff --git a/libaf/af_scaletempo.c b/libaf/af_scaletempo.c index 8b39290efa..2d420784c6 100644 --- a/libaf/af_scaletempo.c +++ b/libaf/af_scaletempo.c @@ -470,26 +470,26 @@ static int control(struct af_instance_s* af, int cmd, void* arg) return AF_ERROR; } if (s->scale_nominal <= 0) { - mp_msg(MSGT_AFILTER, MSGL_ERR, "[scaletempo] " - MSGTR_ErrorParsingCommandLine ": " MSGTR_AF_ValueOutOfRange + mp_tmsg(MSGT_AFILTER, MSGL_ERR, "[scaletempo] " + _(MSGTR_ErrorParsingCommandLine) ": " _(MSGTR_AF_ValueOutOfRange) ": scale > 0\n"); return AF_ERROR; } if (s->ms_stride <= 0) { - mp_msg(MSGT_AFILTER, MSGL_ERR, "[scaletempo] " - MSGTR_ErrorParsingCommandLine ": " MSGTR_AF_ValueOutOfRange + mp_tmsg(MSGT_AFILTER, MSGL_ERR, "[scaletempo] " + _(MSGTR_ErrorParsingCommandLine) ": " _(MSGTR_AF_ValueOutOfRange) ": stride > 0\n"); return AF_ERROR; } if (s->percent_overlap < 0 || s->percent_overlap > 1) { - mp_msg(MSGT_AFILTER, MSGL_ERR, "[scaletempo] " - MSGTR_ErrorParsingCommandLine ": " MSGTR_AF_ValueOutOfRange + mp_tmsg(MSGT_AFILTER, MSGL_ERR, "[scaletempo] " + _(MSGTR_ErrorParsingCommandLine) ": " _(MSGTR_AF_ValueOutOfRange) ": 0 <= overlap <= 1\n"); return AF_ERROR; } if (s->ms_search < 0) { - mp_msg(MSGT_AFILTER, MSGL_ERR, "[scaletempo] " - MSGTR_ErrorParsingCommandLine ": " MSGTR_AF_ValueOutOfRange + mp_tmsg(MSGT_AFILTER, MSGL_ERR, "[scaletempo] " + _(MSGTR_ErrorParsingCommandLine) ": " _(MSGTR_AF_ValueOutOfRange) ": search >= 0\n"); return AF_ERROR; } @@ -507,8 +507,8 @@ static int control(struct af_instance_s* af, int cmd, void* arg) s->speed_tempo = 1; s->speed_pitch = 1; } else { - mp_msg(MSGT_AFILTER, MSGL_ERR, "[scaletempo] " - MSGTR_ErrorParsingCommandLine ": " MSGTR_AF_ValueOutOfRange + mp_tmsg(MSGT_AFILTER, MSGL_ERR, "[scaletempo] " + _(MSGTR_ErrorParsingCommandLine) ": " _(MSGTR_AF_ValueOutOfRange) ": speed=[pitch|tempo|none|both]\n"); return AF_ERROR; } diff --git a/libaf/format.c b/libaf/format.c index e681cc2050..4f53f10159 100644 --- a/libaf/format.c +++ b/libaf/format.c @@ -123,7 +123,7 @@ char* af_fmt2str(int format, char* str, int size) case(AF_FORMAT_IMA_ADPCM): i+=snprintf(&str[i],size-i,"IMA-ADPCM "); break; default: - i+=snprintf(&str[i],size-i,MSGTR_AF_FORMAT_UnknownFormat); + i+=snprintf(&str[i],size-i,mp_gtext(MSGTR_AF_FORMAT_UnknownFormat)); } } else{ diff --git a/libao2/ao_alsa.c b/libao2/ao_alsa.c index 9541f9c553..cc92754051 100644 --- a/libao2/ao_alsa.c +++ b/libao2/ao_alsa.c @@ -147,7 +147,7 @@ static int control(int cmd, void *arg) mix_index = strtol(test_mix_index, &test_mix_index, 0); if (*test_mix_index){ - mp_msg(MSGT_AO,MSGL_ERR, + mp_tmsg(MSGT_AO,MSGL_ERR, MSGTR_AO_ALSA_InvalidMixerIndexDefaultingToZero); mix_index = 0 ; } @@ -168,32 +168,32 @@ static int control(int cmd, void *arg) } if ((err = snd_mixer_open(&handle, 0)) < 0) { - mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_MixerOpenError, snd_strerror(err)); + mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_MixerOpenError, snd_strerror(err)); return CONTROL_ERROR; } if ((err = snd_mixer_attach(handle, card)) < 0) { - mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_MixerAttachError, + mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_MixerAttachError, card, snd_strerror(err)); snd_mixer_close(handle); return CONTROL_ERROR; } if ((err = snd_mixer_selem_register(handle, NULL, NULL)) < 0) { - mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_MixerRegisterError, snd_strerror(err)); + mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_MixerRegisterError, snd_strerror(err)); snd_mixer_close(handle); return CONTROL_ERROR; } err = snd_mixer_load(handle); if (err < 0) { - mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_MixerLoadError, snd_strerror(err)); + mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_MixerLoadError, snd_strerror(err)); snd_mixer_close(handle); return CONTROL_ERROR; } elem = snd_mixer_find_selem(handle, sid); if (!elem) { - mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToFindSimpleControl, + mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToFindSimpleControl, snd_mixer_selem_id_get_name(sid), snd_mixer_selem_id_get_index(sid)); snd_mixer_close(handle); return CONTROL_ERROR; @@ -208,7 +208,7 @@ static int control(int cmd, void *arg) //setting channels if ((err = snd_mixer_selem_set_playback_volume(elem, SND_MIXER_SCHN_FRONT_LEFT, set_vol)) < 0) { - mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_ErrorSettingLeftChannel, + mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_ErrorSettingLeftChannel, snd_strerror(err)); return CONTROL_ERROR; } @@ -217,7 +217,7 @@ static int control(int cmd, void *arg) set_vol = vol->right / f_multi + pmin + 0.5; if ((err = snd_mixer_selem_set_playback_volume(elem, SND_MIXER_SCHN_FRONT_RIGHT, set_vol)) < 0) { - mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_ErrorSettingRightChannel, + mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_ErrorSettingRightChannel, snd_strerror(err)); return CONTROL_ERROR; } @@ -264,7 +264,7 @@ static void parse_device (char *dest, const char *src, int len) static void print_help (void) { - mp_msg (MSGT_AO, MSGL_FATAL, + mp_tmsg (MSGT_AO, MSGL_FATAL, MSGTR_AO_ALSA_CommandlineHelp); } @@ -453,7 +453,7 @@ static int init(int rate_hz, int channels, int format, int flags) break; default: device.str = "default"; - mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_ChannelsNotSupported,channels); + mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_ChannelsNotSupported,channels); } device.len = strlen(device.str); if (subopt_parse(ao_subdevice, subopts) != 0) { @@ -513,19 +513,19 @@ static int init(int rate_hz, int channels, int format, int flags) if ((err = try_open_device(alsa_device, open_mode, format == AF_FORMAT_AC3)) < 0) { if (err != -EBUSY && ao_noblock) { - mp_msg(MSGT_AO,MSGL_INFO,MSGTR_AO_ALSA_OpenInNonblockModeFailed); + mp_tmsg(MSGT_AO,MSGL_INFO,MSGTR_AO_ALSA_OpenInNonblockModeFailed); if ((err = try_open_device(alsa_device, 0, format == AF_FORMAT_AC3)) < 0) { - mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_PlaybackOpenError, snd_strerror(err)); + mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_PlaybackOpenError, snd_strerror(err)); return 0; } } else { - mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_PlaybackOpenError, snd_strerror(err)); + mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_PlaybackOpenError, snd_strerror(err)); return 0; } } if ((err = snd_pcm_nonblock(alsa_handler, 0)) < 0) { - mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_ErrorSetBlockMode, snd_strerror(err)); + mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_ErrorSetBlockMode, snd_strerror(err)); } else { mp_msg(MSGT_AO,MSGL_V,"alsa-init: pcm opened in blocking mode\n"); } @@ -536,7 +536,7 @@ static int init(int rate_hz, int channels, int format, int flags) // setting hw-parameters if ((err = snd_pcm_hw_params_any(alsa_handler, alsa_hwparams)) < 0) { - mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToGetInitialParameters, + mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToGetInitialParameters, snd_strerror(err)); return 0; } @@ -544,7 +544,7 @@ static int init(int rate_hz, int channels, int format, int flags) err = snd_pcm_hw_params_set_access(alsa_handler, alsa_hwparams, SND_PCM_ACCESS_RW_INTERLEAVED); if (err < 0) { - mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToSetAccessType, + mp_tmsg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToSetAccessType, snd_strerror(err)); return 0; } @@ -554,7 +554,7 @@ static int init(int rate_hz, int channels, int format, int flags) if ((err = snd_