mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #65040
[Bug 1958085] Re: Translation issue when there is more than one plural form
This change introduces a number of new langstrings to account for the
plural forms that did not exist in places where plural forms are needed.
Until at lest one plural form is added, the English term will be
displayed.
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: mahara-contributors
https://bugs.launchpad.net/bugs/1958085
Title:
Translation issue when there is more than one plural form
Status in Mahara:
Fix Committed
Bug description:
For example, Czech has two plural forms that have been translated, but
only the first one is (1) picked up in Mahara no matter how many posts
there are in a journal for example, where all plural forms have been
translated. Plural forms were implemented in bug #901051.
More context information is available at http://www.gnu.org/savannah-
checkouts/gnu/gettext/manual/html_node/Plural-forms.html and
https://git.mahara.org/mahara/mahara/-/blob/master/htdocs/lang/en.utf8/langconfig.php#L50
The plural rules for Czech: "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n":
i.e. use plural 1 for 2-4 and plural 2 for 0, 5 and more.
langpacks/cs.utf8/artefact/blog/lang/cs.utf8/artefact.blog.php
$string['nposts'] = array(
0 => 'Jeden příspěvek',
1 => '%s příspěvky,',
2 => '%s příspěvků'
);
$string['youhavenblog'] = array(
0 => 'Máte jeden deník.',
1 => 'Máte %d deníky.',
2 => 'Máte %d deníků.'
In Mahara we have:
---
$string['pluralrule'] = '(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2';
$string['pluralfunction'] = 'plural_cs_utf8';
function plural_cs_utf8($n) {
return ($n==1) ? 0 : ($n>=2 && $n<=4) ? 1 : 2;
}
---
which indicates that it should support plural forms, but it doesn't.
To replicate:
1. Install the Czech lang pack (via CLI). It's code is 'cs'.
2. Create 2 journal entries and check the lang string for the number of journal entries in that journal. It should say 'příspěvky' but it says '2 příspěvků'.
3. Create another 3 entries so you have 4 and check the lang string. It says 'příspěvků' correctly.
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1958085/+subscriptions
References