User tests: Successful: Unsuccessful:
Currently, most language packs as well as Crowdin use numbered suffixes for their various plural forms. Meaning they just start with _1 and go up for each form (eg _2, _3, _4 if they have four forms).
While in english this works fine since the suffix actually matches the amount (eg _1 is for "one item"), this fails for languages like Welsh which has more complex plural forms.
The reason for the failing is that Joomla actually first tries to match with the amount before it actually looks up the plural string as defined in the localise.php of the active language pack.
I had a chat with Crowdin how this could be solved and they wrote a solution especially for us which allows to use string based suffixes instead of numbers. Those suffixes will follow the suggestions from http://cldr.unicode.org/index/cldr-spec/plural-rules and http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html. It's also how they already name the forms in their UI:
This PR changes the en-GB.localise.php "getPluralSuffixes" method so Joomla will be able to cope with this string based suffixes. The method already supported returning more than one suffix, so this PR just adds the new strings to the existing ones, being completely backward compatible.
Important: This PR doesn't change the actual language strings as this is neither needed for Crowdin nor for english.
Simplest test is to publish/unpublish articles in the english backend.
It has to work exactly like before, eg "1 article published" and "3 articles published".
An advanced test would be to add custom language overrides like this
_7
is used if exactly 7 articles are published_ONE
is not used since there exists an exact matching string (_1
). If you'd delete the string COM_CONTENT_N_ITEMS_PUBLISHED_1
, that suffix _ONE would be used._OTHER
is used when 2 - 6 or 8+ articles are published._7
is used if exactly 7 articles are published_ONE
and _OTHER
are not usedOnce this is merged I will tell Crowdin to activate this new feature.
TTs using Crowdin will have to adjust their localise.php files with the same type of change.
I will be able to support them in Crowdin doing that.
Status | New | ⇒ | Pending |
Category | ⇒ | Administration Language & Strings |
Let's see if that did the trick
Labels |
Added:
?
?
|
Category | Administration Language & Strings | ⇒ | Administration Language & Strings Unit Tests |
Tests fixed now. Travis has some other issues unrelated to this PR
I have tested this item
I have "The file marked for modification does not exist: administrator/language/en-GB/en-GB.localise.php" in patchtester?
@coolcat-creations
This is staging, not J4
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Drone AppVeyor and Travis failing, don't know why. Will see if a restart helps.
Labels |
Added:
?
|
Rebased PR to force Travis to recheck.
No code was hurt in this process.
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-05-06 21:21:05 |
Closed_By | ⇒ | HLeithner | |
Labels |
Added:
?
|
Thanks
Tests need to be updated.