From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39750) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUZRE-0005GZ-Jm for qemu-devel@nongnu.org; Wed, 26 Aug 2015 08:04:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUZRA-0007po-KP for qemu-devel@nongnu.org; Wed, 26 Aug 2015 08:04:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59687) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUZRA-0007pi-EE for qemu-devel@nongnu.org; Wed, 26 Aug 2015 08:04:16 -0400 From: Markus Armbruster References: <20150818235754.GA31625@igalia.com> <87r3mtq9wx.fsf@blackfin.pond.sub.org> <87oahwr4x1.fsf@blackfin.pond.sub.org> <20150824175648.GV22295@redhat.com> <55DB7E4D.7080306@redhat.com> <1440571595.32587.5.camel@redhat.com> <20150826095752.GD21787@redhat.com> Date: Wed, 26 Aug 2015 14:04:12 +0200 In-Reply-To: <20150826095752.GD21787@redhat.com> (Daniel P. Berrange's message of "Wed, 26 Aug 2015 10:57:52 +0100") Message-ID: <87d1yap877.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] QEMU produces invalid JSON due to locale-dependent code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: Alberto Garcia , Gerd Hoffmann , qemu-devel@nongnu.org "Daniel P. Berrange" writes: > On Wed, Aug 26, 2015 at 08:46:35AM +0200, Gerd Hoffmann wrote: >> Hi, >> >> > > It seems the only thing that we really care about being localized is >> > > the messages catalogue, so the GTK UI gets internationalization in >> > > its menus / dialogs / etc. As such I think that we should do the >> > > opposite of (C). ie run every LC_* in the C locale, except for >> > > LC_MESSAGES which we allow to be localized. >> > > >> > > This avoids any unpredictable functional consequences (like number >> > > formatting) while still giving user decent localization in the UI >> > >> > Except that the LC_MESSAGES catalog may include messages such as "blah >> > %d blah" that get translated for use as a printf argument, and the lack >> > of matching LC_NUMERIC will make the translation look wrong. >> > Translators often assume that their translation is being used with >> > everything else about the locale matching the locale of the translation. >> >> I don't think this is a big issue in practice. The menu item names are >> pretty much the only thing translated in the qemu gtk ui ... > > Also we're talking about a tradeoff between functionally incorrect > formatting of JSON, vs "wrong looking" translations with no functional > impact, which probably won't even affect QEMU in reality. > > In terms of minimizing hacks to QEMU, it seems like only localizing > LC_MESSAGES is a simple enough tradeoff to avoid functionally > incorrect behaviour with minimal downside and no code complexity > messing around with thread-locales, etc It's a hack, and as such it needs a fat comment explaining it.