From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5652 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: Non-stub gettext API functions committed, ready for testing Date: Sun, 27 Jul 2014 16:14:18 +0200 Message-ID: <20140727141417.GG10402@port70.net> References: <20140727084633.GA22355@brightrain.aerifal.cx> <53D4CF09.1050209@gmx.de> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1406470476 30747 80.91.229.3 (27 Jul 2014 14:14:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 27 Jul 2014 14:14:36 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-5657-gllmg-musl=m.gmane.org@lists.openwall.com Sun Jul 27 16:14:32 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1XBPDb-0004xe-0P for gllmg-musl@plane.gmane.org; Sun, 27 Jul 2014 16:14:31 +0200 Original-Received: (qmail 1503 invoked by uid 550); 27 Jul 2014 14:14:29 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 1495 invoked from network); 27 Jul 2014 14:14:29 -0000 Mail-Followup-To: musl@lists.openwall.com Content-Disposition: inline In-Reply-To: <53D4CF09.1050209@gmx.de> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:5652 Archived-At: * Harald Becker [2014-07-27 12:06:01 +0200]: > >As mentioned in the commit message, some functionality is still > >missing. For the plurals stuff, I can't find the information on how > >you actually get the plural rules out of the .mo file and apply them. > >For the LANGUAGE variable, it's just a matter of adding some > >loop-and-retry logic. > > Does this text help to clarify the plurals question? > > http://www.gnu.org/software/gettext/manual/gettext.html#Plural-forms it shows that a c arithmetic expression parser is needed to handle plurals (and the expression has to be evaluated every time dcngettext is invoked) Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1; The nplurals value must be a decimal number which specifies how many different plural forms exist for this language. The string following plural is an expression which is using the C language syntax. Exceptions are that no negative numbers are allowed, numbers must be decimal, and the only variable allowed is n.