summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.c16
1 files changed, 15 insertions, 1 deletions
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 <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