[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] gtk: use setlocale() for LC_MESSAGES only
From: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-devel] [PATCH] gtk: use setlocale() for LC_MESSAGES only |
Date: |
Fri, 11 Sep 2015 11:12:55 +0200 |
> void early_gtk_display_init(int opengl)
> {
> + /* The QEMU code relies on the assumption that it's always run in
> + * the C locale. Therefore it is not prepared to deal with
> + * operations that produce different results depending on the
> + * locale, such as printf's formatting of decimal numbers, and
> + * possibly others.
> + *
> + * Since GTK+ calls setlocale() by default -importing the locale
> + * settings from the environment- we must prevent it from doing so
> + * using gtk_disable_setlocale().
> + *
> + * QEMU's GTK+ UI, however, _does_ have translations for some of
> + * the menu items. As a trade-off between a functionally correct
> + * QEMU and a fully internationalized UI we support importing
> + * LC_MESSAGES from the environment (see the setlocale() call
> + * earlier in this file). This allows us to display translated
> + * messages leaving everything else untouched.
> + */
> + gtk_disable_setlocale();
Thanks. Replacing my version with this one.
cheers,
Gerd