From e2d5090e7991e40718e6da803d14b5f220a33de7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Sun, 20 Dec 2020 17:14:15 +0100 Subject: [PATCH] :art: Improve locale --- plug | 2 +- src/gwion.c | 8 ++++++++ src/main.c | 1 + util | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/plug b/plug index a7cdf3ee..3a3f9322 160000 --- a/plug +++ b/plug @@ -1 +1 @@ -Subproject commit a7cdf3ee3f8ab005d1e8dff0249af310133c0c73 +Subproject commit 3a3f9322b4b332c81dde084a858fbd3754c1e713 diff --git a/src/gwion.c b/src/gwion.c index cc0486e7..6f302bcc 100644 --- a/src/gwion.c +++ b/src/gwion.c @@ -1,3 +1,5 @@ +#include +#include #include "gwion_util.h" #include "gwion_ast.h" #include "gwion_env.h" @@ -69,7 +71,13 @@ ANN static m_bool gwion_ok(const Gwion gwion, Arg* arg) { return GW_ERROR; } +#define LOCALE_INFO INSTALL_PREFIX "/share" + ANN m_bool gwion_ini(const Gwion gwion, Arg* arg) { + setlocale(LC_ALL, NULL); + bindtextdomain (GWION_PACKAGE, LOCALE_INFO); + bindtextdomain (GWION_PACKAGE "_util", LOCALE_INFO); + bindtextdomain (GWION_PACKAGE "_ast", LOCALE_INFO); gwion->mp = mempool_ini((sizeof(struct VM_Shred_) + SIZEOF_REG + SIZEOF_MEM)); gwion->st = new_symbol_table(gwion->mp, 65347); gwion->ppa = mp_calloc(gwion->mp, PPArg); diff --git a/src/main.c b/src/main.c index 130ae98c..0632e230 100644 --- a/src/main.c +++ b/src/main.c @@ -36,6 +36,7 @@ int main(int argc, char** argv) { Arg arg = { .arg={.argc=argc, .argv=argv}, .loop=-1 }; signal(SIGINT, sig); signal(SIGTERM, sig); + setlocale(LC_ALL, NULL); struct Gwion_ gwion = {}; const m_bool ini = gwion_ini(&gwion, &arg); arg_release(&arg); diff --git a/util b/util index f7c62c03..b4e733a3 160000 --- a/util +++ b/util @@ -1 +1 @@ -Subproject commit f7c62c03f5981a91a3910f6e4998747c3837f0d1 +Subproject commit b4e733a3fc7c8fdbd3bd96e768f815d7a1aa6b7c -- 2.43.0