From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Emacs i18n Date: Mon, 11 Mar 2019 23:48:55 +0200 Organization: LINKOV.NET Message-ID: <87k1h5w08o.fsf@mail.linkov.net> References: <87o97aq6gz.fsf@jidanni.org> <87tvgoud56.fsf@mail.linkov.net> <83o96wk2mi.fsf@gnu.org> <87k1hjfvjd.fsf@mail.linkov.net> <871s3p0zdz.fsf@mail.linkov.net> <83h8ckezyt.fsf@gnu.org> <83o96qegv1.fsf@gnu.org> <32b1ab1b-bef4-629a-8830-b1dcc6915087@cs.ucla.edu> <83a7iae9va.fsf@gnu.org> <05ed2dec-2a84-f7dc-1af5-c9d923992785@cs.ucla.edu> <87bm2p56gu.fsf@mail.linkov.net> <838sxrdgco.fsf@gnu.org> <831s3jdbrk.fsf@gnu.org> <507BBC71-4E90-476A-9F1D-E0D7F0EB56C9@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="235712"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: emacs-devel To: Jean-Christophe Helary Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 11 23:02:52 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h3T0W-000z9v-2p for ged-emacs-devel@m.gmane.org; Mon, 11 Mar 2019 23:02:52 +0100 Original-Received: from localhost ([127.0.0.1]:40884 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3T0V-0005pl-3v for ged-emacs-devel@m.gmane.org; Mon, 11 Mar 2019 18:02:51 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:34240) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3SzS-0005nc-Lg for emacs-devel@gnu.org; Mon, 11 Mar 2019 18:01:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3Sq1-0002LB-Ii for emacs-devel@gnu.org; Mon, 11 Mar 2019 17:52:02 -0400 Original-Received: from bird.maple.relay.mailchannels.net ([23.83.214.17]:42574) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h3Sq1-0002KD-4o for emacs-devel@gnu.org; Mon, 11 Mar 2019 17:52:01 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 1F0528C17BF; Mon, 11 Mar 2019 21:51:58 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a28.g.dreamhost.com (100-96-4-27.trex.outbound.svc.cluster.local [100.96.4.27]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id B379B8C172C; Mon, 11 Mar 2019 21:51:57 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a28.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.3); Mon, 11 Mar 2019 21:51:58 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Language-Lyrical: 409b3119718f0c6f_1552341117921_541696552 X-MC-Loop-Signature: 1552341117921:2008155705 X-MC-Ingress-Time: 1552341117921 Original-Received: from pdx1-sub0-mail-a28.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a28.g.dreamhost.com (Postfix) with ESMTP id CEB567F1EB; Mon, 11 Mar 2019 14:51:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=linkov.net; bh=Y6Zbq7 +bL+H+Pn6YhDD1IqZHrXs=; b=VHXd6DV62H78pwCea12R729ZTpQvuqt4qbEwGH CVdNcMjUgABwPI4TVOwlW8yk2EzkG9LZV10uHTSH3ee+GiyMyjfc/1CFyLY4MHO8 xHKguEZzEZJbr9ry7gUe9RKdqVisfMa19aUNEf7roi5at58tawLdZGx5OcXRMEoJ QeUdw= Original-Received: from mail.jurta.org (m91-129-104-138.cust.tele2.ee [91.129.104.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a28.g.dreamhost.com (Postfix) with ESMTPSA id 3BEA07F1F9; Mon, 11 Mar 2019 14:51:49 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a28 In-Reply-To: <507BBC71-4E90-476A-9F1D-E0D7F0EB56C9@gmail.com> (Jean-Christophe Helary's message of "Thu, 7 Mar 2019 13:35:30 +0900") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedutddrgeeigdduheekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffuohhfffgjkfgfgggtgfesthekredttderjeenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdegrddufeeknecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtgedrudefkedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegsrhgrnhguvghluhhnvgesghhmrghilhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 23.83.214.17 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:234074 Archived-At: >> In that case, the solution that Richard proposed should suffice for mo= st >> cases. That is, in most cases we shouldn't need to change the Elisp >> source code; all we need is for xgettext (or its equivalent) to consid= er >> the first argument of 'message' to be a translatable string. This is >> a standard feature of xgettext (see its --keyword argument). > > Yes but... The first argument of message is often a lisp expression tha= t > generates natural language strings programatically. That part will have= to > be modified (although far from perfect, please check what I did on > packages.el if what I wrote above is not clear). Please note that you have to handle not only format-strings of =E2=80=98m= essage=E2=80=99, but also =E2=80=98error=E2=80=99 and even more low-level =E2=80=98format=E2= =80=99, i.e. all these (error STRING &rest ARGS) (message FORMAT-STRING &rest ARGS) (format-message STRING &rest OBJECTS) (format STRING &rest OBJECTS) because there are many places that construct the string arguments of =E2=80=98message=E2=80=99 using =E2=80=98format=E2=80=99 like in =E2=80= =98perform-replace=E2=80=99: (message "Replaced %d occurrences%s" replace-count (if (> (+ skip-read-only-count skip-filtered-count skip-invisible-count) 0) (format " (skipped %s)" (mapconcat #'identity (delq nil (list (if (> skip-read-only-count 0) (format "%s read-only" skip-read-only-count)) (if (> skip-invisible-count 0) (format "%s invisible" skip-invisible-count)) (if (> skip-filtered-count 0) (format "%s filtered out" skip-filtered-count)))) ", ")) ""))