From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: Emacs i18n Date: Fri, 8 Mar 2019 23:54:28 -0800 Organization: UCLA Computer Science Department 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> <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> <837edbdg33.fsf@gnu.org> <65e3fe78-3264-12ff-1edf-a05bfd86a9a9@cs.ucla.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="187927"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 Cc: eliz@gnu.org, emacs-devel@gnu.org, =?UTF-8?Q?Elias_M=c3=a5rtenson?= , juri@linkov.net To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 09 09:12:40 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 1h2X60-000mmG-DV for ged-emacs-devel@m.gmane.org; Sat, 09 Mar 2019 09:12:40 +0100 Original-Received: from localhost ([127.0.0.1]:55735 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2X5z-00068j-Cj for ged-emacs-devel@m.gmane.org; Sat, 09 Mar 2019 03:12:39 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:49164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2WoW-0000PF-L4 for emacs-devel@gnu.org; Sat, 09 Mar 2019 02:54:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2WoV-0006jO-5S for emacs-devel@gnu.org; Sat, 09 Mar 2019 02:54:36 -0500 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:47456) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h2WoR-0006cy-Uy; Sat, 09 Mar 2019 02:54:32 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 25A551614E2; Fri, 8 Mar 2019 23:54:30 -0800 (PST) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id g2IotNSgPGuk; Fri, 8 Mar 2019 23:54:29 -0800 (PST) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 0F5B416152A; Fri, 8 Mar 2019 23:54:29 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id jbRym5r2BFeU; Fri, 8 Mar 2019 23:54:28 -0800 (PST) Original-Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id C71511614E2; Fri, 8 Mar 2019 23:54:28 -0800 (PST) In-Reply-To: Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 131.179.128.68 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:233947 Archived-At: Richard Stallman wrote: > Here's an idea for a scheme general enough to handle Russian as well. That idea's use of "-masc", "-fem", and "-neut" suggests that you misunde= rstood=20 the problem with translating format strings like "%d items" into Russian. Russian has three plural forms useful for translating a string that forma= ts an=20 integer N. One form is for when (N%10 =3D=3D 1 && N%100/10 !=3D 1), one i= s for when (2=20 <=3D N%10 && N%10 <=3D 4 && N%100/10 =3D=3D 1), and one is for everything= else. So the=20 form depends on N, not on whether the translation of the word "items" is=20 masculine or feminine or whatever. Other languages have other rules, with= =20 varying levels of complexity; for example, Arabic has six different plura= l forms. GNU gettext deals with this at the translation level, so that ordinary pr= ograms=20 can just use a function like ngettext to translate an English-language fo= rmat=20 with two plural forms. Emacs Lisp should do something similar: we shouldn= 't try=20 to reinvent this wheel. Here's an example, taken from GNU dd. The C source code contains the two = English=20 forms and looks something like this: fprintf (stderr, ngettext ("%"PRIuMAX" byte copied, %s, %s", "%"PRIuMAX" bytes copied, %s, %s", w_bytes), w_bytes, delta_s_buf, bytes_per_second); And the ru.po file (which Russian translators edit) looks like this: "Plural-Forms: nplurals=3D3; plural=3D(n%10=3D=3D1 && n%100!=3D11 ? 0 : n= %10>=3D2 && n%10<=3D4=20 && (n%100<10 || n%100>=3D20) ? 1 : 2);\n" ... #: src/dd.c:822 #, c-format msgid "% byte copied, %s, %s" msgid_plural "% bytes copied, %s, %s" msgstr[0] "% =D0=B1=D0=B0=D0=B9=D1=82 =D1=81=D0=BA=D0=BE=D0=BF=D0= =B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD, %s, %s" msgstr[1] "% =D0=B1=D0=B0=D0=B9=D1=82=D0=B0 =D1=81=D0=BA=D0=BE=D0= =BF=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=BE, %s, %s" msgstr[2] "% =D0=B1=D0=B0=D0=B9=D1=82 =D1=81=D0=BA=D0=BE=D0=BF=D0= =B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=BE, %s, %s" Each of the three Russian plural forms is supported, and the right one is= chosen=20 by the translation system without the programmer having to know how Russi= an=20 plural forms work. For more about this, please see the GNU gettext manual= , such=20 as this web page: https://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html PS. Although the email from Elias said "From: =3D?UTF-8?Q?Elias_M=3DC3=3D= A5rtenson?=3D"=20 which displays correctly as "Elias M=C3=A5rtenson", your reply said "To: = Elias=20 =3D?iso-8859-1?Q?M=3DC3=3DA5rtenson?=3D" which displays incorrectly as "E= lias=20 M=C3=83=C2=A5rtenson". It looks like there's a bug in your email client, = or in your=20 configuration of it, a bug that munges names of your email correspondents= .