diff options
author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-12-12 23:48:55 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-12-13 00:19:34 -0200 |
commit | 974b5145e39673ed5634418af65cffc04f333dea (patch) | |
tree | 8c70d83eb1fb9ebf7b3267def7cad271bafe60cb | |
parent | 6fc56d9a26799f8bb8f0a9fe19ee5e0763018da9 (diff) |
dvb: add locale messages also for argp strings
argp strings don't need gettext, as this is already called
internally.
All we need is to define a macro for xgettext to handle,
in order to allow detecting the strings used by argp.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r-- | utils/dvb/dvb-fe-tool.c | 25 | ||||
-rw-r--r-- | utils/dvb/dvb-format-convert.c | 12 | ||||
-rw-r--r-- | utils/dvb/dvbv5-scan.c | 44 | ||||
-rw-r--r-- | utils/dvb/dvbv5-zap.c | 56 |
4 files changed, 73 insertions, 64 deletions
diff --git a/utils/dvb/dvb-fe-tool.c b/utils/dvb/dvb-fe-tool.c index 2f2f666f..00dc779e 100644 --- a/utils/dvb/dvb-fe-tool.c +++ b/utils/dvb/dvb-fe-tool.c @@ -36,28 +36,31 @@ # define _(string) string #endif +# define N_(string) string + #define PROGRAM_NAME "dvb-fe-tool" const char *argp_program_version = PROGRAM_NAME " version " V4L_UTILS_VERSION; const char *argp_program_bug_address = "Mauro Carvalho Chehab <m.chehab@samsung.com>"; -static const char doc[] = "\nA DVB frontend tool using API version 5\n" +static const char doc[] = N_( + "\nA DVB frontend tool using API version 5\n" "\nOn the options bellow, the arguments are:\n" " ADAPTER - the dvb adapter to control\n" - " FRONTEND - the dvb frontend to control"; + " FRONTEND - the dvb frontend to control"); static const struct argp_option options[] = { - {"verbose", 'v', 0, 0, "enables debug messages", 0}, - {"adapter", 'a', "ADAPTER", 0, "dvb adapter", 0}, - {"frontend", 'f', "FRONTEND", 0, "dvb frontend", 0}, - {"set-delsys", 'd', "PARAMS", 0, "set delivery system", 0}, - {"femon", 'm', 0, 0, "monitors frontend stats on an streaming frontend", 0}, - {"acoustical", 'A', 0, 0, "bips if signal quality is good. Also enables femon mode. Please notice that console bip should be enabled on your wm.", 0}, + {"verbose", 'v', 0, 0, N_("enables debug messages"), 0}, + {"adapter", 'a', N_("ADAPTER"), 0, N_("dvb adapter"), 0}, + {"frontend", 'f', N_("FRONTEND"), 0, N_("dvb frontend"), 0}, + {"set-delsys", 'd', N_("PARAMS"), 0, N_("set delivery system"), 0}, + {"femon", 'm', 0, 0, N_("monitors frontend stats on an streaming frontend"), 0}, + {"acoustical", 'A', 0, 0, N_("bips if signal quality is good. Also enables femon mode. Please notice that console bip should be enabled on your wm."), 0}, #if 0 /* Currently not implemented */ - {"set", 's', "PARAMS", 0, "set frontend", 0}, + {"set", 's', N_("PARAMS"), 0, N_("set frontend"), 0}, #endif - {"get", 'g', 0, 0, "get frontend", 0}, - {"dvbv3", '3', 0, 0, "Use DVBv3 only", 0}, + {"get", 'g', 0, 0, N_("get frontend"), 0}, + {"dvbv3", '3', 0, 0, N_("Use DVBv3 only"), 0}, { 0, 0, 0, 0, 0, 0 } }; diff --git a/utils/dvb/dvb-format-convert.c b/utils/dvb/dvb-format-convert.c index babf58bd..b30ebb4e 100644 --- a/utils/dvb/dvb-format-convert.c +++ b/utils/dvb/dvb-format-convert.c @@ -41,6 +41,8 @@ # define _(string) string #endif +# define N_(string) string + #include "libdvbv5/dvb-file.h" #include "libdvbv5/dvb-demux.h" #include "libdvbv5/dvb-scan.h" @@ -54,9 +56,9 @@ struct arguments { }; static const struct argp_option options[] = { - {"input-format", 'I', "format", 0, "Valid input formats: ZAP, CHANNEL, DVBV5", 0}, - {"output-format", 'O', "format", 0, "Valid output formats: VDR, ZAP, CHANNEL, DVBV5", 0}, - {"delsys", 's', "system", 0, "Delivery system type. Needed if input or output format is ZAP", 0}, + {"input-format", 'I', N_("format"), 0, N_("Valid input formats: ZAP, CHANNEL, DVBV5"), 0}, + {"output-format", 'O', N_("format"), 0, N_("Valid output formats: VDR, ZAP, CHANNEL, DVBV5"), 0}, + {"delsys", 's', N_("system"), 0, N_("Delivery system type. Needed if input or output format is ZAP"), 0}, { 0, 0, 0, 0, 0, 0 } }; @@ -111,8 +113,8 @@ 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 = N_("scan DVB services using the channel file"), + .args_doc = N_("<input file> <output file>"), }; setlocale (LC_ALL, ""); diff --git a/utils/dvb/dvbv5-scan.c b/utils/dvb/dvbv5-scan.c index d314d136..b2f02795 100644 --- a/utils/dvb/dvbv5-scan.c +++ b/utils/dvb/dvbv5-scan.c @@ -42,6 +42,8 @@ # define _(string) string #endif +# define N_(string) string + #include <linux/dvb/dmx.h> #include "libdvbv5/dvb-file.h" #include "libdvbv5/dvb-demux.h" @@ -69,25 +71,25 @@ struct arguments { }; static const struct argp_option options[] = { - {"adapter", 'a', "adapter#", 0, "use given adapter (default 0)", 0}, - {"frontend", 'f', "frontend#", 0, "use given frontend (default 0)", 0}, - {"demux", 'd', "demux#", 0, "use given demux (default 0)", 0}, - {"lnbf", 'l', "LNBf_type", 0, "type of LNBf to use. 'help' lists the available ones", 0}, - {"lna", 'w', "LNA (0, 1, -1)", 0, "enable/disable/auto LNA power", 0}, - {"sat_number", 'S', "satellite_number", 0, "satellite number. If not specified, disable DISEqC", 0}, - {"freq_bpf", 'U', "frequency", 0, "SCR/Unicable band-pass filter frequency to use, in kHz", 0}, - {"wait", 'W', "time", 0, "adds additional wait time for DISEqC command completion", 0}, - {"nit", 'N', NULL, 0, "use data from NIT table on the output file", 0}, - {"get_frontend",'G', NULL, 0, "use data from get_frontend on the output file", 0}, - {"verbose", 'v', NULL, 0, "be (very) verbose", 0}, - {"output", 'o', "file", 0, "output filename (default: " DEFAULT_OUTPUT ")", 0}, - {"file-freqs-only", 'F', NULL, 0, "don't use the other frequencies discovered during scan", 0}, - {"timeout-multiply", 'T', "factor", 0, "Multiply scan timeouts by this factor", 0}, - {"parse-other-nit", 'p', NULL, 0, "Parse the other NIT/SDT tables", 0}, - {"input-format", 'I', "format", 0, "Input format: CHANNEL, DVBV5 (default: DVBV5)", 0}, - {"output-format", 'O', "format", 0, "Output format: VDR, CHANNEL, ZAP, DVBV5 (default: DVBV5)", 0}, - {"dvbv3", '3', 0, 0, "Use DVBv3 only", 0}, - {"cc", 'C', "country_code", 0, "use default parameters for given country", 0}, + {"adapter", 'a', N_("adapter#"), 0, N_("use given adapter (default 0)"), 0}, + {"frontend", 'f', N_("frontend#"), 0, N_("use given frontend (default 0)"), 0}, + {"demux", 'd', N_("demux#"), 0, N_("use given demux (default 0)"), 0}, + {"lnbf", 'l', N_("LNBf_type"), 0, N_("type of LNBf to use. 'help' lists the available ones"), 0}, + {"lna", 'w', N_("LNA (0, 1, -1)"), 0, N_("enable/disable/auto LNA power"), 0}, + {"sat_number", 'S', N_("satellite_number"), 0, N_("satellite number. If not specified, disable DISEqC"), 0}, + {"freq_bpf", 'U', N_("frequency"), 0, N_("SCR/Unicable band-pass filter frequency to use, in kHz"), 0}, + {"wait", 'W', N_("time"), 0, N_("adds additional wait time for DISEqC command completion"), 0}, + {"nit", 'N', NULL, 0, N_("use data from NIT table on the output file"), 0}, + {"get_frontend",'G', NULL, 0, N_("use data from get_frontend on the output file"), 0}, + {"verbose", 'v', NULL, 0, N_("be (very) verbose"), 0}, + {"output", 'o', N_("file"), 0, N_("output filename (default: ") DEFAULT_OUTPUT ")", 0}, + {"file-freqs-only", 'F', NULL, 0, N_("don't use the other frequencies discovered during scan"), 0}, + {"timeout-multiply", 'T', N_("factor"), 0, N_("Multiply scan timeouts by this factor"), 0}, + {"parse-other-nit", 'p', NULL, 0, N_("Parse the other NIT/SDT tables"), 0}, + {"input-format", 'I', N_("format"), 0, N_("Input format: CHANNEL, DVBV5 (default: DVBV5)"), 0}, + {"output-format", 'O', N_("format"), 0, N_("Output format: VDR, CHANNEL, ZAP, DVBV5 (default: DVBV5)"), 0}, + {"dvbv3", '3', 0, 0, N_("Use DVBv3 only"), 0}, + {"cc", 'C', N_("country_code"), 0, N_("use default parameters for given country"), 0}, { 0, 0, 0, 0, 0, 0 } }; @@ -440,8 +442,8 @@ 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 = N_("scan DVB services using the channel file"), + .args_doc = N_("<initial file>"), }; setlocale (LC_ALL, ""); diff --git a/utils/dvb/dvbv5-zap.c b/utils/dvb/dvbv5-zap.c index 1b937073..794d9709 100644 --- a/utils/dvb/dvbv5-zap.c +++ b/utils/dvb/dvbv5-zap.c @@ -46,6 +46,8 @@ # define _(string) string #endif +# define N_(string) string + #include <linux/dvb/dmx.h> #include "libdvbv5/dvb-file.h" #include "libdvbv5/dvb-demux.h" @@ -77,31 +79,31 @@ struct arguments { }; static const struct argp_option options[] = { - {"dvbv3", '3', NULL, 0, "Use DVBv3 only", 0}, - {"adapter", 'a', "adapter#", 0, "use given adapter (default 0)", 0}, - {"audio_pid", 'A', "audio_pid#", 0, "audio pid program to use (default 0)", 0}, - {"channels", 'c', "file", 0, "read channels list from 'file'", 0}, - {"demux", 'd', "demux#", 0, "use given demux (default 0)", 0}, - {"frontend", 'f', "frontend#", 0, "use given frontend (default 0)", 0}, - {"input-format", 'I', "format", 0, "Input format: ZAP, CHANNEL, DVBV5 (default: DVBV5)", 0}, - {"lna", 'w', "LNA (0, 1, -1)", 0, "enable/disable/auto LNA power", 0}, - {"lnbf", 'l', "LNBf_type", 0, "type of LNBf to use. 'help' lists the available ones", 0}, - {"search", 'L', "string", 0, "search/look for a string inside the traffic", 0}, - {"monitor", 'm', NULL, 0, "monitors de DVB traffic", 0}, - {"output", 'o', "file", 0, "output filename (use -o - for stdout)", 0}, - {"pat", 'p', NULL, 0, "add pat and pmt to TS recording (implies -r)", 0}, - {"all-pids", 'P', NULL, 0, "don't filter any pids. Instead, outputs all of them", 0 }, - {"record", 'r', NULL, 0, "set up /dev/dvb/adapterX/dvr0 for TS recording", 0}, - {"silence", 's', NULL, 0, "increases silence (can be used more than once)", 0}, - {"sat_number", 'S', "satellite_number", 0, "satellite number. If not specified, disable DISEqC", 0}, - {"timeout", 't', "seconds", 0, "timeout for zapping and for recording", 0}, - {"freq_bpf", 'U', "frequency", 0, "SCR/Unicable band-pass filter frequency to use, in kHz", 0}, - {"verbose", 'v', NULL, 0, "verbose debug messages (can be used more than once)", 0}, - {"video_pid", 'V', "video_pid#", 0, "video pid program to use (default 0)", 0}, - {"wait", 'W', "time", 0, "adds additional wait time for DISEqC command completion", 0}, - {"exit", 'x', NULL, 0, "exit after tuning", 0}, - {"low_traffic", 'X', NULL, 0, "also shows DVB traffic with less then 1 packet per second", 0}, - {"cc", 'C', "country_code", 0, "use default parameters for given country", 0}, + {"dvbv3", '3', NULL, 0, N_("Use DVBv3 only"), 0}, + {"adapter", 'a', N_("adapter#"), 0, N_("use given adapter (default 0)"), 0}, + {"audio_pid", 'A', N_("audio_pid#"), 0, N_("audio pid program to use (default 0)"), 0}, + {"channels", 'c', N_("file"), 0, N_("read channels list from 'file'"), 0}, + {"demux", 'd', N_("demux#"), 0, N_("use given demux (default 0)"), 0}, + {"frontend", 'f', N_("frontend#"), 0, N_("use given frontend (default 0)"), 0}, + {"input-format", 'I', N_("format"), 0, N_("Input format: ZAP, CHANNEL, DVBV5 (default: DVBV5)"), 0}, + {"lna", 'w', N_("LNA (0, 1, -1)"), 0, N_("enable/disable/auto LNA power"), 0}, + {"lnbf", 'l', N_("LNBf_type"), 0, N_("type of LNBf to use. 'help' lists the available ones"), 0}, + {"search", 'L', N_("string"), 0, N_("search/look for a string inside the traffic"), 0}, + {"monitor", 'm', NULL, 0, N_("monitors de DVB traffic"), 0}, + {"output", 'o', N_("file"), 0, N_("output filename (use -o - for stdout)"), 0}, + {"pat", 'p', NULL, 0, N_("add pat and pmt to TS recording (implies -r)"), 0}, + {"all-pids", 'P', NULL, 0, N_("don't filter any pids. Instead, outputs all of them"), 0 }, + {"record", 'r', NULL, 0, N_("set up /dev/dvb/adapterX/dvr0 for TS recording"), 0}, + {"silence", 's', NULL, 0, N_("increases silence (can be used more than once)"), 0}, + {"sat_number", 'S', N_("satellite_number"), 0, N_("satellite number. If not specified, disable DISEqC"), 0}, + {"timeout", 't', N_("seconds"), 0, N_("timeout for zapping and for recording"), 0}, + {"freq_bpf", 'U', N_("frequency"), 0, N_("SCR/Unicable band-pass filter frequency to use, in kHz"), 0}, + {"verbose", 'v', NULL, 0, N_("verbose debug messages (can be used more than once)"), 0}, + {"video_pid", 'V', N_("video_pid#"), 0, N_("video pid program to use (default 0)"), 0}, + {"wait", 'W', N_("time"), 0, N_("adds additional wait time for DISEqC command completion"), 0}, + {"exit", 'x', NULL, 0, N_("exit after tuning"), 0}, + {"low_traffic", 'X', NULL, 0, N_("also shows DVB traffic with less then 1 packet per second"), 0}, + {"cc", 'C', N_("country_code"), 0, N_("use default parameters for given country"), 0}, { 0, 0, 0, 0, 0, 0 } }; @@ -737,8 +739,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 = N_("DVB zap utility"), + .args_doc = N_("<channel name> [or <frequency> if in monitor mode]"), }; memset(&args, 0, sizeof(args)); |