]> git.mdlowis.com Git - proto/labwc.git/commitdiff
src/main.c: initialize locale after reading environments file
authortokyo4j <hrak1529@gmail.com>
Sat, 22 Jun 2024 21:51:22 +0000 (06:51 +0900)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Sat, 22 Jun 2024 23:02:03 +0000 (01:02 +0200)
This makes the locale for client-menu items and workspace names follow
the env var `LANG` defined in `~/.config/environments`.

src/main.c

index e974a35f1f947df33d8a521fc4da368a4985f8d9..6d3200cdcc1b9efbb0892d5c7037c5430b313f24 100644 (file)
@@ -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);
 
        /*