0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

Translatable messages moved to help_mp-en.h.

patch by The Wanderer <inverseparadox at comcast dot net>


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13620 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
diego 2004-10-12 11:29:21 +00:00
parent b76c43dd93
commit 1013ecd44b
2 changed files with 59 additions and 29 deletions

View File

@ -26,6 +26,8 @@
#include "config.h" #include "config.h"
#include "mp_msg.h" #include "mp_msg.h"
#include "help_mp.h"
// for mmioFOURCC: // for mmioFOURCC:
#include "libmpdemux/aviheader.h" #include "libmpdemux/aviheader.h"
@ -80,13 +82,13 @@ static int add_to_fourcc(char *s, char *alias, unsigned int *fourcc,
goto err_out_parse_error; goto err_out_parse_error;
return 1; return 1;
err_out_duplicated: err_out_duplicated:
mp_msg(MSGT_CODECCFG,MSGL_ERR,"duplicated FourCC"); mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_DuplicateFourcc);
return 0; return 0;
err_out_too_many: err_out_too_many:
mp_msg(MSGT_CODECCFG,MSGL_ERR,"too many FourCCs/formats..."); mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_TooManyFourccs);
return 0; return 0;
err_out_parse_error: err_out_parse_error:
mp_msg(MSGT_CODECCFG,MSGL_ERR,"parse error"); mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseError);
return 0; return 0;
} }
@ -99,20 +101,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++) for (i = 0; i < CODECS_MAX_FOURCC && fourcc[i] != 0xffffffff; i++)
/* NOTHING */; /* NOTHING */;
if (i == CODECS_MAX_FOURCC) { if (i == CODECS_MAX_FOURCC) {
mp_msg(MSGT_CODECCFG,MSGL_ERR,"too many FourCCs/formats..."); mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_TooManyFourccs);
return 0; return 0;
} }
fourcc[i]=strtoul(s,&endptr,0); fourcc[i]=strtoul(s,&endptr,0);
if (*endptr != '\0') { if (*endptr != '\0') {
mp_msg(MSGT_CODECCFG,MSGL_ERR,"parse error (format ID not a number?)"); mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseErrorFIDNotNumber);
return 0; return 0;
} }
if(alias){ if(alias){
fourccmap[i]=strtoul(alias,&endptr,0); fourccmap[i]=strtoul(alias,&endptr,0);
if (*endptr != '\0') { if (*endptr != '\0') {
mp_msg(MSGT_CODECCFG,MSGL_ERR,"parse error (format ID alias not a number?)"); mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseErrorFIDAliasNotNumber);
return 0; return 0;
} }
} else } else
@ -120,7 +122,7 @@ static int add_to_format(char *s, char *alias,unsigned int *fourcc, unsigned int
for (j = 0; j < i; j++) for (j = 0; j < i; j++)
if (fourcc[j] == fourcc[i]) { if (fourcc[j] == fourcc[i]) {
mp_msg(MSGT_CODECCFG,MSGL_ERR,"duplicated format ID"); mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_DuplicateFID);
return 0; return 0;
} }
@ -232,10 +234,10 @@ static int add_to_inout(char *sfmt, char *sflags, unsigned int *outfmt,
return 1; return 1;
err_out_too_many: err_out_too_many:
mp_msg(MSGT_CODECCFG,MSGL_ERR,"too many out..."); mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_TooManyOut);
return 0; return 0;
err_out_parse_error: err_out_parse_error:
mp_msg(MSGT_CODECCFG,MSGL_ERR,"parse error"); mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseError);
return 0; return 0;
} }
@ -318,7 +320,7 @@ static int validate_codec(codecs_t *c, int type)
/* NOTHING */; /* NOTHING */;
if (i < strlen(tmp_name)) { if (i < strlen(tmp_name)) {
mp_msg(MSGT_CODECCFG,MSGL_ERR,"\ncodec(%s) name is not valid!\n", c->name); mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_InvalidCodecName, c->name);
return 0; return 0;
} }
@ -327,13 +329,13 @@ static int validate_codec(codecs_t *c, int type)
#if 0 #if 0
if (c->fourcc[0] == 0xffffffff) { if (c->fourcc[0] == 0xffffffff) {
mp_msg(MSGT_CODECCFG,MSGL_ERR,"\ncodec(%s) does not have FourCC/format!\n", c->name); mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecLacksFourcc, c->name);
return 0; return 0;
} }
/* XXX fix this: shitty with 'null' codec */ /* XXX fix this: shitty with 'null' codec */
if (!c->driver) { if (!c->driver) {
mp_msg(MSGT_CODECCFG,MSGL_ERR,"\ncodec(%s) does not have a driver!\n", c->name); mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecLacksDriver, c->name);
return 0; return 0;
} }
#endif #endif
@ -343,7 +345,7 @@ static int validate_codec(codecs_t *c, int type)
#warning HOL VANNAK DEFINIALVA???????????? #warning HOL VANNAK DEFINIALVA????????????
if (!c->dll && (c->driver == 4 || if (!c->dll && (c->driver == 4 ||
(c->driver == 2 && type == TYPE_VIDEO))) { (c->driver == 2 && type == TYPE_VIDEO))) {
mp_msg(MSGT_CODECCFG,MSGL_ERR,"\ncodec(%s) needs a 'dll'!\n", c->name); mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecNeedsDLL, c->name);
return 0; return 0;
} }
#warning guid.f1 lehet 0? honnan lehet tudni, hogy nem adtak meg? #warning guid.f1 lehet 0? honnan lehet tudni, hogy nem adtak meg?
@ -351,7 +353,7 @@ static int validate_codec(codecs_t *c, int type)
if (type == TYPE_VIDEO) if (type == TYPE_VIDEO)
if (c->outfmt[0] == 0xffffffff) { if (c->outfmt[0] == 0xffffffff) {
mp_msg(MSGT_CODECCFG,MSGL_ERR,"\ncodec(%s) needs an 'outfmt'!\n", c->name); mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecNeedsOutfmt, c->name);
return 0; return 0;
} }
#endif #endif
@ -369,7 +371,7 @@ static int add_comment(char *s, char **d)
(*d)[pos++] = '\n'; (*d)[pos++] = '\n';
} }
if (!(*d = (char *) realloc(*d, pos + strlen(s) + 1))) { if (!(*d = (char *) realloc(*d, pos + strlen(s) + 1))) {
mp_msg(MSGT_CODECCFG,MSGL_FATAL,"Can't allocate memory for comment. "); mp_msg(MSGT_CODECCFG,MSGL_FATAL,MSGTR_CantAllocateComment);
return 0; return 0;
} }
strcpy(*d + pos, s); strcpy(*d + pos, s);
@ -418,7 +420,7 @@ static int get_token(int min, int max)
char c; char c;
if (max >= MAX_NR_TOKEN) { if (max >= MAX_NR_TOKEN) {
mp_msg(MSGT_CODECCFG,MSGL_ERR,"get_token(): max >= MAX_NR_TOKEN!"); mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_GetTokenMaxNotLessThanMAX_NR_TOKEN);
goto out_eof; goto out_eof;
} }
@ -506,15 +508,15 @@ int parse_codec_cfg(char *cfgfile)
#endif #endif
} }
mp_msg(MSGT_CODECCFG,MSGL_INFO,"Reading %s: ", cfgfile); mp_msg(MSGT_CODECCFG,MSGL_INFO,MSGTR_ReadingFile, cfgfile);
if ((fp = fopen(cfgfile, "r")) == NULL) { if ((fp = fopen(cfgfile, "r")) == NULL) {
mp_msg(MSGT_CODECCFG,MSGL_ERR,"Can't open '%s': %s\n", cfgfile, strerror(errno)); mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantOpenFileError, cfgfile, strerror(errno));
return 0; return 0;
} }
if ((line = (char *) malloc(MAX_LINE_LEN + 1)) == NULL) { if ((line = (char *) malloc(MAX_LINE_LEN + 1)) == NULL) {
mp_msg(MSGT_CODECCFG,MSGL_FATAL,"Can't get memory for 'line': %s\n", strerror(errno)); mp_msg(MSGT_CODECCFG,MSGL_FATAL,MSGTR_CantGetMemoryForLine, strerror(errno));
return 0; return 0;
} }
read_nextline = 1; read_nextline = 1;
@ -572,7 +574,7 @@ int parse_codec_cfg(char *cfgfile)
} }
if (!(*codecsp = (codecs_t *) realloc(*codecsp, if (!(*codecsp = (codecs_t *) realloc(*codecsp,
sizeof(codecs_t) * (*nr_codecsp + 2)))) { sizeof(codecs_t) * (*nr_codecsp + 2)))) {
mp_msg(MSGT_CODECCFG,MSGL_FATAL,"Can't realloc '*codecsp': %s\n", strerror(errno)); mp_msg(MSGT_CODECCFG,MSGL_FATAL,MSGTR_CantReallocCodecsp, strerror(errno));
goto err_out; goto err_out;
} }
codec=*codecsp + *nr_codecsp; codec=*codecsp + *nr_codecsp;
@ -587,19 +589,19 @@ int parse_codec_cfg(char *cfgfile)
for (i = 0; i < *nr_codecsp - 1; i++) { for (i = 0; i < *nr_codecsp - 1; i++) {
if(( (*codecsp)[i].name!=NULL) && if(( (*codecsp)[i].name!=NULL) &&
(!strcmp(token[0], (*codecsp)[i].name)) ) { (!strcmp(token[0], (*codecsp)[i].name)) ) {
mp_msg(MSGT_CODECCFG,MSGL_ERR,"Codec name '%s' isn't unique.", token[0]); mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecNameNotUnique, token[0]);
goto err_out_print_linenum; goto err_out_print_linenum;
} }
} }
if (!(codec->name = strdup(token[0]))) { if (!(codec->name = strdup(token[0]))) {
mp_msg(MSGT_CODECCFG,MSGL_ERR,"Can't strdup -> 'name': %s\n", strerror(errno)); mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupName, strerror(errno));
goto err_out; goto err_out;
} }
} else if (!strcmp(token[0], "info")) { } else if (!strcmp(token[0], "info")) {
if (codec->info || get_token(1, 1) < 0) if (codec->info || get_token(1, 1) < 0)
goto err_out_parse_error; goto err_out_parse_error;
if (!(codec->info = strdup(token[0]))) { if (!(codec->info = strdup(token[0]))) {
mp_msg(MSGT_CODECCFG,MSGL_ERR,"Can't strdup -> 'info': %s\n", strerror(errno)); mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupInfo, strerror(errno));
goto err_out; goto err_out;
} }
} else if (!strcmp(token[0], "comment")) { } else if (!strcmp(token[0], "comment")) {
@ -623,14 +625,14 @@ int parse_codec_cfg(char *cfgfile)
if (get_token(1, 1) < 0) if (get_token(1, 1) < 0)
goto err_out_parse_error; goto err_out_parse_error;
if (!(codec->drv = strdup(token[0]))) { if (!(codec->drv = strdup(token[0]))) {
mp_msg(MSGT_CODECCFG,MSGL_ERR,"Can't strdup -> 'driver': %s\n", strerror(errno)); mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupDriver, strerror(errno));
goto err_out; goto err_out;
} }
} else if (!strcmp(token[0], "dll")) { } else if (!strcmp(token[0], "dll")) {
if (get_token(1, 1) < 0) if (get_token(1, 1) < 0)
goto err_out_parse_error; goto err_out_parse_error;
if (!(codec->dll = strdup(token[0]))) { if (!(codec->dll = strdup(token[0]))) {
mp_msg(MSGT_CODECCFG,MSGL_ERR,"Can't strdup -> 'dll': %s\n", strerror(errno)); mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupDLL, strerror(errno));
goto err_out; goto err_out;
} }
} else if (!strcmp(token[0], "guid")) { } else if (!strcmp(token[0], "guid")) {
@ -699,7 +701,7 @@ int parse_codec_cfg(char *cfgfile)
} }
if (!validate_codec(codec, codec_type)) if (!validate_codec(codec, codec_type))
goto err_out_not_valid; goto err_out_not_valid;
mp_msg(MSGT_CODECCFG,MSGL_INFO,"%d audio & %d video codecs\n", nr_acodecs, nr_vcodecs); mp_msg(MSGT_CODECCFG,MSGL_INFO,MSGTR_AudioVideoCodecTotals, nr_acodecs, nr_vcodecs);
if(video_codecs) video_codecs[nr_vcodecs].name = NULL; if(video_codecs) video_codecs[nr_vcodecs].name = NULL;
if(audio_codecs) audio_codecs[nr_acodecs].name = NULL; if(audio_codecs) audio_codecs[nr_acodecs].name = NULL;
out: out:
@ -709,7 +711,7 @@ out:
return 1; return 1;
err_out_parse_error: err_out_parse_error:
mp_msg(MSGT_CODECCFG,MSGL_ERR,"parse error"); mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseError);
err_out_print_linenum: err_out_print_linenum:
PRINT_LINENUM; PRINT_LINENUM;
err_out: err_out:
@ -726,10 +728,10 @@ err_out:
fclose(fp); fclose(fp);
return 0; return 0;
err_out_not_valid: err_out_not_valid:
mp_msg(MSGT_CODECCFG,MSGL_ERR,"Codec is not defined correctly."); mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecDefinitionIncorrect);
goto err_out_print_linenum; goto err_out_print_linenum;
err_out_release_num: err_out_release_num:
mp_msg(MSGT_CODECCFG,MSGL_ERR,"This codecs.conf is too old and incompatible with this MPlayer release!"); mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_OutdatedCodecsConf);
goto err_out_print_linenum; goto err_out_print_linenum;
} }

