? ? ? ? Pending

User tests: Successful: Unsuccessful:

avatar Bakual
Bakual
22 Apr 2020

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:
image

Summary of Changes

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.

Testing Instructions

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
image

Expected result

  • The suffix _7 is used if exactly 7 articles are published
  • The suffix _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.
  • The suffix _OTHER is used when 2 - 6 or 8+ articles are published.

Actual result

  • The suffix _7 is used if exactly 7 articles are published
  • The suffix _ONE and _OTHER are not used

Documentation Changes Required

Once 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.

avatar Bakual Bakual - open - 22 Apr 2020
avatar Bakual Bakual - change - 22 Apr 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 22 Apr 2020
Category Administration Language & Strings
avatar SharkyKZ
SharkyKZ - comment - 23 Apr 2020

Tests need to be updated.

avatar Bakual
Bakual - comment - 23 Apr 2020

Let's see if that did the trick

avatar Bakual Bakual - change - 23 Apr 2020
Labels Added: ? ?
avatar joomla-cms-bot joomla-cms-bot - change - 23 Apr 2020
Category Administration Language & Strings Administration Language & Strings Unit Tests
avatar Bakual
Bakual - comment - 23 Apr 2020

Tests fixed now. Travis has some other issues unrelated to this PR

avatar Quy
Quy - comment - 24 Apr 2020

I have tested this item successfully on 374ddc8


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28763.

avatar Quy Quy - test_item - 24 Apr 2020 - Tested successfully
avatar coolcat-creations
coolcat-creations - comment - 25 Apr 2020

I have "The file marked for modification does not exist: administrator/language/en-GB/en-GB.localise.php" in patchtester?

avatar infograf768
infograf768 - comment - 25 Apr 2020

@coolcat-creations
This is staging, not J4

avatar obuisard
obuisard - comment - 25 Apr 2020

I have tested this item successfully on 374ddc8


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28763.

avatar obuisard obuisard - test_item - 25 Apr 2020 - Tested successfully
avatar alikon alikon - change - 25 Apr 2020
Status Pending Ready to Commit
avatar alikon
alikon - comment - 25 Apr 2020

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28763.

avatar richard67
richard67 - comment - 25 Apr 2020

Drone AppVeyor and Travis failing, don't know why. Will see if a restart helps.

avatar Bakual Bakual - change - 5 May 2020
Labels Added: ?
avatar Bakual
Bakual - comment - 5 May 2020

Rebased PR to force Travis to recheck.
No code was hurt in this process.

avatar HLeithner HLeithner - change - 6 May 2020
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: ?
avatar HLeithner HLeithner - close - 6 May 2020
avatar HLeithner HLeithner - merge - 6 May 2020
avatar HLeithner
HLeithner - comment - 6 May 2020

Thanks

Add a Comment

Login with GitHub to post a comment