# HG changeset patch # User Jim Meyering # Date 915254852 0 # Node ID 06aac86fa3af493c08be16eb7e87dd2f8ef29136 # Parent acfbb83ef181e127e255e3f24661265acdfaa3a6 Include locale.h and libintl.h, and define `_()'. Mark translatable strings. diff --git a/lib/makepath.c b/lib/makepath.c --- a/lib/makepath.c +++ b/lib/makepath.c @@ -81,6 +81,17 @@ #define WX_USR (S_IWUSR | S_IXUSR) +#if HAVE_LOCALE_H +# include +#endif + +#if ENABLE_NLS +# include +# define _(Text) gettext (Text) +#else +# define _(Text) Text +#endif + #ifdef __MSDOS__ typedef int uid_t; typedef int gid_t; @@ -145,12 +156,12 @@ if (stat (dir, &stats)) { - error (0, errno, "cannot create directory `%s'", dirpath); + error (0, errno, _("cannot create directory `%s'"), dirpath); fail = 1; } else if (!S_ISDIR (stats.st_mode)) { - error (0, 0, "`%s' exists but is not a directory", dirpath); + error (0, 0, _("`%s' exists but is not a directory"), dirpath); fail = 1; } else @@ -309,7 +320,7 @@ stat and mkdir process O(n^2) file name components. */ if (do_chdir && chdir (basename_dir) < 0) { - error (0, errno, "cannot chdir to directory, %s", dirpath); + error (0, errno, _("cannot chdir to directory, %s"), dirpath); CLEANUP; return 1; } @@ -348,13 +359,13 @@ #endif ) { - error (0, errno, "cannot chown %s", dirpath); + error (0, errno, _("cannot chown %s"), dirpath); retval = 1; } /* chown may have turned off some permission bits we wanted. */ if ((mode & 07000) != 0 && chmod (basename_dir, mode)) { - error (0, errno, "cannot chmod %s", dirpath); + error (0, errno, _("cannot chmod %s"), dirpath); retval = 1; } } @@ -382,7 +393,7 @@ if (!S_ISDIR (stats.st_mode)) { - error (0, 0, "`%s' exists but is not a directory", dirpath); + error (0, 0, _("`%s' exists but is not a directory"), dirpath); return 1; }