From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.devel Subject: Re: Emacs i18n Date: Mon, 25 Mar 2019 11:52:45 +0100 Message-ID: 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> <87h8cjspc0.fsf@mail.linkov.net> <29a53a39-fa50-1e94-9420-a3ea1250aa44@gmail.com> <87r2azq478.fsf@mail.linkov.net> <83o963s4gx.fsf@gnu.org> <87va09ckym.fsf@mail.linkov.net> <83sgvdndt0.fsf@gnu.org> <8736ncgcnm.fsf@mail.linkov.net> Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="245148"; mail-complaints-to="usenet@blaine.gmane.org" Cc: brandelune@gmail.com, Eli Zaretskii , cpitclaudel@gmail.com, rms@gnu.org, emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 25 11:53:11 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 1h8NE3-0011YN-8N for ged-emacs-devel@m.gmane.org; Mon, 25 Mar 2019 11:53:07 +0100 Original-Received: from localhost ([127.0.0.1]:40338 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h8NE2-0002K2-95 for ged-emacs-devel@m.gmane.org; Mon, 25 Mar 2019 06:53:06 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:56725) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h8NDv-0002Jj-SX for emacs-devel@gnu.org; Mon, 25 Mar 2019 06:53:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h8NDu-00036A-Qa for emacs-devel@gnu.org; Mon, 25 Mar 2019 06:52:59 -0400 Original-Received: from mail85c50.megamailservers.eu ([91.136.10.95]:58464 helo=mail18c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h8NDs-00033K-Be; Mon, 25 Mar 2019 06:52:56 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1553511169; bh=bHYWRYM7tyl/HfiV6oA2c5ckD4DzZB4ioXC1zjzyHVg=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=abMn6ndhYBxg1kuApUYqSa1OmLciEdWeufB2BS09XK+dQPvTl1xbI38S4VqF/BNoF 3pwetYC2HxO/D3pJaBeEv2bXGWYlyuk7B7oxe7PbTHj+ZpmQ7+HW4Qo3yV750JE3Uz zU07FxtgixZ8cPI2otSEJdPikPL27sc5X0YF1Uk8= Feedback-ID: mattiase@acm.or Original-Received: from [192.168.1.64] (c-e636e253.032-75-73746f71.bbcust.telenor.se [83.226.54.230]) (authenticated bits=0) by mail18c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x2PAqk0T016857; Mon, 25 Mar 2019 10:52:48 +0000 In-Reply-To: <8736ncgcnm.fsf@mail.linkov.net> X-Mailer: Apple Mail (2.3445.102.3) X-CTCH-RefID: str=0001.0A0B0208.5C98B301.004C, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=KOR08mNo c=1 sm=1 tr=0 a=M+GU/qJco4WXjv8D6jB2IA==:117 a=M+GU/qJco4WXjv8D6jB2IA==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=ucMQw-l_AAAA:8 a=mDV3o1hIAAAA:8 a=Rm5j-1MEKMmw3vZa5aAA:9 a=FjTJYcmR9Q-fu7Kz:21 a=VhhUdX_lUR3LVQ8U:21 a=CjuIK1q_8ugA:10 a=pPMd-SqTSIIA:10 a=xkTruGkd22MpkFU079mG:22 a=_FVE-zBwftR9WsbkzFJk:22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 91.136.10.95 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:234702 Archived-At: 24 mars 2019 kl. 22.55 skrev Juri Linkov : >=20 > http://lists.gnu.org/archive/html/emacs-devel/2019-03/msg00586.html > is pushed to master, ngettext is available to use for pluralization. That patch exposes some Emacs-specific translation problems: - (cons (format "finished with %d matches found\n"=20 grep-num-matches-found) + (cons (format (ngettext "finished with %d match = found\n" + "finished with %d matches = found\n" + grep-num-matches-found) + grep-num-matches-found) This is fine -- typical i18n code (except that the subject of the = sentence is missing, which should go into a comment to translators). ;; remove match from grep-regexp-alist before fontifying ("^Grep[/a-zA-Z]* started.*" (0 '(face nil compilation-message nil help-echo nil mouse-face = nil) t)) - ("^Grep[/a-zA-Z]* finished with \\(?:\\(\\(?:[0-9]+ \\)?matches=20 found\\)\\|\\(no matches found\\)\\).*" + ("^Grep[/a-zA-Z]* finished with \\(?:\\(\\(?:[0-9]+ = \\)?match\\(?:es\\)?=20 found\\)\\|\\(no matches found\\)\\).*" Since it is not uncommon in Emacs to pattern-match on generated text, = either the translator needs to understand regexps well or the code must = be restructured to avoid that kind of matching, perhaps by using text = properties. Besides, translating regexp strings precludes the use of = modern regexp notations like rx, since gettext is string-oriented. Of course the patch was just a proof-of-concept and not intended as = actual code. Please forgive me for using it to make a point. This is also not an argument against using gettext. Quite the contrary; = it's the obvious way to go if i18n is to be undertaken at all.