GtkApplication: Call setlocale early

If we don't call setlocale early enough,
--help output may come out misformatted.

Fixes: #4234
This commit is contained in:
Matthias Clasen 2021-09-06 01:37:51 -04:00
parent 07bff74544
commit 72dc9a21f7
3 changed files with 6 additions and 1 deletions

View File

@ -294,6 +294,9 @@ gtk_application_local_command_line (GApplication *application,
char ***arguments,
int *exit_status)
{
/* We need to call setlocale() here so --help output works */
setlocale_initialization ();
return G_APPLICATION_CLASS (gtk_application_parent_class)->local_command_line (application, arguments, exit_status);
}

View File

@ -362,7 +362,7 @@ enum_locale_proc (LPTSTR locale)
#endif
static void
void
setlocale_initialization (void)
{
static gboolean initialized = FALSE;

View File

@ -150,6 +150,8 @@ GBytes *get_emoji_data (void);
char * _gtk_elide_underscores (const char *original);
void setlocale_initialization (void);
G_END_DECLS
#endif /* __GTK_PRIVATE_H__ */