From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15440 invoked by alias); 29 Mar 2019 09:29:34 -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 15426 invoked by uid 89); 29 Mar 2019 09:29:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,BODY_8BITS,GARBLED_BODY,SPF_PASS autolearn=no version=3.3.1 spammy=HContent-type:plain, alone, HContent-type:charset, HContent-type:text X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (209.51.188.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 29 Mar 2019 09:29:33 +0000 Received: from fencepost.gnu.org ([2001:470:142:3::e]:56130) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h9npL-00074w-9p; Fri, 29 Mar 2019 05:29:31 -0400 Received: from [176.228.60.248] (port=2234 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1h9npG-0000gQ-GA; Fri, 29 Mar 2019 05:29:28 -0400 Date: Fri, 29 Mar 2019 09:29:00 -0000 Message-Id: <838swyjafd.fsf@gnu.org> From: Eli Zaretskii To: =?utf-8?B?0JLQu9Cw0LTQuNC80LjRgCDQnNCw0YDRgtGM0Y/QvdC+0LI=?= CC: gdb-patches@sourceware.org In-reply-to: (message from =?utf-8?B?0JLQu9Cw0LTQuNC80LjRgCDQnNCw0YDRgtGM0Y/QvdC+0LI=?= on Fri, 29 Mar 2019 11:42:36 +0300) Subject: Re: [PATCH][PR server/24377] Fix mixing English and system default languages in error messages on Windows References: <83mullpwg6.fsf@gnu.org> <83ef6qjdbb.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-IsSubscribed: yes X-SW-Source: 2019-03/txt/msg00742.txt.bz2 > From: Владимир Мартьянов > 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?