diff options
Diffstat (limited to 'fc-cat/fc-cat.c')
-rw-r--r-- | fc-cat/fc-cat.c | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/fc-cat/fc-cat.c b/fc-cat/fc-cat.c index a1dc848b..dfe30d76 100644 --- a/fc-cat/fc-cat.c +++ b/fc-cat/fc-cat.c @@ -41,6 +41,14 @@ #include <sys/stat.h> #include <errno.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 @@ -148,27 +156,27 @@ usage (char *program, int error) { FILE *file = error ? stderr : stdout; #if HAVE_GETOPT_LONG - fprintf (file, "usage: %s [-rv] [--recurse] [--verbose] [*-%s" FC_CACHE_SUFFIX "|directory]...\n", + fprintf (file, _("usage: %s [-rv] [--recurse] [--verbose] [*-%s" FC_CACHE_SUFFIX "|directory]...\n"), program, FC_ARCHITECTURE); fprintf (file, " %s [-Vh] [--version] [--help]\n", program); #else - fprintf (file, "usage: %s [-rvVh] [*-%s" FC_CACHE_SUFFIX "|directory]...\n", + fprintf (file, _("usage: %s [-rvVh] [*-%s" FC_CACHE_SUFFIX "|directory]...\n"), program, FC_ARCHITECTURE); #endif - fprintf (file, "Reads font information cache from:\n"); - fprintf (file, " 1) specified fontconfig cache file\n"); - fprintf (file, " 2) related to a particular font directory\n"); + fprintf (file, _("Reads font information cache from:\n")); + fprintf (file, _(" 1) specified fontconfig cache file\n")); + fprintf (file, _(" 2) related to a particular font directory\n")); fprintf (file, "\n"); #if HAVE_GETOPT_LONG - fprintf (file, " -r, --recurse recurse into subdirectories\n"); - fprintf (file, " -v, --verbose be verbose\n"); - fprintf (file, " -V, --version display font config version and exit\n"); - fprintf (file, " -h, --help display this help and exit\n"); + fprintf (file, _(" -r, --recurse recurse into subdirectories\n")); + fprintf (file, _(" -v, --verbose be verbose\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, " -r (recurse) recurse into subdirectories\n"); - fprintf (file, " -v (verbose) be verbose\n"); - fprintf (file, " -V (version) display font config version and exit\n"); - fprintf (file, " -h (help) display this help and exit\n"); + fprintf (file, _(" -r (recurse) recurse into subdirectories\n")); + fprintf (file, _(" -v (verbose) be verbose\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); } @@ -294,7 +302,7 @@ main (int argc, char **argv) config = FcInitLoadConfig (); if (!config) { - fprintf (stderr, "%s: Can't init font config library\n", argv[0]); + fprintf (stderr, _("%s: Can't initialize font config library\n"), argv[0]); return 1; } FcConfigSetCurrent (config); @@ -303,7 +311,7 @@ main (int argc, char **argv) args = FcStrSetCreate (); if (!args) { - fprintf (stderr, "%s: malloc failure\n", argv[0]); + fprintf (stderr, _("%s: malloc failure\n"), argv[0]); return 1; } if (i < argc) @@ -312,7 +320,7 @@ main (int argc, char **argv) { if (!FcStrSetAddFilename (args, (const FcChar8 *) argv[i])) { - fprintf (stderr, "%s: malloc failure\n", argv[0]); + fprintf (stderr, _("%s: malloc failure\n"), argv[0]); return 1; } } @@ -324,7 +332,7 @@ main (int argc, char **argv) while ((arg = FcStrListNext (arglist))) if (!FcStrSetAdd (args, arg)) { - fprintf (stderr, "%s: malloc failure\n", argv[0]); + fprintf (stderr, _("%s: malloc failure\n"), argv[0]); return 1; } FcStrListDone (arglist); @@ -332,7 +340,7 @@ main (int argc, char **argv) arglist = FcStrListCreate (args); if (!arglist) { - fprintf (stderr, "%s: malloc failure\n", argv[0]); + fprintf (stderr, _("%s: malloc failure\n"), argv[0]); return 1; } FcStrSetDestroy (args); @@ -372,7 +380,7 @@ main (int argc, char **argv) { if (!first) printf ("\n"); - printf ("Directory: %s\nCache: %s\n--------\n", + printf (_("Directory: %s\nCache: %s\n--------\n"), FcCacheDir(cache), cache_file ? cache_file : arg); first = FcFalse; } |