Page 1 of 1

Bugfix: Use correct plural froms in translations

Posted: Mon Nov 18, 2013 11:54 am
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
----------

View idea at: Bugfix: Use correct plural froms in translations

Posted by GunChleoc

Re: Bugfix: Use correct plural froms in translations

Posted: Mon Nov 18, 2013 11:55 am
by GunChleoc
I meant to preview this and it got posted instead, so please ignore the typos.

Re: Bugfix: Use correct plural froms in translations

Posted: Mon Nov 18, 2013 11:55 am
by nickvergessen
This is already fixed in 3.1, see https://wiki.phpbb.com/Plural_Rules for more information

Re: Bugfix: Use correct plural froms in translations

Posted: Thu Feb 20, 2014 11:22 am
by GunChleoc
Excellent, thank you :)