From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 91059 invoked by alias); 25 Jan 2017 04:31:41 -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 90976 invoked by uid 89); 25 Jan 2017 04:31:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=H*f:sk:6962ef2, H*MI:sk:f4c87f4, H*f:sk:f4c87f4, H*i:sk:f4c87f4 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-pg0-f65.google.com Received: from mail-pg0-f65.google.com (HELO mail-pg0-f65.google.com) (74.125.83.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 25 Jan 2017 04:31:29 +0000 Received: by mail-pg0-f65.google.com with SMTP id 3so711283pgj.1; Tue, 24 Jan 2017 20:31:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=T6IO3RFoK7KN2V8f1QM0P+6nxrLFVg/IAwnFf4ll4b4=; b=XRBhdbVBIIcaPglLZ8DssepEIkSd/qP6r1hFbl7eCgok6PuiyH0vst7sftfz5ulRZu CbPM9fGl4EvYngAnuUgq6EsOAqO31lUE9BX6S+BroOiGV1TiLVkaQxmi1f0X3Vg8nEiP q3izw4+brNuGWbOPfL4ufBQ5056nTn1DTkuV0m+f9O3on1A2nPqS8PaFld8hn24DESjK tF+G1k2Yug4p8lPL1nt5W0uwXsYZkZ2Vn5FHx8Jghk2wH1WZZHBmDS7islCLai4dfv8A myQZ3QoNNlzTYnHLQ3Vs4CGHnV6MvP30OFUAU8mIkem1WO3NFKiXuKGPZxV+RUak2URv NIwQ== X-Gm-Message-State: AIkVDXJgAlweWouVk2maePes4tWRvALS3ZL1NLIF1rRS9kUmuwaIQhFdFMUrmHvDgd+cMA== X-Received: by 10.99.133.65 with SMTP id u62mr44781478pgd.70.1485318688077; Tue, 24 Jan 2017 20:31:28 -0800 (PST) Received: from bubble.grove.modra.org (CPE-58-160-71-80.tyqh2.lon.bigpond.net.au. [58.160.71.80]) by smtp.gmail.com with ESMTPSA id y6sm9119695pge.16.2017.01.24.20.31.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jan 2017 20:31:27 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 9ABE3C0E12; Wed, 25 Jan 2017 15:01:22 +1030 (ACDT) Date: Wed, 25 Jan 2017 04:31:00 -0000 From: Alan Modra To: Peter Bergner Cc: Pedro Alves , Eli Zaretskii , nickc@redhat.com, gdb-patches@sourceware.org, uweigand@de.ibm.com, binutils@sourceware.org Subject: Re: [PATCH 1/2] Add support for setting disassembler-options in GDB for POWER, ARM and S390 Message-ID: <20170125043122.GL28669@bubble.grove.modra.org> References: <83eg28dcjk.fsf@gnu.org> <019eaf5d-9ace-539e-8501-feb3cb0eed6c@vnet.ibm.com> <20170124015651.GH28669@bubble.grove.modra.org> <20170124033625.GI28669@bubble.grove.modra.org> <6962ef25-9722-f0f0-d0a2-209b10761311@vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SW-Source: 2017-01/txt/msg00510.txt.bz2 On Tue, Jan 24, 2017 at 09:59:18AM -0600, Peter Bergner wrote: > On 1/23/17 10:32 PM, Peter Bergner wrote: > > On 1/23/17 9:36 PM, Alan Modra wrote: > >>>> This appears to have lost translation of the help strings. > > [snip] > >> Yes, I meant the support for language translation. > > > > Ok, I see now. How about the following changes to to add _(...) > > around the option descriptions for s390 and arm (ppc doesn't have any)? > > For completeness, here is the full updated patch that keeps the language > translation. You're going to hate me, but this still doesn't keep the language translations. If you regenerate opcodes/po/opcodes.pot you'll see that lines like msgid " esa Disassemble in ESA architecture mode\n" have disappeared without being replaced by anything. I think you need to wrap your new options[].description with N_() to let gettext know they should be translated, like this: static const options_t options[] = { { "esa" , N_("Disassemble in ESA architecture mode") }, { "zarch", N_("Disassemble in z/Architecture mode") }, { "insnlength", N_("Print unknown instructions according to " "length from first two bits") } }; The same thing needs to be done for regnames description in arm-dis.c. I also see this arm-dis.c hunk > @@ -6855,7 +6889,7 @@ the -M switch:\n")); > fprintf (stream, " reg-names-%s %*c%s\n", > regnames[i].name, > (int)(14 - strlen (regnames[i].name)), ' ', > - regnames[i].description); > + _(regnames[i].description)); > > fprintf (stream, " force-thumb Assume all insns are Thumb insns\n"); > fprintf (stream, " no-force-thumb Examine preceding label to determine an insn's type\n\n"); showing missing _() for the last two lines. Bonus points for fixing them in a way that uses exactly the same translatated strings as you have in disassembler_options_desc_arm. The opcodes patch is OK with those changes. -- Alan Modra Australia Development Lab, IBM