aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/libdvbv5/dvb-file.c111
-rw-r--r--lib/libdvbv5/dvb-log.c35
-rw-r--r--lib/libdvbv5/dvb-sat.c27
-rw-r--r--lib/libdvbv5/dvb-scan.c71
-rw-r--r--lib/libdvbv5/dvb-vdr-format.c26
5 files changed, 169 insertions, 101 deletions
diff --git a/lib/libdvbv5/dvb-file.c b/lib/libdvbv5/dvb-file.c
index 7122c74d..3fda65fa 100644
--- a/lib/libdvbv5/dvb-file.c
+++ b/lib/libdvbv5/dvb-file.c
@@ -50,6 +50,19 @@
#include <libdvbv5/desc_hierarchy.h>
#include <libdvbv5/countries.h>
+#include <config.h>
+
+#ifdef ENABLE_NLS
+# include "gettext.h"
+# include <libintl.h>
+# define _(string) dgettext(LIBDVBV5_DOMAIN, string)
+
+#else
+# define _(string) string
+#endif
+
+# define N_(string) string
+
int dvb_store_entry_prop(struct dvb_entry *entry,
uint32_t cmd, uint32_t value)
{
@@ -61,7 +74,7 @@ int dvb_store_entry_prop(struct dvb_entry *entry,
}
if (i == entry->n_props) {
if (i == DTV_MAX_COMMAND) {
- fprintf(stderr, "Can't add property %s\n",
+ fprintf(stderr, _("Can't add property %s\n"),
dvb_v5_name[cmd]);
return -1;
}
@@ -225,7 +238,7 @@ struct dvb_file *dvb_parse_format_oneline(const char *fname,
dvb_file = calloc(sizeof(*dvb_file), 1);
if (!dvb_file) {
- perror("Allocating memory for dvb_file");
+ perror(_("Allocating memory for dvb_file"));
return NULL;
}
@@ -251,7 +264,7 @@ struct dvb_file *dvb_parse_format_oneline(const char *fname,
if (parse_file->has_delsys_id) {
p = strtok(p, delimiter);
if (!p) {
- sprintf(err_msg, "unknown delivery system type for %s",
+ sprintf(err_msg, _("unknown delivery system type for %s"),
p);
goto error;
}
@@ -262,7 +275,7 @@ struct dvb_file *dvb_parse_format_oneline(const char *fname,
break;
}
if (!formats[i].id) {
- sprintf(err_msg, "Doesn't know how to handle delimiter '%s'",
+ sprintf(err_msg, _("Doesn't know how to handle delimiter '%s'"),
p);
goto error;
}
@@ -273,7 +286,7 @@ struct dvb_file *dvb_parse_format_oneline(const char *fname,
break;
}
if (!formats[i].delsys) {
- sprintf(err_msg, "Doesn't know how to parse delivery system %d",
+ sprintf(err_msg, _("Doesn't know how to parse delivery system %d"),
delsys);
goto error;
}
@@ -301,7 +314,7 @@ struct dvb_file *dvb_parse_format_oneline(const char *fname,
if (p && *p == '#')
p = NULL;
if (!p && !fmt->table[i].has_default_value) {
- sprintf(err_msg, "parameter %i (%s) missing",
+ sprintf(err_msg, _("parameter %i (%s) missing"),
i, dvb_cmd_name(table->prop));
goto error;
}
@@ -310,7 +323,7 @@ struct dvb_file *dvb_parse_format_oneline(const char *fname,
if (!table->table[j] || !strcasecmp(table->table[j], p))
break;
if (j == table->size) {
- sprintf(err_msg, "parameter %s invalid: %s",
+ sprintf(err_msg, _("parameter %s invalid: %s"),
dvb_cmd_name(table->prop), p);
goto error;
}
@@ -367,7 +380,7 @@ struct dvb_file *dvb_parse_format_oneline(const char *fname,
return dvb_file;
error:
- fprintf (stderr, "ERROR %s while parsing line %d of %s\n",
+ fprintf (stderr, _("ERROR %s while parsing line %d of %s\n"),
err_msg, line, fname);
dvb_file_free(dvb_file);
fclose(fd);
@@ -448,7 +461,7 @@ int dvb_write_format_oneline(const char *fname,
}
if (formats[i].delsys == 0) {
sprintf(err_msg,
- "delivery system %d not supported on this format",
+ _("delivery system %d not supported on this format"),
delsys);
goto error;
}
@@ -490,7 +503,7 @@ int dvb_write_format_oneline(const char *fname,
}
if (data >= table->size) {
sprintf(err_msg,
- "value not supported");
+ _("value not supported"));
goto error;
}
@@ -500,7 +513,7 @@ int dvb_write_format_oneline(const char *fname,
case DTV_VIDEO_PID:
if (!entry->video_pid) {
fprintf(stderr,
- "WARNING: missing video PID while parsing entry %d of %s\n",
+ _("WARNING: missing video PID while parsing entry %d of %s\n"),
line, fname);
fprintf(fp, "%d",0);
} else
@@ -510,7 +523,7 @@ int dvb_write_format_oneline(const char *fname,
case DTV_AUDIO_PID:
if (!entry->audio_pid) {
fprintf(stderr,
- "WARNING: missing audio PID while parsing entry %d of %s\n",
+ _("WARNING: missing audio PID while parsing entry %d of %s\n"),
line, fname);
fprintf(fp, "%d",0);
} else
@@ -529,7 +542,7 @@ int dvb_write_format_oneline(const char *fname,
data = fmt->table[i].default_value;
} else {
fprintf(stderr,
- "property %s not supported while parsing entry %d of %s\n",
+ _("property %s not supported while parsing entry %d of %s\n"),
dvb_cmd_name(table->prop),
line, fname);
data = 0;
@@ -550,7 +563,7 @@ int dvb_write_format_oneline(const char *fname,
return 0;
error:
- fprintf(stderr, "ERROR: %s while parsing entry %d of %s\n",
+ fprintf(stderr, _("ERROR: %s while parsing entry %d of %s\n"),
err_msg, line, fname);
fclose(fp);
return -1;
@@ -731,7 +744,7 @@ struct dvb_file *dvb_read_file(const char *fname)
dvb_file = calloc(sizeof(*dvb_file), 1);
if (!dvb_file) {
- perror("Allocating memory for dvb_file");
+ perror(_("Allocating memory for dvb_file"));
return NULL;
}
@@ -767,7 +780,7 @@ struct dvb_file *dvb_read_file(const char *fname)
p++;
p = strtok(p, "]");
if (!p) {
- sprintf(err_msg, "Missing channel group");
+ sprintf(err_msg, _("Missing channel group"));
goto error;
}
if (!strcasecmp(p, CHANNEL))
@@ -780,12 +793,12 @@ struct dvb_file *dvb_read_file(const char *fname)
}
} else {
if (!entry) {
- sprintf(err_msg, "key/value without a channel group");
+ sprintf(err_msg, _("key/value without a channel group"));
goto error;
}
key = strtok(p, "=");
if (!key) {
- sprintf(err_msg, "missing key");
+ sprintf(err_msg, _("missing key"));
goto error;
}
p = &key[strlen(key) - 1];
@@ -794,7 +807,7 @@ struct dvb_file *dvb_read_file(const char *fname)
*p = 0;
value = strtok(NULL, "\n");
if (!value) {
- sprintf(err_msg, "missing value");
+ sprintf(err_msg, _("missing value"));
goto error;
}
while (*value == ' ' || *value == '\t')
@@ -802,7 +815,7 @@ struct dvb_file *dvb_read_file(const char *fname)
rc = fill_entry(entry, key, value);
if (rc == -2) {
- sprintf(err_msg, "value %s is invalid for %s",
+ sprintf(err_msg, _("value %s is invalid for %s"),
value, key);
goto error;
}
@@ -816,7 +829,7 @@ struct dvb_file *dvb_read_file(const char *fname)
return dvb_file;
error:
- fprintf (stderr, "ERROR %s while parsing line %d of %s\n",
+ fprintf (stderr, _("ERROR %s while parsing line %d of %s\n"),
err_msg, line, fname);
if (buf)
free(buf);
@@ -1105,7 +1118,7 @@ static int get_program_and_store(struct dvb_v5_fe_parms_priv *parms,
}
}
if (!found) {
- dvb_logwarn("Channel %s (service ID %d) not found on PMT. Skipping it.",
+ dvb_logwarn(_("Channel %s (service ID %d) not found on PMT. Skipping it."),
channel, service_id);
if (channel)
free(channel);
@@ -1123,7 +1136,7 @@ static int get_program_and_store(struct dvb_v5_fe_parms_priv *parms,
entry = entry->next;
}
if (!entry) {
- dvb_logerr("Not enough memory");
+ dvb_logerr(_("Not enough memory"));
if (channel)
free(channel);
if (vchannel)
@@ -1152,7 +1165,7 @@ static int get_program_and_store(struct dvb_v5_fe_parms_priv *parms,
usleep(100000);
} while (rc == EAGAIN);
if (rc)
- dvb_logerr("Couldn't get frontend props");
+ dvb_logerr(_("Couldn't get frontend props"));
}
for (j = 0; j < parms->n_props; j++) {
entry->props[j].cmd = parms->dvb_prop[j].cmd;
@@ -1181,7 +1194,7 @@ static int get_program_and_store(struct dvb_v5_fe_parms_priv *parms,
service_id);
if (r < 0)
dvb_perror("asprintf");
- dvb_log("Storing Service ID %d: '%s'", service_id, channel);
+ dvb_log(_("Storing Service ID %d: '%s'"), service_id, channel);
}
entry->n_props = parms->n_props;
entry->channel = channel;
@@ -1196,20 +1209,20 @@ static int get_program_and_store(struct dvb_v5_fe_parms_priv *parms,
/* Service type, according with EN 300 468 V1.3.1 (1998-02) */
static char *sdt_services[256] = {
- [0x00 ...0xff] = "reserved",
- [0x01] = "digital television",
- [0x02] = "digital radio",
- [0x03] = "Teletext",
- [0x04] = "NVOD reference",
- [0x05] = "NVOD time-shifted",
- [0x06] = "mosaic",
- [0x07] = "PAL coded signal",
- [0x08] = "SECAM coded signal",
- [0x09] = "D/D2-MAC",
- [0x0a] = "FM Radio",
- [0x0b] = "NTSC coded signal",
- [0x0c] = "data broadcast",
- [0x80 ...0xfe] = "user defined",
+ [0x00 ...0xff] = N_("reserved"),
+ [0x01] = N_("digital television"),
+ [0x02] = N_("digital radio"),
+ [0x03] = N_("Teletext"),
+ [0x04] = N_("NVOD reference"),
+ [0x05] = N_("NVOD time-shifted"),
+ [0x06] = N_("mosaic"),
+ [0x07] = N_("PAL coded signal"),
+ [0x08] = N_("SECAM coded signal"),
+ [0x09] = N_("D/D2-MAC"),
+ [0x0a] = N_("FM Radio"),
+ [0x0b] = N_("NTSC coded signal"),
+ [0x0c] = N_("data broadcast"),
+ [0x80 ...0xfe] = N_("user defined"),
};
int dvb_store_channel(struct dvb_file **dvb_file,
@@ -1223,7 +1236,7 @@ int dvb_store_channel(struct dvb_file **dvb_file,
if (!*dvb_file) {
*dvb_file = calloc(sizeof(**dvb_file), 1);
if (!*dvb_file) {
- dvb_perror("Allocating memory for dvb_file");
+ dvb_perror(_("Allocating memory for dvb_file"));
return -1;
}
}
@@ -1247,7 +1260,7 @@ int dvb_store_channel(struct dvb_file **dvb_file,
dvb_perror("asprintf");
if (parms->p.verbose)
- dvb_log("Virtual channel %s, name = %s",
+ dvb_log(_("Virtual channel %s, name = %s"),
vchannel, channel);
rc = get_program_and_store(parms, *dvb_file, dvb_scan_handler,
@@ -1274,7 +1287,7 @@ int dvb_store_channel(struct dvb_file **dvb_file,
service_id = dvb_scan_handler->program[i].pat_pgm->service_id;
if (!warned) {
- dvb_log("WARNING: no SDT table - storing channel(s) without their names");
+ dvb_log(_("WARNING: no SDT table - storing channel(s) without their names"));
warned = 1;
}
@@ -1301,9 +1314,9 @@ int dvb_store_channel(struct dvb_file **dvb_file,
channel = calloc(strlen(p) + 1, 1);
strcpy(channel, p);
}
- dvb_log("Service %s, provider %s: %s",
+ dvb_log(_("Service %s, provider %s: %s"),
desc->name, desc->provider,
- sdt_services[desc->service_type]);
+ _(sdt_services[desc->service_type]));
break;
}
@@ -1314,7 +1327,7 @@ int dvb_store_channel(struct dvb_file **dvb_file,
}
if (parms->p.verbose)
- dvb_log("Storing as channel %s", channel);
+ dvb_log(_("Storing as channel %s"), channel);
vchannel = dvb_vchannel(parms, dvb_scan_handler->nit, service->service_id);
rc = get_program_and_store(parms, *dvb_file, dvb_scan_handler,
@@ -1339,7 +1352,7 @@ enum dvb_file_formats dvb_parse_format(const char *name)
if (!strcasecmp(name, "VDR"))
return FILE_VDR;
- fprintf(stderr, "File format %s is unknown\n", name);
+ fprintf(stderr, _("File format %s is unknown\n"), name);
return FILE_UNKNOWN;
}
@@ -1384,7 +1397,7 @@ int dvb_parse_delsys(const char *name)
* Not found. Print all possible values, except for
* SYS_UNDEFINED.
*/
- fprintf(stderr, "ERROR: Delivery system %s is not known. Valid values are:\n",
+ fprintf(stderr, _("ERROR: Delivery system %s is not known. Valid values are:\n"),
name);
for (i = 0; i < ARRAY_SIZE(alt_names) - 1; i++) {
if (!(cnt % 5))
@@ -1428,10 +1441,10 @@ struct dvb_file *dvb_read_file_format(const char *fname,
break;
case FILE_VDR:
/* FIXME: add support for VDR input */
- fprintf(stderr, "Currently, VDR format is supported only for output\n");
+ fprintf(stderr, _("Currently, VDR format is supported only for output\n"));
return NULL;
default:
- fprintf(stderr, "Format is not supported\n");
+ fprintf(stderr, _("Format is not supported\n"));
return NULL;
}
diff --git a/lib/libdvbv5/dvb-log.c b/lib/libdvbv5/dvb-log.c
index 11b9fdeb..b6cdebc1 100644
--- a/lib/libdvbv5/dvb-log.c
+++ b/lib/libdvbv5/dvb-log.c
@@ -25,20 +25,34 @@
#include <unistd.h>
#include <stdarg.h>
+#include <config.h>
+
+#ifdef ENABLE_NLS
+# include "gettext.h"
+# include <libintl.h>
+# define _(string) dgettext(LIBDVBV5_DOMAIN, string)
+
+#else
+# define _(string) string
+#endif
+
+# define N_(string) string
+
+
static const struct loglevel {
const char *name;
const char *color;
int fd;
} loglevels[9] = {
- {"EMERG ", "\033[31m", STDERR_FILENO },
- {"ALERT ", "\033[31m", STDERR_FILENO },
- {"CRITICAL ", "\033[31m", STDERR_FILENO },
- {"ERROR ", "\033[31m", STDERR_FILENO },
- {"WARNING ", "\033[33m", STDOUT_FILENO },
- {"", "\033[36m", STDOUT_FILENO }, /* NOTICE */
- {"", NULL, STDOUT_FILENO }, /* INFO */
- {"DEBUG ", "\033[32m", STDOUT_FILENO },
- {"", "\033[0m", STDOUT_FILENO }, /* reset*/
+ {N_("EMERG "), "\033[31m", STDERR_FILENO },
+ {N_("ALERT "), "\033[31m", STDERR_FILENO },
+ {N_("CRITICAL "), "\033[31m", STDERR_FILENO },
+ {N_("ERROR "), "\033[31m", STDERR_FILENO },
+ {N_("WARNING "), "\033[33m", STDOUT_FILENO },
+ {NULL, "\033[36m", STDOUT_FILENO }, /* NOTICE */
+ {NULL, NULL, STDOUT_FILENO }, /* INFO */
+ {N_("DEBUG "), "\033[32m", STDOUT_FILENO },
+ {NULL, "\033[0m", STDOUT_FILENO }, /* reset*/
};
#define LOG_COLOROFF 8
@@ -53,7 +67,8 @@ void dvb_default_log(int level, const char *fmt, ...)
out = stderr;
if (loglevels[level].color && isatty(loglevels[level].fd))
fputs(loglevels[level].color, out);
- fprintf(out, "%s", loglevels[level].name);
+ if (loglevels[level].name)
+ fprintf(out, "%s", _(loglevels[level].name));
vfprintf(out, fmt, ap);
fprintf(out, "\n");
if(loglevels[level].color && isatty(loglevels[level].fd))
diff --git a/lib/libdvbv5/dvb-sat.c b/lib/libdvbv5/dvb-sat.c
index 010aebe0..473a24b7 100644
--- a/lib/libdvbv5/dvb-sat.c
+++ b/lib/libdvbv5/dvb-sat.c
@@ -26,6 +26,19 @@
#include "dvb-fe-priv.h"
#include <libdvbv5/dvb-v5-std.h>
+#include <config.h>
+
+#ifdef ENABLE_NLS
+# include "gettext.h"
+# include <libintl.h>
+# define _(string) dgettext(LIBDVBV5_DOMAIN, string)
+
+#else
+# define _(string) string
+#endif
+
+# define N_(string) string
+
static const struct dvb_sat_lnb lnb[] = {
{
.name = "Europe",
@@ -118,22 +131,22 @@ int dvb_print_lnb(int i)
return -1;
printf("%s\n\t%s\n", lnb[i].alias, lnb[i].name);
- printf("\t%d to %d MHz",
+ printf(_("\t%d to %d MHz"),
lnb[i].freqrange[0].low, lnb[i].freqrange[0].high);
if (lnb[i].freqrange[1].low)
- printf(" and %d to %d MHz",
+ printf(_(" and %d to %d MHz"),
lnb[i].freqrange[1].low, lnb[i].freqrange[1].high);
- printf("\n\t%s LO, ", lnb[i].highfreq ? "Dual" : "Single");
+ printf("\n\t%s LO, ", lnb[i].highfreq ? _("Dual") : _("Single"));
if (!lnb[i].highfreq) {
printf("IF = %d MHz\n", lnb[i].lowfreq);
return 0;
}
if (!lnb[i].rangeswitch) {
- printf("Bandstacking, LO POL_R %d MHZ, LO POL_L %d MHz\n",
+ printf(_("Bandstacking, LO POL_R %d MHZ, LO POL_L %d MHz\n"),
lnb[i].lowfreq, lnb[i].highfreq);
return 0;
}
- printf("IF = lowband %d MHz, highband %d MHz\n",
+ printf(_("IF = lowband %d MHz, highband %d MHz\n"),
lnb[i].lowfreq, lnb[i].highfreq);
return 0;
@@ -341,7 +354,7 @@ static int dvbsat_diseqc_set_input(struct dvb_v5_fe_parms_priv *parms,
pol_v, sat_number, t);
if (rc) {
- dvb_logerr("sending diseq failed");
+ dvb_logerr(_("sending diseq failed"));
return rc;
}
usleep((15 + parms->p.diseqc_wait) * 1000);
@@ -375,7 +388,7 @@ int dvb_sat_set_parms(struct dvb_v5_fe_parms *p)
dvb_fe_retrieve_parm(&parms->p, DTV_FREQUENCY, &freq);
if (!lnb) {
- dvb_logerr("Need a LNBf to work");
+ dvb_logerr(_("Need a LNBf to work"));
return -EINVAL;
}
diff --git a/lib/libdvbv5/dvb-scan.c b/lib/libdvbv5/dvb-scan.c
index c0ede6bd..ba569340 100644
--- a/lib/libdvbv5/dvb-scan.c
+++ b/lib/libdvbv5/dvb-scan.c
@@ -62,6 +62,19 @@
#include <libdvbv5/desc_t2_delivery.h>
#include <libdvbv5/desc_sat.h>
+#include <config.h>
+
+#ifdef ENABLE_NLS
+# include "gettext.h"
+# include <libintl.h>
+# define _(string) dgettext(LIBDVBV5_DOMAIN, string)
+
+#else
+# define _(string) string
+#endif
+
+# define N_(string) string
+
static int dvb_poll(struct dvb_v5_fe_parms_priv *parms, int fd, unsigned int seconds)
{
fd_set set;
@@ -139,14 +152,14 @@ static int dvb_parse_section_alloc(struct dvb_v5_fe_parms_priv *parms,
struct dvb_table_filter_priv *priv;
if (!sect->table) {
- dvb_logerr("%s: table memory pointer not filled",
+ dvb_logerr(_("%s: table memory pointer not filled"),
__func__);
return -4;
}
*sect->table = NULL;
priv = calloc(sizeof(struct dvb_table_filter_priv), 1);
if (!priv) {
- dvb_logerr("%s: out of memory", __func__);
+ dvb_logerr(_("%s: out of memory"), __func__);
return -1;
}
priv->last_section = -1;
@@ -177,11 +190,11 @@ static int dvb_parse_section(struct dvb_v5_fe_parms_priv *parms,
dvb_table_header_init(&h);
if (parms->p.verbose)
- dvb_log("%s: received table 0x%02x, TS ID 0x%04x, section %d/%d",
+ dvb_log(_("%s: received table 0x%02x, TS ID 0x%04x, section %d/%d"),
__func__, h.table_id, h.id, h.section_id, h.last_section);
if (sect->tid != h.table_id) {
- dvb_logdbg("%s: couldn't match ID %d at the active section filters",
+ dvb_logdbg(_("%s: couldn't match ID %d at the active section filters"),
__func__, h.table_id);
return -1;
}
@@ -202,7 +215,7 @@ static int dvb_parse_section(struct dvb_v5_fe_parms_priv *parms,
/* tables like EIT can increment sections by gaps > 1.
* in this case, reading is done when a already read
* table is reached. */
- dvb_log("%s: section repeated, reading done", __func__);
+ dvb_log(_("%s: section repeated, reading done"), __func__);
priv->done = 1;
return 1;
}
@@ -224,7 +237,7 @@ static int dvb_parse_section(struct dvb_v5_fe_parms_priv *parms,
buf_length - DVB_CRC_SIZE,
sect->table);
else
- dvb_logerr("%s: no initializer for table %d",
+ dvb_logerr(_("%s: no initializer for table %d"),
__func__, tid);
if (!sect->allow_section_gaps && sect->ts_id == -1 &&
@@ -258,12 +271,12 @@ int dvb_read_sections(struct dvb_v5_fe_parms *__p, int dmx_fd,
return -1;
}
if (parms->p.verbose)
- dvb_log("%s: waiting for table ID 0x%02x, program ID 0x%02x",
+ dvb_log(_("%s: waiting for table ID 0x%02x, program ID 0x%02x"),
__func__, sect->tid, sect->pid);
buf = calloc(DVB_MAX_PAYLOAD_PACKET_SIZE, 1);
if (!buf) {
- dvb_logerr("%s: out of memory", __func__);
+ dvb_logerr(_("%s: out of memory"), __func__);
dvb_dmx_stop(dmx_fd);
dvb_table_filter_free(sect);
return -1;
@@ -284,26 +297,26 @@ int dvb_read_sections(struct dvb_v5_fe_parms *__p, int dmx_fd,
break;
}
if (available <= 0) {
- dvb_logerr("%s: no data read on section filter", __func__);
+ dvb_logerr(_("%s: no data read on section filter"), __func__);
ret = -1;
break;
}
buf_length = read(dmx_fd, buf, DVB_MAX_PAYLOAD_PACKET_SIZE);
if (!buf_length) {
- dvb_logerr("%s: buf returned an empty buffer", __func__);
+ dvb_logerr(_("%s: buf returned an empty buffer"), __func__);
ret = -1;
break;
}
if (buf_length < 0) {
- dvb_perror("dvb_read_section: read error");
+ dvb_perror(_("dvb_read_section: read error"));
ret = -2;
break;
}
crc = dvb_crc32(buf, buf_length, 0xFFFFFFFF);
if (crc != 0) {
- dvb_logerr("%s: crc error", __func__);
+ dvb_logerr(_("%s: crc error"), __func__);
ret = -3;
break;
}
@@ -443,7 +456,7 @@ struct dvb_v5_descriptors *dvb_get_ts_tables(struct dvb_v5_fe_parms *__p,
if (parms->p.abort)
return dvb_scan_handler;
if (rc < 0) {
- dvb_logerr("error while waiting for PAT table");
+ dvb_logerr(_("error while waiting for PAT table"));
dvb_scan_free_handler_table(dvb_scan_handler);
return NULL;
}
@@ -459,7 +472,7 @@ struct dvb_v5_descriptors *dvb_get_ts_tables(struct dvb_v5_fe_parms *__p,
if (parms->p.abort)
return dvb_scan_handler;
if (rc < 0)
- dvb_logerr("error while waiting for VCT table");
+ dvb_logerr(_("error while waiting for VCT table"));
else if (parms->p.verbose)
atsc_table_vct_print(&parms->p, dvb_scan_handler->vct);
}
@@ -473,13 +486,13 @@ struct dvb_v5_descriptors *dvb_get_ts_tables(struct dvb_v5_fe_parms *__p,
if (!program->service_id) {
if (parms->p.verbose)
- dvb_log("Program #%d is network PID: 0x%04x",
+ dvb_log(_("Program #%d is network PID: 0x%04x"),
num_pmt, program->pid);
num_pmt++;
continue;
}
if (parms->p.verbose)
- dvb_log("Program #%d ID 0x%04x, service ID 0x%04x",
+ dvb_log(_("Program #%d ID 0x%04x, service ID 0x%04x"),
num_pmt, program->pid, program->service_id);
rc = dvb_read_section(&parms->p, dmx_fd,
DVB_TABLE_PMT, program->pid,
@@ -490,7 +503,7 @@ struct dvb_v5_descriptors *dvb_get_ts_tables(struct dvb_v5_fe_parms *__p,
return dvb_scan_handler;
}
if (rc < 0) {
- dvb_logerr("error while reading the PMT table for service 0x%04x",
+ dvb_logerr(_("error while reading the PMT table for service 0x%04x"),
program->service_id);
dvb_scan_handler->program[num_pmt].pmt = NULL;
} else {
@@ -510,7 +523,7 @@ struct dvb_v5_descriptors *dvb_get_ts_tables(struct dvb_v5_fe_parms *__p,
if (parms->p.abort)
return dvb_scan_handler;
if (rc < 0)
- dvb_logerr("error while reading the NIT table");
+ dvb_logerr(_("error while reading the NIT table"));
else if (parms->p.verbose)
dvb_table_nit_print(&parms->p, dvb_scan_handler->nit);
@@ -523,7 +536,7 @@ struct dvb_v5_descriptors *dvb_get_ts_tables(struct dvb_v5_fe_parms *__p,
if (parms->p.abort)
return dvb_scan_handler;
if (rc < 0)
- dvb_logerr("error while reading the SDT table");
+ dvb_logerr(_("error while reading the SDT table"));
else if (parms->p.verbose)
dvb_table_sdt_print(&parms->p, dvb_scan_handler->sdt);
}
@@ -531,7 +544,7 @@ struct dvb_v5_descriptors *dvb_get_ts_tables(struct dvb_v5_fe_parms *__p,
/* NIT/SDT other tables */
if (other_nit) {
if (parms->p.verbose)
- dvb_log("Parsing other NIT/SDT");
+ dvb_log(_("Parsing other NIT/SDT"));
rc = dvb_read_section(&parms->p, dmx_fd,
DVB_TABLE_NIT2, DVB_TABLE_NIT_PID,
(void **)&dvb_scan_handler->nit,
@@ -539,7 +552,7 @@ struct dvb_v5_descriptors *dvb_get_ts_tables(struct dvb_v5_fe_parms *__p,
if (parms->p.abort)
return dvb_scan_handler;
if (rc < 0)
- dvb_logerr("error while reading the NIT table");
+ dvb_logerr(_("error while reading the NIT table"));
else if (parms->p.verbose)
dvb_table_nit_print(&parms->p, dvb_scan_handler->nit);
@@ -550,7 +563,7 @@ struct dvb_v5_descriptors *dvb_get_ts_tables(struct dvb_v5_fe_parms *__p,
if (parms->p.abort)
return dvb_scan_handler;
if (rc < 0)
- dvb_logerr("error while reading the SDT table");
+ dvb_logerr(_("error while reading the SDT table"));
else if (parms->p.verbose)
dvb_table_sdt_print(&parms->p, dvb_scan_handler->sdt);
}
@@ -596,7 +609,7 @@ struct dvb_v5_descriptors *dvb_scan_transponder(struct dvb_v5_fe_parms *__p,
rc = dvb_fe_set_parms(&parms->p);
if (rc < 0) {
- dvb_perror("dvb_fe_set_parms failed");
+ dvb_perror(_("dvb_fe_set_parms failed"));
return NULL;
}
@@ -682,8 +695,8 @@ int dvb_estimate_freq_shift(struct dvb_v5_fe_parms *__p)
if (!bw)
dvb_fe_retrieve_parm(&parms->p, DTV_BANDWIDTH_HZ, &bw);
if (!bw)
- dvb_log("Cannot calc frequency shift. " \
- "Either bandwidth/symbol-rate is unavailable (yet).");
+ dvb_log(_("Cannot calc frequency shift. " \
+ "Either bandwidth/symbol-rate is unavailable (yet)."));
/*
* If the max frequency shift between two frequencies is below
* than the used bandwidth / 8, it should be the same channel.
@@ -764,7 +777,7 @@ struct dvb_entry *dvb_scan_add_entry_ex(struct dvb_v5_fe_parms *__p,
/* Clone the current entry into a new entry */
new_entry = calloc(sizeof(*new_entry), 1);
if (!new_entry) {
- dvb_perror("not enough memory for a new scanning frequency/TS");
+ dvb_perror(_("not enough memory for a new scanning frequency/TS"));
return NULL;
}
@@ -793,7 +806,7 @@ struct dvb_entry *dvb_scan_add_entry_ex(struct dvb_v5_fe_parms *__p,
entry = entry->next;
n++;
}
- dvb_log("New transponder/channel found: #%d: %d",
+ dvb_log(_("New transponder/channel found: #%d: %d"),
n, freq);
entry->next = new_entry;
new_entry->next = NULL;
@@ -802,7 +815,7 @@ struct dvb_entry *dvb_scan_add_entry_ex(struct dvb_v5_fe_parms *__p,
}
/* This should never happen */
- dvb_logerr("BUG: Couldn't add %d to the scan frequency list.", freq);
+ dvb_logerr(_("BUG: Couldn't add %d to the scan frequency list."), freq);
free(new_entry);
return NULL;
@@ -1144,7 +1157,7 @@ static void __dvb_add_update_transponders(struct dvb_v5_fe_parms_priv *parms,
return;
default:
- dvb_log("Transponders detection not implemented for this standard yet.");
+ dvb_log(_("Transponders detection not implemented for this standard yet."));
return;
}
}
diff --git a/lib/libdvbv5/dvb-vdr-format.c b/lib/libdvbv5/dvb-vdr-format.c
index 1700518f..176a9275 100644
--- a/lib/libdvbv5/dvb-vdr-format.c
+++ b/lib/libdvbv5/dvb-vdr-format.c
@@ -24,6 +24,20 @@
#include <libdvbv5/dvb-file.h>
#include <libdvbv5/dvb-v5-std.h>
+#include <config.h>
+
+#ifdef ENABLE_NLS
+# include "gettext.h"
+# include <libintl.h>
+# define _(string) dgettext(LIBDVBV5_DOMAIN, string)
+
+#else
+# define _(string) string
+#endif
+
+# define N_(string) string
+
+
#define PTABLE(a) .table = a, .size=ARRAY_SIZE(a)
/*
@@ -272,7 +286,7 @@ int dvb_write_format_vdr(const char *fname,
}
if (formats[i].delsys == 0) {
fprintf(stderr,
- "WARNING: entry %d: delivery system %d not supported on this format. skipping entry\n",
+ _("WARNING: entry %d: delivery system %d not supported on this format. skipping entry\n"),
line, delsys);
continue;
}
@@ -280,14 +294,14 @@ int dvb_write_format_vdr(const char *fname,
if (!entry->channel) {
fprintf(stderr,
- "WARNING: entry %d: channel name not found. skipping entry\n",
+ _("WARNING: entry %d: channel name not found. skipping entry\n"),
line);
continue;
}
if (dvb_retrieve_entry_prop(entry, DTV_FREQUENCY, &freq) < 0) {
fprintf(stderr,
- "WARNING: entry %d: frequency not found. skipping entry\n",
+ _("WARNING: entry %d: frequency not found. skipping entry\n"),
line);
continue;
}
@@ -330,7 +344,7 @@ int dvb_write_format_vdr(const char *fname,
}
if (data >= table->size) {
sprintf(err_msg,
- "value not supported");
+ _("value not supported"));
goto error;
}
@@ -359,7 +373,7 @@ int dvb_write_format_vdr(const char *fname,
case SYS_DVBC_ANNEX_A:
if (dvb_retrieve_entry_prop(entry, DTV_SYMBOL_RATE, &srate) < 0) {
sprintf(err_msg,
- "symbol rate not found");
+ _("symbol rate not found"));
goto error;
}
}
@@ -404,7 +418,7 @@ int dvb_write_format_vdr(const char *fname,
return 0;
error:
- fprintf(stderr, "ERROR: %s while parsing entry %d of %s\n",
+ fprintf(stderr, _("ERROR: %s while parsing entry %d of %s\n"),
err_msg, line, fname);
fclose(fp);
return -1;

Privacy Policy