From c45a1619f5982c02a90b4d041ddd1d6c4a78deb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 2 Mar 2021 10:51:18 +0100 Subject: [PATCH] context: Set up locale on init Taken from main.c, which does that when getting the main option context, which happens to happen early in a process's lifetime. Part-of: --- src/core/meta-context.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/meta-context.c b/src/core/meta-context.c index a816f561e..33cc87531 100644 --- a/src/core/meta-context.c +++ b/src/core/meta-context.c @@ -22,6 +22,8 @@ #include "core/meta-context-private.h" +#include + #include "core/util-private.h" enum @@ -147,4 +149,8 @@ meta_context_class_init (MetaContextClass *klass) static void meta_context_init (MetaContext *context) { + if (!setlocale (LC_ALL, "")) + g_warning ("Locale not understood by C library"); + bindtextdomain (GETTEXT_PACKAGE, MUTTER_LOCALEDIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); }