diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2012-07-25 23:10:35 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2012-07-25 23:10:35 +0300 |
commit | 7e5b2a94ce3c089c50c5862168d1d917e5febcf4 (patch) | |
tree | 41b6a17e241279bcc9fc25765a0aeb6c461b7a76 /extension/time.c | |
parent | 40eefdd931066129d0bb2f6144a0ec7741c6cc2b (diff) | |
download | egawk-7e5b2a94ce3c089c50c5862168d1d917e5febcf4.tar.gz egawk-7e5b2a94ce3c089c50c5862168d1d917e5febcf4.tar.bz2 egawk-7e5b2a94ce3c089c50c5862168d1d917e5febcf4.zip |
Add translation to the extensions.
Diffstat (limited to 'extension/time.c')
-rw-r--r-- | extension/time.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/extension/time.c b/extension/time.c index 60e569a8..7e3fc521 100644 --- a/extension/time.c +++ b/extension/time.c @@ -37,6 +37,10 @@ #include "config.h" #include "gawkapi.h" +#include "gettext.h" +#define _(msgid) gettext(msgid) +#define N_(msgid) msgid + static const gawk_api_t *api; /* for convenience macros to work */ static awk_ext_id_t *ext_id; static awk_bool_t (*init_func)(void) = NULL; @@ -66,7 +70,7 @@ do_gettimeofday(int nargs, awk_value_t *result) assert(result != NULL); if (do_lint && nargs > 0) - lintwarn(ext_id, "gettimeofday: ignoring arguments"); + lintwarn(ext_id, _("gettimeofday: ignoring arguments")); #if defined(HAVE_GETTIMEOFDAY) { @@ -97,7 +101,7 @@ do_gettimeofday(int nargs, awk_value_t *result) #else /* no way to retrieve system time on this platform */ curtime = -1; - update_ERRNO_string("gettimeofday: not supported on this platform"); + update_ERRNO_string(_("gettimeofday: not supported on this platform")); #endif return make_number(curtime, result); @@ -118,16 +122,16 @@ do_sleep(int nargs, awk_value_t *result) assert(result != NULL); if (do_lint && nargs > 1) - lintwarn(ext_id, "sleep: called with too many arguments"); + lintwarn(ext_id, _("sleep: called with too many arguments")); if (! get_argument(0, AWK_NUMBER, &num)) { - update_ERRNO_string("sleep: missing required numeric argument"); + update_ERRNO_string(_("sleep: missing required numeric argument")); return make_number(-1, result); } secs = num.num_value; if (secs < 0) { - update_ERRNO_string("sleep: argument is negative"); + update_ERRNO_string(_("sleep: argument is negative")); return make_number(-1, result); } @@ -154,7 +158,7 @@ do_sleep(int nargs, awk_value_t *result) #else /* no way to sleep on this platform */ rc = -1; - update_ERRNO_str("sleep: not supported on this platform"); + update_ERRNO_str(_("sleep: not supported on this platform")); #endif return make_number(rc, result); |