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`.
This commit is contained in:
tokyo4j 2024-06-23 06:51:22 +09:00 committed by Consolatis
parent edd674f96b
commit 2e00630d80

View file

@ -112,11 +112,6 @@ idle_callback(void *data)
int int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
#if HAVE_NLS
setlocale(LC_ALL, "");
bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
textdomain(GETTEXT_PACKAGE);
#endif
char *startup_cmd = NULL; char *startup_cmd = NULL;
char *primary_client = NULL; char *primary_client = NULL;
enum wlr_log_importance verbosity = WLR_ERROR; enum wlr_log_importance verbosity = WLR_ERROR;
@ -173,6 +168,14 @@ main(int argc, char *argv[])
die_on_detecting_suid(); die_on_detecting_suid();
session_environment_init(); 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); rcxml_read(rc.config_file);
/* /*