diff --git a/Makefile.am b/Makefile.am index e880bad..378f18e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -51,6 +51,8 @@ libcriterion_la_SOURCES = \ src/options.c \ src/timer.c \ src/timer.h \ + src/i18n.c \ + src/i18n.h \ src/ordered-set.c \ src/main.c diff --git a/src/i18n.c b/src/i18n.c new file mode 100644 index 0000000..9507789 --- /dev/null +++ b/src/i18n.c @@ -0,0 +1,8 @@ +#include "i18n.h" + +#ifdef I18N +__attribute__ ((constructor)) +void init_i18n(void) { + bindtextdomain (PACKAGE, LOCALEDIR); +} +#endif diff --git a/src/main.c b/src/main.c index 467e49d..f263fd5 100644 --- a/src/main.c +++ b/src/main.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include "runner.h" @@ -118,6 +119,8 @@ int main(int argc, char *argv[]) { {0, 0, 0, 0 } }; + setlocale(LC_ALL, ""); + criterion_options = (struct criterion_options) { .always_succeed = !strcmp("1", getenv("CRITERION_ALWAYS_SUCCEED") ?: "0"), .no_early_exit = !strcmp("1", getenv("CRITERION_NO_EARLY_EXIT") ?: "0"),