? Pending

User tests: Successful: Unsuccessful:

avatar Bakual
Bakual
12 Mar 2020

The Translator of the Welsh language pack noticed that his suffixes specified in the localise.php file are ignored by Joomla. Another suffix is used.
After investigation, we found that Joomla actually tries first to find a plural string with the actual number of items as suffix (eg for 3 items it tries with _3) and only if that doesn't exist it tries with the suffix specified by the language pack.

Summary of Changes

This PR changes the behavior so the suffix from the language pack (localise.php) takes priority over the actual number.

Testing Instructions

Expected result

You should get the response Wedi dad-gyhoeddi %d categori.(FEW) from string COM_CATEGORIES_N_ITEMS_UNPUBLISHED_4

Actual result

You get the response Wedi dad-gyhoeddi %d gategori.(TWO) from string COM_CATEGORIES_N_ITEMS_UNPUBLISHED_3

Documentation Changes Required

Don't know.

avatar Bakual Bakual - open - 12 Mar 2020
avatar Bakual Bakual - change - 12 Mar 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 12 Mar 2020
Category Libraries
avatar Bakual
Bakual - comment - 12 Mar 2020

By the way, current code was introduced for 2.5.0 (d918bd9).

avatar infograf768 infograf768 - change - 12 Mar 2020
Labels Added: ?
avatar Quy
Quy - comment - 13 Mar 2020

I have tested this item successfully on bcd36de


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

avatar Quy Quy - test_item - 13 Mar 2020 - Tested successfully
avatar chmst chmst - test_item - 14 Mar 2020 - Tested unsuccessfully
avatar chmst chmst - alter_testresult - 14 Mar 2020 - chmst: Tested successfully
avatar Bakual
Bakual - comment - 14 Mar 2020

I found the original source of that line of code in a PR on the (old) platform: joomla/joomla-platform#726

The idea was that you can specify strings for specific numbers. Eg for 7 days you could say DAYS_7="A week" or you could specify for 12 items ITEMS_12="A dozen items"`.

I have no clue if that was ever used as it very likely was an unknown, hidden feature.
But this PR would actually break that feature.

On the other hand I don't see a way to fix the regular plural for languages with more complex plural forms. Especially for those that have a specific one for zero items (eg Welsh and Latvian).
Especially with Crowdin we can't customise how the plural suffixes are done. They just number it (like we do in core as well).

I've asked Crowdin if we could switch to string based suffixes like "ZERO", "ONE", "TWO", "FEW", "MANY" (eg those used by http://cldr.unicode.org/index/cldr-spec/plural-rules).
That would make things much simpler.

avatar Bakual
Bakual - comment - 13 Apr 2020

I'm closing this as Crowdin offered a solution with string based suffixes which solves the issue in a better way.

avatar Bakual Bakual - change - 13 Apr 2020
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2020-04-13 07:55:56
Closed_By Bakual
avatar Bakual Bakual - close - 13 Apr 2020

Add a Comment

Login with GitHub to post a comment