qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] gtk: use setlocale() for LC_MESSAGES only


From: Alberto Garcia
Subject: Re: [Qemu-devel] [PATCH] gtk: use setlocale() for LC_MESSAGES only
Date: Fri, 18 Dec 2015 19:04:20 +0100
User-agent: Notmuch/0.13.2 (http://notmuchmail.org) Emacs/23.2.1 (i486-pc-linux-gnu)

>> > We do however have translations for a few simple strings for the GTK+
>> > menu items, so in order to run QEMU using the C locale, and yet have a
>> > translated UI let's use setlocale() for LC_MESSAGES only.
>> > 
>> Not sure why I noticed it only now and if it's related to any recent
>> package upgrade on my side (using RHEL 7), but I noticed that
>> non-ASCII characters in the GTK UI strings are broken for me and git
>> bisect pointed to this commit.
>
> I guess we need to set LC_CTYPE too.

That affects functions in ctype.h (isalpha(), islower(), isupper(), ...)
I guess that's safe?

> @@ -2044,8 +2044,9 @@ void gtk_display_init(DisplayState *ds, bool 
> full_screen, bool grab_on_hover)
>  
>      s->free_scale = FALSE;
>  
> -    /* LC_MESSAGES only. See early_gtk_display_init() for details */
> +    /* LC_MESSAGES+LC_CTYPE only. See early_gtk_display_init() for details */
>      setlocale(LC_MESSAGES, "");
> +    setlocale(LC_CTYPE, "");
>      bindtextdomain("qemu", CONFIG_QEMU_LOCALEDIR);
>      textdomain("qemu");

You can also modify the comment in early_gtk_display_init() to say that
" we support importing LC_MESSAGES and LC_CTYPE from the environment ".

Berto



reply via email to

[Prev in Thread] Current Thread [Next in Thread]