From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7277 invoked by alias); 29 Mar 2019 09:39:05 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 7266 invoked by uid 89); 29 Mar 2019 09:39:05 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: =?ISO-8859-1?Q?No, score=1.8 required=5.0 tests=AWL,BAYES_00,BODY_8BITS,FREEMAIL_FROM,FROM_EXCESS_BASE64,GARBLED_BODY,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.1 spammy==d0=bf=d1, Chinese, chinese, somebody?= X-HELO: mail-ua1-f52.google.com Received: from mail-ua1-f52.google.com (HELO mail-ua1-f52.google.com) (209.85.222.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 29 Mar 2019 09:39:04 +0000 Received: by mail-ua1-f52.google.com with SMTP id d5so447619uan.6 for ; Fri, 29 Mar 2019 02:39:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=1gdC1ekrBIPhlUd+Bo4NKw/Ux1s4R1lKMiPg6IqUOTo=; b=ph7S1bmg8uW10/Dkwq3cH//clcp76Gg1EiloxYzlRbLS7WzQ/9pnvljBZEPmwx0TsH qKltJMv7UCyJJXOQfkq/9wGU8L30UuGiXdkiKpRjoysQlcbXANYWS+t29EOwhzHOdTOt xQtVtOGRYg9MCacQJ6gNVTSAAZSbOcyJtAht+VXriWHES6Sq6a7NNhN1icUStDbe0HYr UkugD7toQDMALaWSKtMwP1PyjmsvO6y/ysfJH9t0u7MUEkk7sbEM8ptVwyS/Hm5SPl7j T3rUkC7GbJfk1jDqodMCyw3o1S2KBoX/uYoUywiEzzNc0DZi+hJLMbi0FvImP5FZiYfq wNRw== MIME-Version: 1.0 References: <83mullpwg6.fsf@gnu.org> <83ef6qjdbb.fsf@gnu.org> <838swyjafd.fsf@gnu.org> In-Reply-To: <838swyjafd.fsf@gnu.org> From: =?UTF-8?B?0JLQu9Cw0LTQuNC80LjRgCDQnNCw0YDRgtGM0Y/QvdC+0LI=?= Date: Fri, 29 Mar 2019 09:39:00 -0000 Message-ID: Subject: Re: [PATCH][PR server/24377] Fix mixing English and system default languages in error messages on Windows To: Eli Zaretskii Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-SW-Source: 2019-03/txt/msg00743.txt.bz2 Using system default locale is not a good idea, user must have a way to change message language. If somebody have to debug on chinese Windows, he'll get Chinese messages. And this way mustn't affect any other applications or the system itself. LC_ALL and other env. variables will affect only gettext, not FormatMessage in the current implementation. =D0=BF=D1=82, 29 =D0=BC=D0=B0=D1=80. 2019 =D0=B3. =D0=B2 12:29, Eli Zaretsk= ii : > > > From: =D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D0=BC=D0=B8=D1=80 =D0=9C=D0=B0=D1= =80=D1=82=D1=8C=D1=8F=D0=BD=D0=BE=D0=B2 > > Date: Fri, 29 Mar 2019 11:42:36 +0300 > > Cc: gdb-patches@sourceware.org > > > > Just try to use gettext with FormatMessage. I don't have idea how to > > do it, could you please give me a code sample? > > I believe this is a misunderstanding of some kind, because there's > nothing wrong with FormatMessage calls. As you originally pointed > out, the 4th argument to FormatMessage is zero, which means use the > system default locale. The problem you raised was that gdbserver has > messages where English is hard-coded, so this makes gdbserver > sometimes talk in English and sometimes in the default locale's > language. > > My proposal was to make gdbserver _always_ talk in the current > locale's language, which means the FormatMessage call should be left > alone, and instead those gdbserver messages that use English > hard-coded should be translated by using gettext. > > That is, instead of > > error ("Error creating process \"%s%s\", (error %d): %s\n", > program, args, (int) err, strwinerror (err)); > > gdbserver should use this: > > error (_("Error creating process \"%s%s\", (error %d): %s\n"), > program, args, (int) err, strwinerror (err)); > > A question to other GDB maintainers: does gdbserver use gettext? Or > is gdbserver supposed to talk to users only in English?