Feature PBF PR-6.0-dev Pending

User tests: Successful: Unsuccessful:

avatar brianteeman
brianteeman
28 Nov 2024

In the Language Code plugin it is possible to change the code used for a specified language. eg fr-FR can be changed to fr-CA

However everywhhere in the admin that associations are displayed it uses the original code and not the changed code.

This PR is a "takeover" of the original PR #37289 created by @infograf768

That PR has merge conflicts and @infograf768 is now retired.

See the original PR for more screenshots

Testing Instructions

Create a multilingual site.
Enable the languagecode system plugin and give a new lang tag value for a language.

image

Actual result BEFORE applying this Pull Request

image

Expected result AFTER applying this Pull Request

image

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

Votes

# of Users Experiencing Issue
0/1
Average Importance Score
5.00

avatar brianteeman brianteeman - open - 28 Nov 2024
avatar brianteeman brianteeman - change - 28 Nov 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 28 Nov 2024
Category Administration com_associations com_categories com_contact com_content com_menus com_newsfeeds Modules
avatar fgsw fgsw - test_item - 28 Nov 2024 - Tested successfully
avatar fgsw
fgsw - comment - 28 Nov 2024

I have tested this item ✅ successfully on 8ccef0c


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

avatar brianteeman brianteeman - change - 28 Nov 2024
Labels Added: Feature PR-5.3-dev
avatar Fedik
Fedik - comment - 29 Nov 2024

The feature maybe is good and usefull.
However the implementation is questionable, because hardcoding if (PluginHelper::isEnabled('system', 'languagecode')) everywhere promisses a loot of fun bugs.

Need to look for a better way of doing the same, maybe some extra event, or kind of that.

avatar universewrld
universewrld - comment - 29 Nov 2024

@brianteeman will it work if instead of en-GB i just use en?
in your screenshots it is shown only for language+country codes.

avatar brianteeman
brianteeman - comment - 29 Nov 2024

@brianteeman will it work if instead of en-GB i just use en? in your screenshots it is shown only for language+country codes.

yes but then then language code wont work as intended.

avatar fgsw
fgsw - comment - 20 Feb 2025

Prebuilt packages are not available for a retest.

avatar richard67 richard67 - change - 20 Feb 2025
Labels Added: PBF
avatar richard67
richard67 - comment - 20 Feb 2025

Prebuilt packages are not available for a retest.

@fgsw Yes, they are deleted after a while. I've updated the branch so a new build was triggered, and now packages are available.

avatar fgsw fgsw - test_item - 20 Feb 2025 - Tested successfully
avatar fgsw
fgsw - comment - 20 Feb 2025

I have tested this item ✅ successfully on 6cc6c8c

Before After
1 2

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44551.
avatar crimle crimle - test_item - 22 Feb 2025 - Tested successfully
avatar crimle
crimle - comment - 22 Feb 2025

I have tested this item ✅ successfully on 6cc6c8c


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

avatar alikon alikon - change - 22 Feb 2025
Status Pending Ready to Commit
avatar alikon
alikon - comment - 22 Feb 2025

PBF


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

avatar Fedik Fedik - change - 23 Feb 2025
Status Ready to Commit Pending
avatar Fedik
Fedik - comment - 23 Feb 2025

I am sorry, but this cannot be merged, because of hardcoding if (PluginHelper::isEnabled('system', 'languagecode')).
We need to find a better logic.


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

avatar brianteeman
brianteeman - comment - 23 Feb 2025

I dont understand your reasoning. PluginHelper::isEnabled is used over 50 times in the core

avatar Fedik
Fedik - comment - 23 Feb 2025

It not an issue with PluginHelper::isEnabled, but with hardcoded plugin itself.

In the core, the plugins should never be used like:

 $languageCodeParams = new Registry(PluginHelper::getPlugin('system', 'languagecode')->params);

What if I want to use 3rd language plugin? With current approach the whole thing will not going to work.

The plugins should listen to events, instead of being used directly.
For current issue, it could be a new event that hook up in to LanguageHelper::getContentLanguages and extend it, or kind of that.

avatar brianteeman
brianteeman - comment - 23 Feb 2025

As i said this is already being used in core

if (PluginHelper::isEnabled('system', 'redirect')) {
$params = new Registry(PluginHelper::getPlugin('system', 'redirect')->params);
$collect_urls = (bool) $params->get('collect_urls', 1);

28dc4b2 23 Feb 2025 avatar brianteeman cs
avatar Fedik
Fedik - comment - 23 Feb 2025

That another bad code, and not an excuse to do the same.

avatar brianteeman
brianteeman - comment - 23 Feb 2025

When infograf wrote the code I assume he just followed existing practice

avatar HLeithner
HLeithner - comment - 4 Mar 2025

This pull request has been automatically rebased to 6.0-dev.

avatar HLeithner HLeithner - change - 4 Mar 2025
Title
[5.3] Language Association Codes
[6.0] Language Association Codes
avatar HLeithner HLeithner - edited - 4 Mar 2025
avatar brianteeman brianteeman - change - 25 Apr 2025
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2025-04-25 21:04:21
Closed_By brianteeman
Labels Added: PR-6.0-dev
Removed: PR-5.3-dev
avatar brianteeman brianteeman - close - 25 Apr 2025
avatar brianteeman
brianteeman - comment - 25 Apr 2025

not wasting my tuime

Add a Comment

Login with GitHub to post a comment