diff options
author | P. J. McDermott <pj@pehjota.net> | 2023-10-06 11:19:35 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2023-10-06 11:33:49 (EDT) |
commit | 95d2f7d7562cd681b6a1c684002d4e5f99030da1 (patch) | |
tree | f73aa320ca5be4011c01449caeb5fcbd86ddd51a /src | |
parent | 20377a29d1f274802fce5c728d1a5d7f5a7e8c2a (diff) | |
download | atsign-95d2f7d7562cd681b6a1c684002d4e5f99030da1.zip atsign-95d2f7d7562cd681b6a1c684002d4e5f99030da1.tar.gz atsign-95d2f7d7562cd681b6a1c684002d4e5f99030da1.tar.bz2 |
main: Set text domain and locale
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -17,6 +17,12 @@ * along with @. If not, see <http://www.gnu.org/licenses/>. */ +#include "config.h" + +#ifdef ENABLE_NLS +#include <locale.h> +#endif + #include <errno.h> #include <stdbool.h> #include <stdio.h> @@ -24,7 +30,6 @@ #include <string.h> #include <time.h> #include <unistd.h> -#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 |