mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #65041
[Bug 1958085] A change has been merged
Reviewed: https://reviews.mahara.org/12386
Committed: https://git.mahara.org/mahara/mahara/commit/85d3e81a9b6ba9bb443e3f5ab9946e426a19bd4e
Submitter: Robert Lyon (robertl@xxxxxxxxxxxxxxx)
Branch: main
commit 85d3e81a9b6ba9bb443e3f5ab9946e426a19bd4e
Author: Dianne Tennent <dianne.tennent@xxxxxxxxxxxxxxx>
Date: Wed Feb 2 17:04:13 2022 +1300
Bug 1958085: Translation issue with plurals
- Update all paginators with 'resultcounttext'
- Ensure corresponding array string exists for translation
- Check for other plural string instances
Change-Id: I0c304704fafa292879ed385e845859c83f897e06
--
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