Bugfix: Use correct plural froms in translations

https://www.phpbb.com/ideas/
Post Reply

Status

GunChleoc
Registered User
Posts: 152
Joined: Tue Jun 16, 2009 7:48 am

Bugfix: Use correct plural froms in translations

Post by GunChleoc »

phpBB has a working plural system. Please use it for all plural strings so that all languages can translate their plurals correctly.

The problem

The English plural pattern is

Code: Select all

nplurals=2; plural=(n != 1)
. This is fine for Germanic and romance languages, but many other languages have different plural patterns. You might want to ignore me because I'm "only" translating a minority language, but majority languages like Russian and Arabic are affected by this as well (cf. Localization Guide).

Here's an example of the working plural implementation in Scottish Gaelic:

Code: Select all

	'NUM_POSTS_IN_QUEUE'	=> array(
		'0'	=> '%d post sa chiudha',
		'1'	=> '%d phost sa chiudha',
		'3'	=> '%d postaichean sa chiudha',
		'11'	=> '%d phost sa chiudha',
		'13'	=> '%d postaichean sa chiudha',
		'20'	=> '%d post sa chiudha',
	),
As you can see, the patterns are quite different fromm English.

I have suggested this bugfix before but was shot down with the argument that fixing it would break existing translations, but the way it stands, it breaks existing translations as well, and in an unfixable manner to boot.

Pros
  • All languages will have correct plural forms.
  • We won't be stuck forever with a choice between grammar errors (e.g. in my translation "%d postaichean" for "%d posts" which is wrong for all numbers except 3-9, 13-19) or something both unreadable and illegible (e.g. "%d p(h)ost(aichean)" in my translation) which can't be fixed
Cons
  • Some translation teams will have to fix some strings
----------
GunChleoc
Registered User
Posts: 152
Joined: Tue Jun 16, 2009 7:48 am

Re: Bugfix: Use correct plural froms in translations

Post by GunChleoc »

I meant to preview this and it got posted instead, so please ignore the typos.
User avatar
nickvergessen
Former Team Member
Posts: 4397
Joined: Mon Apr 30, 2007 5:33 pm
Location: Stuttgart, Germany
Name: Joas Schilling
Contact:

Re: Bugfix: Use correct plural froms in translations

Post by nickvergessen »

This is already fixed in 3.1, see https://wiki.phpbb.com/Plural_Rules for more information
No Support via PM
GunChleoc
Registered User
Posts: 152
Joined: Tue Jun 16, 2009 7:48 am

Re: Bugfix: Use correct plural froms in translations

Post by GunChleoc »

Excellent, thank you :)
Post Reply

Return to “phpBB Ideas”