From 95d2f7d7562cd681b6a1c684002d4e5f99030da1 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Fri, 06 Oct 2023 11:19:35 -0400 Subject: main: Set text domain and locale --- (limited to 'src') diff --git a/src/main.c b/src/main.c index ce02c1f..fb94d09 100644 --- a/src/main.c +++ b/src/main.c @@ -17,6 +17,12 @@ * along with @. If not, see . */ +#include "config.h" + +#ifdef ENABLE_NLS +#include +#endif + #include #include #include @@ -24,7 +30,6 @@ #include #include #include -#include "config.h" #include "datetime.h" #include "i18n.h" @@ -200,6 +205,15 @@ main(int argc, char * const argv[]) time_t arg; double dif; +#ifdef ENABLE_NLS + bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR); +#ifdef HAVE_BIND_TEXTDOMAIN_CODESET + bind_textdomain_codeset(PACKAGE, "UTF-8"); +#endif + textdomain(PACKAGE); + setlocale(LC_ALL, ""); +#endif + #if defined(ENABLE_TESTS) && ENABLE_TESTS dbg = false; #endif -- cgit v0.9.1