aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-12-12 19:38:34 -0200
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-12-12 20:11:13 -0200
commit6f9f5051cc1b332835020c6c814e1d586d1d0f99 (patch)
tree32d3bdd274104f29bb30ee82b2d8799ca7fa46f8
parent81aa62f7f776bfa9ed81f6eac3ebb35d9bf3b54a (diff)
dvb: add locale support
Add locale support for DVB tools. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r--po/POTFILES.in4
-rw-r--r--po/v4l-utils.pot314
-rw-r--r--utils/dvb/dvb-fe-tool.c34
-rw-r--r--utils/dvb/dvb-format-convert.c34
-rw-r--r--utils/dvb/dvbv5-scan.c54
-rw-r--r--utils/dvb/dvbv5-zap.c130
6 files changed, 467 insertions, 103 deletions
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 11519652..3e0bba98 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,3 +1,7 @@
# List of source files which contain translatable strings.
utils/keytable/keytable.c
+utils/dvb/dvb-fe-tool.c
+utils/dvb/dvb-format-convert.c
+utils/dvb/dvbv5-scan.c
+utils/dvb/dvbv5-zap.c
diff --git a/po/v4l-utils.pot b/po/v4l-utils.pot
index e32bba52..e7b0e101 100644
--- a/po/v4l-utils.pot
+++ b/po/v4l-utils.pot
@@ -1,14 +1,14 @@
# SOME DESCRIPTIVE TITLE.
-# Copyright (C) 2014 Mauro Carvalho Chehab
+# Copyright (C) YEAR Mauro Carvalho Chehab
# This file is distributed under the same license as the PACKAGE package.
-# Mauro Carvalho Chehab <mchehab@osg.samsung.com>, 2014.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: v4l-utils 1.7.0\n"
"Report-Msgid-Bugs-To: linux-media@vger.Kernel.org\n"
-"POT-Creation-Date: 2014-12-12 19:14-0200\n"
+"POT-Creation-Date: 2014-12-12 20:10-0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -376,3 +376,311 @@ msgstr ""
#, c-format
msgid "Protocols changed to "
msgstr ""
+
+#: utils/dvb/dvb-fe-tool.c:91 utils/dvb/dvbv5-scan.c:99
+#: utils/dvb/dvbv5-scan.c:106 utils/dvb/dvbv5-zap.c:112
+#: utils/dvb/dvbv5-zap.c:119
+#, c-format
+msgid "ERROR: "
+msgstr ""
+
+#: utils/dvb/dvb-fe-tool.c:151 utils/dvb/dvbv5-scan.c:193
+#: utils/dvb/dvbv5-zap.c:349 utils/dvb/dvbv5-zap.c:412
+msgid "dvb_fe_get_stats failed"
+msgstr ""
+
+#: utils/dvb/dvb-fe-tool.c:162 utils/dvb/dvbv5-scan.c:141
+#: utils/dvb/dvbv5-zap.c:360
+msgid "Quality"
+msgstr ""
+
+#: utils/dvb/dvb-fe-tool.c:165 utils/dvb/dvbv5-scan.c:144
+#: utils/dvb/dvbv5-zap.c:363
+msgid "Signal"
+msgstr ""
+
+#: utils/dvb/dvb-fe-tool.c:168 utils/dvb/dvbv5-scan.c:147
+#: utils/dvb/dvbv5-zap.c:366
+msgid "C/N"
+msgstr ""
+
+#: utils/dvb/dvb-fe-tool.c:171 utils/dvb/dvbv5-scan.c:150
+#: utils/dvb/dvbv5-zap.c:369
+msgid "UCB"
+msgstr ""
+
+#: utils/dvb/dvb-fe-tool.c:174 utils/dvb/dvbv5-scan.c:153
+#: utils/dvb/dvbv5-zap.c:372
+msgid "postBER"
+msgstr ""
+
+#: utils/dvb/dvb-fe-tool.c:177 utils/dvb/dvbv5-scan.c:156
+#: utils/dvb/dvbv5-zap.c:375
+msgid "preBER"
+msgstr ""
+
+#: utils/dvb/dvb-fe-tool.c:180 utils/dvb/dvbv5-scan.c:159
+#: utils/dvb/dvbv5-zap.c:378
+msgid "PER"
+msgstr ""
+
+#: utils/dvb/dvb-fe-tool.c:283
+#, c-format
+msgid "Changing delivery system to: %s\n"
+msgstr ""
+
+#: utils/dvb/dvb-format-convert.c:90
+#, c-format
+msgid "Reading file %s\n"
+msgstr ""
+
+#: utils/dvb/dvb-format-convert.c:95
+#, c-format
+msgid "Error reading file %s\n"
+msgstr ""
+
+#: utils/dvb/dvb-format-convert.c:99
+#, c-format
+msgid "Writing file %s\n"
+msgstr ""
+
+#: utils/dvb/dvb-format-convert.c:114 utils/dvb/dvbv5-scan.c:443
+msgid "scan DVB services using the channel file"
+msgstr ""
+
+#: utils/dvb/dvb-format-convert.c:115
+msgid "<input file> <output file>"
+msgstr ""
+
+#: utils/dvb/dvb-format-convert.c:131
+#, c-format
+msgid "ERROR: Please specify a valid input format\n"
+msgstr ""
+
+#: utils/dvb/dvb-format-convert.c:134
+#, c-format
+msgid "ERROR: Please specify a valid input file\n"
+msgstr ""
+
+#: utils/dvb/dvb-format-convert.c:137
+#, c-format
+msgid "ERROR: Please specify a valid output format\n"
+msgstr ""
+
+#: utils/dvb/dvb-format-convert.c:140
+#, c-format
+msgid "ERROR: Please specify a valid output file\n"
+msgstr ""
+
+#: utils/dvb/dvb-format-convert.c:145
+#, c-format
+msgid "ERROR: Please specify a valid delivery system for ZAP format\n"
+msgstr ""
+
+#: utils/dvb/dvbv5-scan.c:249
+msgid "openening pat demux failed"
+msgstr ""
+
+#: utils/dvb/dvbv5-scan.c:276
+#, c-format
+msgid "Scanning frequency #%d %d"
+msgstr ""
+
+#: utils/dvb/dvbv5-scan.c:444
+msgid "<initial file>"
+msgstr ""
+
+#: utils/dvb/dvbv5-scan.c:472 utils/dvb/dvbv5-zap.c:774
+#, c-format
+msgid "Please select one of the LNBf's below:\n"
+msgstr ""
+
+#: utils/dvb/dvbv5-scan.c:476 utils/dvb/dvbv5-zap.c:778
+#, c-format
+msgid "Using LNBf "
+msgstr ""
+
+#: utils/dvb/dvbv5-scan.c:491 utils/dvb/dvbv5-zap.c:760
+#, c-format
+msgid "ERROR: Please specify a valid format\n"
+msgstr ""
+
+#: utils/dvb/dvbv5-scan.c:499 utils/dvb/dvbv5-zap.c:786
+#: utils/dvb/dvbv5-zap.c:793
+#, c-format
+msgid "asprintf error\n"
+msgstr ""
+
+#: utils/dvb/dvbv5-scan.c:504 utils/dvb/dvbv5-zap.c:798
+#, c-format
+msgid "using demux '%s'\n"
+msgstr ""
+
+#: utils/dvb/dvbv5-scan.c:522 utils/dvb/dvbv5-zap.c:826
+#, c-format
+msgid "Failed to set the country code:%s\n"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:200
+msgid "Can't find channel"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:214
+#, c-format
+msgid "unknown LNB %s\n"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:240
+#, c-format
+msgid "service has pid type %02x: "
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:304
+msgid "can't get the frequency"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:307
+#, c-format
+msgid "tuning to %i Hz\n"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:312
+msgid "dvb_fe_set_parms failed"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:457
+#, c-format
+msgid "buffer overrun\n"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:460
+msgid "Read failed"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:464
+msgid "Write failed"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:470
+#, c-format
+msgid "copied %lld bytes (%lld Kbytes/sec)\n"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:591 utils/dvb/dvbv5-zap.c:599
+#: utils/dvb/dvbv5-zap.c:904 utils/dvb/dvbv5-zap.c:928
+#: utils/dvb/dvbv5-zap.c:976
+#, c-format
+msgid "failed opening '%s'"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:596 utils/dvb/dvbv5-zap.c:912
+msgid "DMX_SET_BUFFER_SIZE failed"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:605
+#, c-format
+msgid " dvb_set_pesfilter to 0x2000\n"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:608
+msgid "couldn't set filter"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:632
+#, c-format
+msgid "%.2fs: buffer overrun\n"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:635
+msgid "read"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:639
+#, c-format
+msgid "dvbtraffic: only read %zd bytes\n"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:691
+#, c-format
+msgid " PID FREQ SPEED TOTAL\n"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:740
+msgid "DVB zap utility"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:741
+msgid "<channel name> [or <frequency> if in monitor mode]"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:766
+#, c-format
+msgid "ERROR: search string can be used only on monitor mode\n"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:802
+msgid "$HOME not set"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:811
+#, c-format
+msgid "reading channels from file '%s'\n"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:854
+#, c-format
+msgid "Service id 0x%04x was not specified at the file\n"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:861 utils/dvb/dvbv5-zap.c:874
+msgid "opening pat demux failed"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:867
+#, c-format
+msgid "couldn't find pmt-pid for sid %04x\n"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:883
+msgid "opening pmt demux failed"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:899
+#, c-format
+msgid "pass all PID's to TS\n"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:901
+#, c-format
+msgid "video pid %d\n"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:909 utils/dvb/dvbv5-zap.c:932
+#, c-format
+msgid " dvb_set_pesfilter %d\n"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:926
+#, c-format
+msgid "audio pid %d\n"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:948
+#, c-format
+msgid "frontend doesn't lock\n"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:964
+#, c-format
+msgid "open of '%s' failed"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:980
+#, c-format
+msgid "Record to file '%s' started\n"
+msgstr ""
+
+#: utils/dvb/dvbv5-zap.c:984
+#, c-format
+msgid "DVR interface '%s' can now be opened\n"
+msgstr ""
diff --git a/utils/dvb/dvb-fe-tool.c b/utils/dvb/dvb-fe-tool.c
index 85503550..2f2f666f 100644
--- a/utils/dvb/dvb-fe-tool.c
+++ b/utils/dvb/dvb-fe-tool.c
@@ -26,6 +26,16 @@
#include <stdio.h>
#include <unistd.h>
+#ifdef ENABLE_NLS
+# define _(string) gettext(string)
+# include "gettext.h"
+# include <locale.h>
+# include <langinfo.h>
+# include <iconv.h>
+#else
+# define _(string) string
+#endif
+
#define PROGRAM_NAME "dvb-fe-tool"
const char *argp_program_version = PROGRAM_NAME " version " V4L_UTILS_VERSION;
@@ -78,7 +88,7 @@ static void do_timeout(int x)
#define PERROR(x...) \
do { \
- fprintf(stderr, "ERROR: "); \
+ fprintf(stderr, _("ERROR: ")); \
fprintf(stderr, x); \
fprintf(stderr, " (%s)\n", strerror(errno)); \
} while (0)
@@ -138,7 +148,7 @@ static int print_frontend_stats(FILE *fd,
rc = dvb_fe_get_stats(parms);
if (rc) {
- PERROR("dvb_fe_get_stats failed");
+ PERROR(_("dvb_fe_get_stats failed"));
return -1;
}
@@ -149,25 +159,25 @@ static int print_frontend_stats(FILE *fd,
for (i = 0; i < MAX_DTV_STATS; i++) {
show = 1;
- dvb_fe_snprintf_stat(parms, DTV_QUALITY, "Quality",
+ dvb_fe_snprintf_stat(parms, DTV_QUALITY, _("Quality"),
i, &p, &len, &show);
- dvb_fe_snprintf_stat(parms, DTV_STAT_SIGNAL_STRENGTH, "Signal",
+ dvb_fe_snprintf_stat(parms, DTV_STAT_SIGNAL_STRENGTH, _("Signal"),
i, &p, &len, &show);
- dvb_fe_snprintf_stat(parms, DTV_STAT_CNR, "C/N",
+ dvb_fe_snprintf_stat(parms, DTV_STAT_CNR, _("C/N"),
i, &p, &len, &show);
- dvb_fe_snprintf_stat(parms, DTV_STAT_ERROR_BLOCK_COUNT, "UCB",
+ dvb_fe_snprintf_stat(parms, DTV_STAT_ERROR_BLOCK_COUNT, _("UCB"),
i, &p, &len, &show);
- dvb_fe_snprintf_stat(parms, DTV_BER, "postBER",
+ dvb_fe_snprintf_stat(parms, DTV_BER, _("postBER"),
i, &p, &len, &show);
- dvb_fe_snprintf_stat(parms, DTV_PRE_BER, "preBER",
+ dvb_fe_snprintf_stat(parms, DTV_PRE_BER, _("preBER"),
i, &p, &len, &show);
- dvb_fe_snprintf_stat(parms, DTV_PER, "PER",
+ dvb_fe_snprintf_stat(parms, DTV_PER, _("PER"),
i, &p, &len, &show);
if (p != buf) {
if (isatty(fileno(fd))) {
@@ -248,6 +258,10 @@ int main(int argc, char *argv[])
struct dvb_v5_fe_parms *parms;
int fe_flags = O_RDWR;
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
argp_parse(&argp, argc, argv, 0, 0, 0);
/*
@@ -266,7 +280,7 @@ int main(int argc, char *argv[])
return -1;
if (delsys) {
- printf("Changing delivery system to: %s\n",
+ printf(_("Changing delivery system to: %s\n"),
delivery_system_name[delsys]);
dvb_set_sys(parms, delsys);
goto ret;
diff --git a/utils/dvb/dvb-format-convert.c b/utils/dvb/dvb-format-convert.c
index d97bea2a..babf58bd 100644
--- a/utils/dvb/dvb-format-convert.c
+++ b/utils/dvb/dvb-format-convert.c
@@ -31,6 +31,16 @@
#include <config.h>
+#ifdef ENABLE_NLS
+# define _(string) gettext(string)
+# include "gettext.h"
+# include <locale.h>
+# include <langinfo.h>
+# include <iconv.h>
+#else
+# define _(string) string
+#endif
+
#include "libdvbv5/dvb-file.h"
#include "libdvbv5/dvb-demux.h"
#include "libdvbv5/dvb-scan.h"
@@ -77,16 +87,16 @@ static int convert_file(struct arguments *args)
struct dvb_file *dvb_file = NULL;
int ret;
- printf("Reading file %s\n", args->input_file);
+ printf(_("Reading file %s\n"), args->input_file);
dvb_file = dvb_read_file_format(args->input_file, args->delsys,
args->input_format);
if (!dvb_file) {
- fprintf(stderr, "Error reading file %s\n", args->input_file);
+ fprintf(stderr, _("Error reading file %s\n"), args->input_file);
return -1;
}
- printf("Writing file %s\n", args->output_file);
+ printf(_("Writing file %s\n"), args->output_file);
ret = dvb_write_file_format(args->output_file, dvb_file,
args->delsys, args->output_format);
dvb_file_free(dvb_file);
@@ -101,10 +111,14 @@ int main(int argc, char **argv)
const struct argp argp = {
.options = options,
.parser = parse_opt,
- .doc = "scan DVB services using the channel file",
- .args_doc = "<input file> <output file>",
+ .doc = _("scan DVB services using the channel file"),
+ .args_doc = _("<input file> <output file>"),
};
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
memset(&args, 0, sizeof(args));
argp_parse(&argp, argc, argv, 0, &idx, &args);
@@ -114,21 +128,21 @@ int main(int argc, char **argv)
}
if (args.input_format == FILE_UNKNOWN) {
- fprintf(stderr, "ERROR: Please specify a valid input format\n");
+ fprintf(stderr, _("ERROR: Please specify a valid input format\n"));
missing = 1;
} else if (!args.input_file) {
- fprintf(stderr, "ERROR: Please specify a valid input file\n");
+ fprintf(stderr, _("ERROR: Please specify a valid input file\n"));
missing = 1;
} else if (args.output_format == FILE_UNKNOWN) {
- fprintf(stderr, "ERROR: Please specify a valid output format\n");
+ fprintf(stderr, _("ERROR: Please specify a valid output format\n"));
missing = 1;
} else if (!args.output_file) {
- fprintf(stderr, "ERROR: Please specify a valid output file\n");
+ fprintf(stderr, _("ERROR: Please specify a valid output file\n"));
missing = 1;
} else if (((args.input_format == FILE_ZAP) ||
(args.output_format == FILE_ZAP)) &&
(args.delsys <= 0 || args.delsys == SYS_ISDBS)) {
- fprintf(stderr, "ERROR: Please specify a valid delivery system for ZAP format\n");
+ fprintf(stderr, _("ERROR: Please specify a valid delivery system for ZAP format\n"));
missing = 1;
}
if (missing) {
diff --git a/utils/dvb/dvbv5-scan.c b/utils/dvb/dvbv5-scan.c
index 2a853c85..d314d136 100644
--- a/utils/dvb/dvbv5-scan.c
+++ b/utils/dvb/dvbv5-scan.c
@@ -32,6 +32,16 @@
#include <config.h>
+#ifdef ENABLE_NLS
+# define _(string) gettext(string)
+# include "gettext.h"
+# include <locale.h>
+# include <langinfo.h>
+# include <iconv.h>
+#else
+# define _(string) string
+#endif
+
#include <linux/dvb/dmx.h>
#include "libdvbv5/dvb-file.h"
#include "libdvbv5/dvb-demux.h"
@@ -86,14 +96,14 @@ static int verbose = 0;
#define ERROR(x...) \
do { \
- fprintf(stderr, "ERROR: "); \
+ fprintf(stderr, _("ERROR: ")); \
fprintf(stderr, x); \
fprintf(stderr, "\n"); \
} while (0)
#define PERROR(x...) \
do { \
- fprintf(stderr, "ERROR: "); \
+ fprintf(stderr, _("ERROR: ")); \
fprintf(stderr, x); \
fprintf(stderr, " (%s)\n", strerror(errno)); \
} while (0)
@@ -128,25 +138,25 @@ static int print_frontend_stats(struct arguments *args,
for (i = 0; i < MAX_DTV_STATS; i++) {
show = 1;
- dvb_fe_snprintf_stat(parms, DTV_QUALITY, "Quality",
+ dvb_fe_snprintf_stat(parms, DTV_QUALITY, _("Quality"),
i, &p, &len, &show);
- dvb_fe_snprintf_stat(parms, DTV_STAT_SIGNAL_STRENGTH, "Signal",
+ dvb_fe_snprintf_stat(parms, DTV_STAT_SIGNAL_STRENGTH, _("Signal"),
i, &p, &len, &show);
- dvb_fe_snprintf_stat(parms, DTV_STAT_CNR, "C/N",
+ dvb_fe_snprintf_stat(parms, DTV_STAT_CNR, _("C/N"),
i, &p, &len, &show);
- dvb_fe_snprintf_stat(parms, DTV_STAT_ERROR_BLOCK_COUNT, "UCB",
+ dvb_fe_snprintf_stat(parms, DTV_STAT_ERROR_BLOCK_COUNT, _("UCB"),
i, &p, &len, &show);
- dvb_fe_snprintf_stat(parms, DTV_BER, "postBER",
+ dvb_fe_snprintf_stat(parms, DTV_BER, _("postBER"),
i, &p, &len, &show);
- dvb_fe_snprintf_stat(parms, DTV_PRE_BER, "preBER",
+ dvb_fe_snprintf_stat(parms, DTV_PRE_BER, _("preBER"),
i, &p, &len, &show);
- dvb_fe_snprintf_stat(parms, DTV_PER, "PER",
+ dvb_fe_snprintf_stat(parms, DTV_PER, _("PER"),
i, &p, &len, &show);
if (p != buf) {
@@ -180,7 +190,7 @@ static int check_frontend(void *__args,
return 0;
rc = dvb_fe_get_stats(parms);
if (rc)
- PERROR("dvb_fe_get_stats failed");
+ PERROR(_("dvb_fe_get_stats failed"));
rc = dvb_fe_retrieve_stats(parms, DTV_STATUS, &status);
if (rc)
@@ -236,7 +246,7 @@ static int run_scan(struct arguments *args,
dmx_fd = open(args->demux_dev, O_RDWR);
if (dmx_fd < 0) {
- perror("openening pat demux failed");
+ perror(_("openening pat demux failed"));
return -3;
}
@@ -263,7 +273,7 @@ static int run_scan(struct arguments *args,
continue;
count++;
- dvb_log("Scanning frequency #%d %d", count, freq);
+ dvb_log(_("Scanning frequency #%d %d"), count, freq);
/*
* update params->lnb only if it differs from entry->lnb
@@ -430,10 +440,14 @@ int main(int argc, char **argv)
const struct argp argp = {
.options = options,
.parser = parse_opt,
- .doc = "scan DVB services using the channel file",
- .args_doc = "<initial file>",
+ .doc = _("scan DVB services using the channel file"),
+ .args_doc = _("<initial file>"),
};
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
memset(&args, 0, sizeof(args));
args.sat_number = -1;
args.output = DEFAULT_OUTPUT;
@@ -455,11 +469,11 @@ int main(int argc, char **argv)
if (args.lnb_name) {
lnb = dvb_sat_search_lnb(args.lnb_name);
if (lnb < 0) {
- printf("Please select one of the LNBf's below:\n");
+ printf(_("Please select one of the LNBf's below:\n"));
dvb_print_all_lnb();
exit(1);
} else {
- printf("Using LNBf ");
+ printf(_("Using LNBf "));
dvb_print_lnb(lnb);
}
}
@@ -474,7 +488,7 @@ int main(int argc, char **argv)
if ((args.input_format == FILE_ZAP) ||
(args.input_format == FILE_UNKNOWN) ||
(args.output_format == FILE_UNKNOWN)) {
- fprintf(stderr, "ERROR: Please specify a valid format\n");
+ fprintf(stderr, _("ERROR: Please specify a valid format\n"));
argp_help(&argp, stderr, ARGP_HELP_STD_HELP, PROGRAM_NAME);
return -1;
}
@@ -482,12 +496,12 @@ int main(int argc, char **argv)
r = asprintf(&args.demux_dev,
"/dev/dvb/adapter%i/demux%i", args.adapter_dmx, args.demux);
if (r < 0) {
- fprintf(stderr, "asprintf error\n" );
+ fprintf(stderr, _("asprintf error\n") );
return -1;
}
if (verbose)
- fprintf(stderr, "using demux '%s'\n", args.demux_dev);
+ fprintf(stderr, _("using demux '%s'\n"), args.demux_dev);
struct dvb_v5_fe_parms *parms = dvb_fe_open(args.adapter_fe,
args.frontend,
@@ -505,7 +519,7 @@ int main(int argc, char **argv)
parms->lna = args.lna;
r = dvb_fe_set_default_country(parms, args.cc);
if (r < 0)
- fprintf(stderr, "Failed to set the country code:%s\n", args.cc);
+ fprintf(stderr, _("Failed to set the country code:%s\n"), args.cc);
timeout_flag = &parms->abort;
signal(SIGTERM, do_timeout);
diff --git a/utils/dvb/dvbv5-zap.c b/utils/dvb/dvbv5-zap.c
index 08db3e26..1b937073 100644
--- a/utils/dvb/dvbv5-zap.c
+++ b/utils/dvb/dvbv5-zap.c
@@ -36,6 +36,16 @@
#include <config.h>
+#ifdef ENABLE_NLS
+# define _(string) gettext(string)
+# include "gettext.h"
+# include <locale.h>
+# include <langinfo.h>
+# include <iconv.h>
+#else
+# define _(string) string
+#endif
+
#include <linux/dvb/dmx.h>
#include "libdvbv5/dvb-file.h"
#include "libdvbv5/dvb-demux.h"
@@ -99,14 +109,14 @@ static int timeout_flag = 0;
#define ERROR(x...) \
do { \
- fprintf(stderr, "ERROR: "); \
+ fprintf(stderr, _("ERROR: ")); \
fprintf(stderr, x); \
fprintf(stderr, "\n"); \
} while (0)
#define PERROR(x...) \
do { \
- fprintf(stderr, "ERROR: "); \
+ fprintf(stderr, _("ERROR: ")); \
fprintf(stderr, x); \
fprintf(stderr, " (%s)\n", strerror(errno)); \
} while (0)
@@ -187,7 +197,7 @@ static int parse(struct arguments *args,
}
if (!entry) {
- ERROR("Can't find channel");
+ ERROR(_("Can't find channel"));
dvb_file_free(dvb_file);
return -3;
}
@@ -201,7 +211,7 @@ static int parse(struct arguments *args,
if (entry->lnb && !parms->lnb) {
int lnb = dvb_sat_search_lnb(entry->lnb);
if (lnb == -1) {
- PERROR("unknown LNB %s\n", entry->lnb);
+ PERROR(_("unknown LNB %s\n"), entry->lnb);
dvb_file_free(dvb_file);
return -1;
}
@@ -227,7 +237,7 @@ static int parse(struct arguments *args,
type = entry->other_el_pid[i].type;
if (i)
fprintf(stderr, "\n");
- fprintf(stderr, "service has pid type %02x: ", type);
+ fprintf(stderr, _("service has pid type %02x: "), type);
}
fprintf(stderr, " %d", entry->other_el_pid[i].pid);
}
@@ -291,15 +301,15 @@ static int setup_frontend(struct arguments *args,
if (args->silent < 2) {
rc = dvb_fe_retrieve_parm(parms, DTV_FREQUENCY, &freq);
if (rc < 0) {
- PERROR("can't get the frequency");
+ PERROR(_("can't get the frequency"));
return -1;
}
- fprintf(stderr, "tuning to %i Hz\n", freq);
+ fprintf(stderr, _("tuning to %i Hz\n"), freq);
}
rc = dvb_fe_set_parms(parms);
if (rc < 0) {
- PERROR("dvb_fe_set_parms failed");
+ PERROR(_("dvb_fe_set_parms failed"));
return -1;
}
@@ -336,7 +346,7 @@ static int print_frontend_stats(FILE *fd,
rc = dvb_fe_get_stats(parms);
if (rc) {
- PERROR("dvb_fe_get_stats failed");
+ PERROR(_("dvb_fe_get_stats failed"));
return -1;
}
@@ -347,25 +357,25 @@ static int print_frontend_stats(FILE *fd,
for (i = 0; i < MAX_DTV_STATS; i++) {
show = 1;
- dvb_fe_snprintf_stat(parms, DTV_QUALITY, "Quality",
+ dvb_fe_snprintf_stat(parms, DTV_QUALITY, _("Quality"),
i, &p, &len, &show);
- dvb_fe_snprintf_stat(parms, DTV_STAT_SIGNAL_STRENGTH, "Signal",
+ dvb_fe_snprintf_stat(parms, DTV_STAT_SIGNAL_STRENGTH, _("Signal"),
i, &p, &len, &show);
- dvb_fe_snprintf_stat(parms, DTV_STAT_CNR, "C/N",
+ dvb_fe_snprintf_stat(parms, DTV_STAT_CNR, _("C/N"),
i, &p, &len, &show);
- dvb_fe_snprintf_stat(parms, DTV_STAT_ERROR_BLOCK_COUNT, "UCB",
+ dvb_fe_snprintf_stat(parms, DTV_STAT_ERROR_BLOCK_COUNT, _("UCB"),
i, &p, &len, &show);
- dvb_fe_snprintf_stat(parms, DTV_BER, "postBER",
+ dvb_fe_snprintf_stat(parms, DTV_BER, _("postBER"),
i, &p, &len, &show);
- dvb_fe_snprintf_stat(parms, DTV_PRE_BER, "preBER",
+ dvb_fe_snprintf_stat(parms, DTV_PRE_BER, _("preBER"),
i, &p, &len, &show);
- dvb_fe_snprintf_stat(parms, DTV_PER, "PER",
+ dvb_fe_snprintf_stat(parms, DTV_PER, _("PER"),
i, &p, &len, &show);
if (p != buf) {
@@ -399,7 +409,7 @@ static int check_frontend(struct arguments *args,
do {
rc = dvb_fe_get_stats(parms);
if (rc) {
- PERROR("dvb_fe_get_stats failed");
+ PERROR(_("dvb_fe_get_stats failed"));
usleep(1000000);
continue;
}
@@ -444,20 +454,20 @@ static void copy_to_file(int in_fd, int out_fd, int timeout, int silent)
r = read(in_fd, buf, BUFLEN);
if (r < 0) {
if (errno == EOVERFLOW) {
- fprintf(stderr, "buffer overrun\n");
+ fprintf(stderr, _("buffer overrun\n"));
continue;
}
- PERROR("Read failed");
+ PERROR(_("Read failed"));
break;
}
if (write(out_fd, buf, r) < 0) {
- PERROR("Write failed");
+ PERROR(_("Write failed"));
break;
}
rc += r;
}
if (silent < 2) {
- fprintf(stderr, "copied %lld bytes (%lld Kbytes/sec)\n", rc,
+ fprintf(stderr, _("copied %lld bytes (%lld Kbytes/sec)\n"), rc,
rc / (1024 * timeout));
}
}
@@ -578,24 +588,24 @@ int do_traffic_monitor(struct arguments *args,
check_frontend(args, parms);
if ((dvr_fd = open(args->dvr_dev, O_RDONLY)) < 0) {
- PERROR("failed opening '%s'", args->dvr_dev);
+ PERROR(_("failed opening '%s'"), args->dvr_dev);
return -1;
}
if (ioctl(dvr_fd, DMX_SET_BUFFER_SIZE, 1024 * 1024) == -1)
- perror("DMX_SET_BUFFER_SIZE failed");
+ perror(_("DMX_SET_BUFFER_SIZE failed"));
if ((fd = open(args->demux_dev, O_RDWR)) < 0) {
- PERROR("failed opening '%s'", args->demux_dev);
+ PERROR(_("failed opening '%s'"), args->demux_dev);
close(dvr_fd);
return -1;
}
if (args->silent < 2)
- fprintf(stderr, " dvb_set_pesfilter to 0x2000\n");
+ fprintf(stderr, _(" dvb_set_pesfilter to 0x2000\n"));
if (dvb_set_pesfilter(fd, 0x2000, DMX_PES_OTHER,
DMX_OUT_TS_TAP, 0) < 0) {
- PERROR("couldn't set filter");
+ PERROR(_("couldn't set filter"));
return -1;
}
@@ -619,14 +629,14 @@ int do_traffic_monitor(struct arguments *args,
diff =
(now.tv_sec - startt.tv_sec) * 1000 +
(now.tv_usec - startt.tv_usec) / 1000;
- fprintf(stderr, "%.2fs: buffer overrun\n", diff / 1000.);
+ fprintf(stderr, _("%.2fs: buffer overrun\n"), diff / 1000.);
continue;
}
- perror("read");
+ perror(_("read"));
break;
}
if (r != BSIZE) {
- fprintf(stderr, "dvbtraffic: only read %zd bytes\n", r);
+ fprintf(stderr, _("dvbtraffic: only read %zd bytes\n"), r);
break;
}
@@ -678,7 +688,7 @@ int do_traffic_monitor(struct arguments *args,
printf("\x1b[1H\x1b[2J");
args->n_status_lines = 0;
- printf(" PID FREQ SPEED TOTAL\n");
+ printf(_(" PID FREQ SPEED TOTAL\n"));
int _pid = 0;
for (_pid = 0; _pid < 0x2000; _pid++) {
if (pidt[_pid]) {
@@ -727,8 +737,8 @@ int main(int argc, char **argv)
const struct argp argp = {
.options = options,
.parser = parse_opt,
- .doc = "DVB zap utility",
- .args_doc = "<channel name> [or <frequency> if in monitor mode]",
+ .doc = _("DVB zap utility"),
+ .args_doc = _("<channel name> [or <frequency> if in monitor mode]"),
};
memset(&args, 0, sizeof(args));
@@ -747,13 +757,13 @@ int main(int argc, char **argv)
}
if (args.input_format == FILE_UNKNOWN) {
- fprintf(stderr, "ERROR: Please specify a valid format\n");
+ fprintf(stderr, _("ERROR: Please specify a valid format\n"));
argp_help(&argp, stderr, ARGP_HELP_STD_HELP, PROGRAM_NAME);
return -1;
}
if (!args.traffic_monitor && args.search) {
- fprintf(stderr, "ERROR: search string can be used only on monitor mode\n");
+ fprintf(stderr, _("ERROR: search string can be used only on monitor mode\n"));
argp_help(&argp, stderr, ARGP_HELP_STD_HELP, PROGRAM_NAME);
return -1;
}
@@ -761,11 +771,11 @@ int main(int argc, char **argv)
if (args.lnb_name) {
lnb = dvb_sat_search_lnb(args.lnb_name);
if (lnb < 0) {
- printf("Please select one of the LNBf's below:\n");
+ printf(_("Please select one of the LNBf's below:\n"));
dvb_print_all_lnb();
exit(1);
} else {
- printf("Using LNBf ");
+ printf(_("Using LNBf "));
dvb_print_lnb(lnb);
}
}
@@ -773,23 +783,23 @@ int main(int argc, char **argv)
r = asprintf(&args.demux_dev,
"/dev/dvb/adapter%i/demux%i", args.adapter, args.demux);
if (r < 0) {
- fprintf(stderr, "asprintf error\n");
+ fprintf(stderr, _("asprintf error\n"));
return -1;
}
r = asprintf(&args.dvr_dev,
"/dev/dvb/adapter%i/dvr%i", args.adapter, args.demux);
if (r < 0) {
- fprintf(stderr, "asprintf error\n");
+ fprintf(stderr, _("asprintf error\n"));
return -1;
}
if (args.silent < 2)
- fprintf(stderr, "using demux '%s'\n", args.demux_dev);
+ fprintf(stderr, _("using demux '%s'\n"), args.demux_dev);
if (!args.confname) {
if (!homedir)
- ERROR("$HOME not set");
+ ERROR(_("$HOME not set"));
r = asprintf(&args.confname, "%s/.tzap/%i/%s",
homedir, args.adapter, CHANNEL_FILE);
if (access(args.confname, R_OK)) {
@@ -798,7 +808,7 @@ int main(int argc, char **argv)
homedir, CHANNEL_FILE);
}
}
- fprintf(stderr, "reading channels from file '%s'\n", args.confname);
+ fprintf(stderr, _("reading channels from file '%s'\n"), args.confname);
parms = dvb_fe_open(args.adapter, args.frontend, args.verbose, args.force_dvbv3);
if (!parms)
@@ -813,7 +823,7 @@ int main(int argc, char **argv)
r = dvb_fe_set_default_country(parms, args.cc);
if (r < 0)
- fprintf(stderr, "Failed to set the country code:%s\n", args.cc);
+ fprintf(stderr, _("Failed to set the country code:%s\n"), args.cc);
if (parse(&args, parms, channel, &vpid, &apid, &sid))
goto err;
@@ -841,27 +851,27 @@ int main(int argc, char **argv)
if (args.rec_psi) {
if (sid < 0) {
- fprintf(stderr, "Service id 0x%04x was not specified at the file\n",
+ fprintf(stderr, _("Service id 0x%04x was not specified at the file\n"),
sid);
goto err;
}
sid_fd = dvb_dmx_open(args.adapter, args.demux);
if (sid_fd < 0) {
- perror("opening pat demux failed");
+ perror(_("opening pat demux failed"));
return -1;
}
pmtpid = dvb_get_pmt_pid(sid_fd, sid);
dvb_dmx_close(sid_fd);
if (pmtpid <= 0) {
- fprintf(stderr, "couldn't find pmt-pid for sid %04x\n",
+ fprintf(stderr, _("couldn't find pmt-pid for sid %04x\n"),
sid);
goto err;
}
if ((pat_fd = open(args.demux_dev, O_RDWR)) < 0) {
- perror("opening pat demux failed");
+ perror(_("opening pat demux failed"));
goto err;
}
if (dvb_set_pesfilter(pat_fd, 0, DMX_PES_OTHER,
@@ -870,7 +880,7 @@ int main(int argc, char **argv)
goto err;
if ((pmt_fd = open(args.demux_dev, O_RDWR)) < 0) {
- perror("opening pmt demux failed");
+ perror(_("opening pmt demux failed"));
goto err;
}
if (dvb_set_pesfilter(pmt_fd, pmtpid, DMX_PES_OTHER,
@@ -886,20 +896,20 @@ int main(int argc, char **argv)
if (vpid >= 0) {
if (args.silent < 2) {
if (vpid == 0x2000)
- fprintf(stderr, "pass all PID's to TS\n");
+ fprintf(stderr, _("pass all PID's to TS\n"));
else
- fprintf(stderr, "video pid %d\n", vpid);
+ fprintf(stderr, _("video pid %d\n"), vpid);
}
if ((video_fd = open(args.demux_dev, O_RDWR)) < 0) {
- PERROR("failed opening '%s'", args.demux_dev);
+ PERROR(_("failed opening '%s'"), args.demux_dev);
goto err;
}
if (args.silent < 2)
- fprintf(stderr, " dvb_set_pesfilter %d\n", vpid);
+ fprintf(stderr, _(" dvb_set_pesfilter %d\n"), vpid);
if (vpid == 0x2000) {
if (ioctl(video_fd, DMX_SET_BUFFER_SIZE, 1024 * 1024) == -1)
- perror("DMX_SET_BUFFER_SIZE failed");
+ perror(_("DMX_SET_BUFFER_SIZE failed"));
if (dvb_set_pesfilter(video_fd, vpid, DMX_PES_OTHER,
DMX_OUT_TS_TAP, 0) < 0)
goto err;
@@ -913,13 +923,13 @@ int main(int argc, char **argv)
if (apid > 0) {
if (args.silent < 2)
- fprintf(stderr, "audio pid %d\n", apid);
+ fprintf(stderr, _("audio pid %d\n"), apid);
if ((audio_fd = open(args.demux_dev, O_RDWR)) < 0) {
- PERROR("failed opening '%s'", args.demux_dev);
+ PERROR(_("failed opening '%s'"), args.demux_dev);
goto err;
}
if (args.silent < 2)
- fprintf(stderr, " dvb_set_pesfilter %d\n", apid);
+ fprintf(stderr, _(" dvb_set_pesfilter %d\n"), apid);
if (dvb_set_pesfilter(audio_fd, apid, DMX_PES_AUDIO,
args.dvr ? DMX_OUT_TS_TAP : DMX_OUT_DECODER,
args.dvr ? 64 * 1024 : 0) < 0)
@@ -935,7 +945,7 @@ int main(int argc, char **argv)
if (!check_frontend(&args, parms)) {
err = 1;
- fprintf(stderr, "frontend doesn't lock\n");
+ fprintf(stderr, _("frontend doesn't lock\n"));
goto err;
}
@@ -951,7 +961,7 @@ int main(int argc, char **argv)
O_WRONLY | O_CREAT,
0644);
if (file_fd < 0) {
- PERROR("open of '%s' failed",
+ PERROR(_("open of '%s' failed"),
args.filename);
return -1;
}
@@ -963,15 +973,15 @@ int main(int argc, char **argv)
if (file_fd >= 0) {
if ((dvr_fd = open(args.dvr_dev, O_RDONLY)) < 0) {
- PERROR("failed opening '%s'", args.dvr_dev);
+ PERROR(_("failed opening '%s'"), args.dvr_dev);
goto err;
}
if (!timeout_flag)
- fprintf(stderr, "Record to file '%s' started\n", args.filename);
+ fprintf(stderr, _("Record to file '%s' started\n"), args.filename);
copy_to_file(dvr_fd, file_fd, args.timeout, args.silent);
} else {
if (!timeout_flag)
- fprintf(stderr, "DVR interface '%s' can now be opened\n", args.dvr_dev);
+ fprintf(stderr, _("DVR interface '%s' can now be opened\n"), args.dvr_dev);
get_show_stats(&args, parms, 1);
}

Privacy Policy