View File

@ -402,6 +402,34 @@ static char help_text[]=
" (320 kbps bitrate)\n"\ " (320 kbps bitrate)\n"\
" <8-320>: ABR encoding at average given kbps bitrate.\n\n" " <8-320>: ABR encoding at average given kbps bitrate.\n\n"
//codec-cfg.c:
#define MSGTR_DuplicateFourcc "duplicated FourCC"
#define MSGTR_TooManyFourccs "too many FourCCs/formats..."
#define MSGTR_ParseError "parse error"
#define MSGTR_ParseErrorFIDNotNumber "parse error (format ID not a number?)"
#define MSGTR_ParseErrorFIDAliasNotNumber "parse error (format ID alias not a number?)"
#define MSGTR_DuplicateFID "duplicated format ID"
#define MSGTR_TooManyOut "too many out..."
#define MSGTR_InvalidCodecName "\ncodec(%s) name is not valid!\n"
#define MSGTR_CodecLacksFourcc "\ncodec(%s) does not have FourCC/format!\n"
#define MSGTR_CodecLacksDriver "\ncodec(%s) does not have a driver!\n"
#define MSGTR_CodecNeedsDLL "\ncodec(%s) needs a 'dll'!\n"
#define MSGTR_CodecNeedsOutfmt "\ncodec(%s) needa an 'outfmt'!\n"
#define MSGTR_CantAllocateComment "Can't allocate memory for comment. "
#define MSGTR_GetTokenMaxNotLessThanMAX_NR_TOKEN "get_token(): max >= MAX_MR_TOKEN!"
#define MSGTR_ReadingFile "Reading %s: "
#define MSGTR_CantOpenFileError "Can't open '%s': %s\n"
#define MSGTR_CantGetMemoryForLine "Can't get memory for 'line': %s\n"
#define MSGTR_CantReallocCodecsp "Can't realloc '*codecsp': %s\n"
#define MSGTR_CodecNameNotUnique "Codec name '%s' isn't unique."
#define MSGTR_CantStrdupName "Can't strdup -> 'name': %s\n"
#define MSGTR_CantStrdupInfo "Can't strdup -> 'info': %s\n"
#define MSGTR_CantStrdupDriver "Can't strdup -> 'driver': %s\n"
#define MSGTR_CantStrdupDLL "Can't strdup -> 'dll': %s"
#define MSGTR_AudioVideoCodecTotals "%d audio & %d video codecs\n"
#define MSGTR_CodecDefinitionIncorrect "Codec is not defined correctly."
#define MSGTR_OutdatedCodecsConf "This codecs.conf is too old and incompatible with this MPlayer release!"
// open.c, stream.c: // open.c, stream.c:
#define MSGTR_CdDevNotfound "CD-ROM Device '%s' not found.\n" #define MSGTR_CdDevNotfound "CD-ROM Device '%s' not found.\n"
#define MSGTR_ErrTrackSelect "Error selecting VCD track." #define MSGTR_ErrTrackSelect "Error selecting VCD track."