From 2e00630d802593f3091a2686223d727190c32abb Mon Sep 17 00:00:00 2001 From: tokyo4j Date: Sun, 23 Jun 2024 06:51:22 +0900 Subject: [PATCH] src/main.c: initialize locale after reading environments file This makes the locale for client-menu items and workspace names follow the env var `LANG` defined in `~/.config/environments`. --- src/main.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main.c b/src/main.c index e974a35f..6d3200cd 100644 --- a/src/main.c +++ b/src/main.c @@ -112,11 +112,6 @@ idle_callback(void *data) int main(int argc, char *argv[]) { -#if HAVE_NLS - setlocale(LC_ALL, ""); - bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR); - textdomain(GETTEXT_PACKAGE); -#endif char *startup_cmd = NULL; char *primary_client = NULL; enum wlr_log_importance verbosity = WLR_ERROR; @@ -173,6 +168,14 @@ main(int argc, char *argv[]) die_on_detecting_suid(); session_environment_init(); + +#if HAVE_NLS + /* Initialize locale after setting env vars */ + setlocale(LC_ALL, ""); + bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR); + textdomain(GETTEXT_PACKAGE); +#endif + rcxml_read(rc.config_file); /*