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, 18 Mar 2019 23:20:00 +0200 Organization: LINKOV.NET Message-ID: <87o967yjcf.fsf@mail.linkov.net> References: <87o97aq6gz.fsf@jidanni.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> <87k1h5w08o.fsf@mail.linkov.net> <1b23d0ff-3998-b795-9895-7320e7028f70@cs.ucla.edu> <87d0mvu6wo.fsf@mail.linkov.net> <87va0htcss.fsf@mail.linkov.net> 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="157515"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 18 22:26:25 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 1h5zm4-000erI-7f for ged-emacs-devel@m.gmane.org; Mon, 18 Mar 2019 22:26:24 +0100 Original-Received: from localhost ([127.0.0.1]:47733 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h5zm2-0004dz-7d for ged-emacs-devel@m.gmane.org; Mon, 18 Mar 2019 17:26:22 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:35447) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h5zjk-0003NT-74 for emacs-devel@gnu.org; Mon, 18 Mar 2019 17:24:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h5zjj-0005YV-CJ for emacs-devel@gnu.org; Mon, 18 Mar 2019 17:24:00 -0400 Original-Received: from lavender.maple.relay.mailchannels.net ([23.83.214.99]:49703) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h5zji-0005Uw-Ts for emacs-devel@gnu.org; Mon, 18 Mar 2019 17:23:59 -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 B051D6A1703 for ; Mon, 18 Mar 2019 21:23:57 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a72.g.dreamhost.com (100-96-7-26.trex.outbound.svc.cluster.local [100.96.7.26]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 5BC726A0185 for ; Mon, 18 Mar 2019 21:23:57 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a72.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, 18 Mar 2019 21:23:57 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Reign-Occur: 6a0fa24e594b177c_1552944237535_956782755 X-MC-Loop-Signature: 1552944237535:3934784671 X-MC-Ingress-Time: 1552944237534 Original-Received: from pdx1-sub0-mail-a72.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a72.g.dreamhost.com (Postfix) with ESMTP id 07D608068B for ; Mon, 18 Mar 2019 14:23:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=linkov.net; bh=LF4WTm CM5pF/Uo3Q7vAu+E9+4gg=; b=UOW+wO9tGhpo1DR03zUcbfSw7gHzl9uavSmkcU 6C7v4qbULCYfna2PWwJ/Zow/pXFGdrPftgn7nE4INKx865ycxdX7tkO0Ga4s0P0o jMIesZG2i+ruFKV/kXg+p8pxGKNgHZuvF2wM9NSU59b+k+A1Flzj9fYqlaaitmST 1Vnto= Original-Received: from mail.jurta.org (m91-129-106-13.cust.tele2.ee [91.129.106.13]) (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-a72.g.dreamhost.com (Postfix) with ESMTPSA id EB9A48068E for ; Mon, 18 Mar 2019 14:23:50 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a72 In-Reply-To: <87va0htcss.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 17 Mar 2019 23:23:03 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedutddriedugdduhedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffuohhfffgjkfgfgggtgfesthekredttderjeenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucffohhmrghinhepshhouhhrtggvfhhorhhgvgdrihhonecukfhppeeluddruddvledruddtiedrudefnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtiedrudefpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepvghmrggtshdquggvvhgvlhesghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedt X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 23.83.214.99 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:234341 Archived-At: > Other Lisp implementations use =E2=80=98ngettext=E2=80=99 as well, e.g.= : > https://clisp.sourceforge.io/impnotes.html#ggettext And this command will extract =E2=80=98ngettext=E2=80=99 messages: xgettext --from-code=3DUTF-8 -kngettext:1,2 *.el **/*.el Using only =E2=80=98ngettext=E2=80=99 has an additional advantage: there will be no need to add more such functions as nmessage, nerror, nuser-error, ntramp-error, etc. But for cases when =E2=80=98message=E2=80=99 will receive a string already translated by =E2=80=98ngettext=E2=80=99, e.g.: (message (ngettext "Replaced %d occurrence%s" "Replaced %d occurrences%s" replace-count) we need to mark translated strings like Richard suggested: (defun ngettext (msgid msgid_plural n &optional _domain _category) "Return the plural form of the translation for of MSGID and N." (propertize (if (/=3D n 1) msgid_plural msgid) 'translated t)) so =E2=80=98format-message=E2=80=99 should check if its first argument is= translated, and not to call gettext again.