summaryrefslogtreecommitdiff
path: root/fc-match/fc-match.c
diff options
context:
space:
mode:
Diffstat (limited to 'fc-match/fc-match.c')
-rw-r--r--fc-match/fc-match.c46
1 files changed, 27 insertions, 19 deletions
diff --git a/fc-match/fc-match.c b/fc-match/fc-match.c
index 88f4ac8..7902707 100644
--- a/fc-match/fc-match.c
+++ b/fc-match/fc-match.c
@@ -37,6 +37,14 @@
#include <stdlib.h>
#include <string.h>
+#ifdef ENABLE_NLS
+#include <libintl.h>
+#define _(x) (dgettext(GETTEXT_PACKAGE, x))
+#else
+#define dgettext(d, s) (s)
+#define _(x) (x)
+#endif
+
#ifndef HAVE_GETOPT
#define HAVE_GETOPT 0
#endif
@@ -70,30 +78,30 @@ usage (char *program, int error)
{
FILE *file = error ? stderr : stdout;
#if HAVE_GETOPT_LONG
- fprintf (file, "usage: %s [-savbVh] [-f FORMAT] [--sort] [--all] [--verbose] [--brief] [--format=FORMAT] [--version] [--help] [pattern] {element...}\n",
+ fprintf (file, _("usage: %s [-savbVh] [-f FORMAT] [--sort] [--all] [--verbose] [--brief] [--format=FORMAT] [--version] [--help] [pattern] {element...}\n"),
program);
#else
- fprintf (file, "usage: %s [-savVh] [-f FORMAT] [pattern] {element...}\n",
+ fprintf (file, _("usage: %s [-savVh] [-f FORMAT] [pattern] {element...}\n"),
program);
#endif
- fprintf (file, "List best font matching [pattern]\n");
+ fprintf (file, _("List best font matching [pattern]\n"));
fprintf (file, "\n");
#if HAVE_GETOPT_LONG
- fprintf (file, " -s, --sort display sorted list of matches\n");
- fprintf (file, " -a, --all display unpruned sorted list of matches\n");
- fprintf (file, " -v, --verbose display entire font pattern verbosely\n");
- fprintf (file, " -b, --brief display entire font pattern briefly\n");
- fprintf (file, " -f, --format=FORMAT use the given output format\n");
- fprintf (file, " -V, --version display font config version and exit\n");
- fprintf (file, " -h, --help display this help and exit\n");
+ fprintf (file, _(" -s, --sort display sorted list of matches\n"));
+ fprintf (file, _(" -a, --all display unpruned sorted list of matches\n"));
+ fprintf (file, _(" -v, --verbose display entire font pattern verbosely\n"));
+ fprintf (file, _(" -b, --brief display entire font pattern briefly\n"));
+ fprintf (file, _(" -f, --format=FORMAT use the given output format\n"));
+ fprintf (file, _(" -V, --version display font config version and exit\n"));
+ fprintf (file, _(" -h, --help display this help and exit\n"));
#else
- fprintf (file, " -s, (sort) display sorted list of matches\n");
- fprintf (file, " -a (all) display unpruned sorted list of matches\n");
- fprintf (file, " -v (verbose) display entire font pattern verbosely\n");
- fprintf (file, " -b (brief) display entire font pattern briefly\n");
- fprintf (file, " -f FORMAT (format) use the given output format\n");
- fprintf (file, " -V (version) display font config version and exit\n");
- fprintf (file, " -h (help) display this help and exit\n");
+ fprintf (file, _(" -s, (sort) display sorted list of matches\n"));
+ fprintf (file, _(" -a (all) display unpruned sorted list of matches\n"));
+ fprintf (file, _(" -v (verbose) display entire font pattern verbosely\n"));
+ fprintf (file, _(" -b (brief) display entire font pattern briefly\n"));
+ fprintf (file, _(" -f FORMAT (format) use the given output format\n"));
+ fprintf (file, _(" -V (version) display font config version and exit\n"));
+ fprintf (file, _(" -h (help) display this help and exit\n"));
#endif
exit (error);
}
@@ -155,7 +163,7 @@ main (int argc, char **argv)
pat = FcNameParse ((FcChar8 *) argv[i]);
if (!pat)
{
- fputs ("Unable to parse the pattern\n", stderr);
+ fprintf (stderr, _("Unable to parse the pattern\n"));
return 1;
}
while (argv[++i])
@@ -184,7 +192,7 @@ main (int argc, char **argv)
if (!font_patterns || font_patterns->nfont == 0)
{
- fputs("No fonts installed on the system\n", stderr);
+ fprintf (stderr, _("No fonts installed on the system\n"));
return 1;
}
for (j = 0; j < font_patterns->nfont; j++)