Mercurial > hg > octave-lojdl > gnulib-hg
changeset 1607:06aac86fa3af
Include locale.h and libintl.h, and define `_()'.
Mark translatable strings.
author | Jim Meyering <jim@meyering.net> |
---|---|
date | Sat, 02 Jan 1999 05:27:32 +0000 |
parents | acfbb83ef181 |
children | 132b836eb4f8 |
files | lib/makepath.c |
diffstat | 1 files changed, 17 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/makepath.c +++ b/lib/makepath.c @@ -81,6 +81,17 @@ #define WX_USR (S_IWUSR | S_IXUSR) +#if HAVE_LOCALE_H +# include <locale.h> +#endif + +#if ENABLE_NLS +# include <libintl.h> +# 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; }