From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49848) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaKOF-000089-S2 for qemu-devel@nongnu.org; Fri, 11 Sep 2015 05:13:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZaKOC-000560-M9 for qemu-devel@nongnu.org; Fri, 11 Sep 2015 05:13:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34445) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaKOC-00055k-H8 for qemu-devel@nongnu.org; Fri, 11 Sep 2015 05:13:00 -0400 Message-ID: <1441962775.29362.15.camel@redhat.com> From: Gerd Hoffmann Date: Fri, 11 Sep 2015 11:12:55 +0200 In-Reply-To: <1441898372-32679-1-git-send-email-berto@igalia.com> References: <1441898372-32679-1-git-send-email-berto@igalia.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] gtk: use setlocale() for LC_MESSAGES only List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia Cc: qemu-devel@nongnu.org, Markus Armbruster > 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