Skip to content

[5.4][AI] Fix Danish alphabetical sorting in category list#47393

Closed
Harsh63870 wants to merge 7 commits intojoomla:5.4-devfrom
Harsh63870:fixing-47375
Closed

[5.4][AI] Fix Danish alphabetical sorting in category list#47393
Harsh63870 wants to merge 7 commits intojoomla:5.4-devfrom
Harsh63870:fixing-47375

Conversation

@Harsh63870
Copy link

Pull Request resolves #
Resolves #47375.

Generative AI policy checkbox

I read the
Generative AI policy
and my contribution is compatible with the policy and GNU/GPL 2 or later. I used an AI tool to assist with ideas and wording, but I have fully reviewed, adapted, and tested the changes myself and I take responsibility for the contribution.
Summary of Changes
In the frontend content category model, after articles are loaded for a category list, apply a locale-aware reordering step when the site language is Danish and the menu ordering is alphabetical.
Use PHP’s Collator('da_DK') (intl extension) to sort the articles by title in a way that respects the Danish alphabet, with Æ, Ø and Å placed correctly at the end.
Only adjust ordering in this specific case (da / da-* language tag + alpha / ralpha ordering), so other languages and ordering modes are not affected if the intl extension is present or absent.
Testing Instructions
Set up a Joomla 5.4-dev site with the language set to Danish (da-DK) or add Danish content with da-DK as language.
Create a category (e.g. “Leksikonartikler”) and several articles in that category whose titles include Danish letters such as Æ, Ø, and Å, mixed with titles starting with A–Z.
Create a menu item of type “Category List” pointing to that category.
In the menu item options, set the article ordering to:
Primary: as desired
Secondary ordering (orderby_sec): Title Alphabetical (and also test Title Alphabetical Reverse).
Load the menu on the frontend and observe the order of the article titles.
Actual result BEFORE applying this Pull Request
With the default database collation, Danish titles containing Æ, Ø, and Å are sorted as if they were A, O, and A.
On a Danish site, this means items like “Æble”, “Øllingegård”, “Årets by 1990” appear mixed into the A/O sections rather than at the end of the alphabet.
Expected result AFTER applying this Pull Request
When the site language is Danish (da / da-*) and the category list is ordered alphabetically (alpha or ralpha), titles are sorted using Danish collation rules via Collator('da_DK').
Articles whose titles start with Æ, Ø, and Å appear in the correct positions relative to the rest of the alphabet (at the end in Danish), both in normal and reverse alphabetical order.
Other languages and ordering modes behave exactly as before.
Link to documentations
Please select:

Documentation link for guide.joomla.org:

No documentation changes for guide.joomla.org needed

Pull Request link for manual.joomla.org:

No documentation changes for manual.joomla.org needed

@Harsh63870
Copy link
Author

@brianteeman @ot2sen if you have time, I’d really appreciate your feedback on this approach.

@brianteeman
Copy link
Contributor

This is completely wrong. You have not understood the problem

@ot2sen
Copy link
Contributor

ot2sen commented Mar 14, 2026

@Harsh63870 Sorry to say, but I´m with @brianteeman on this. Problem is not understood.
You cannot solve an extended charset sorting issue by hardcoding a solution for a single locale.
Joomla support any language.

@richard67
Copy link
Member

@Harsh63870 It seems this PR here also contains the changes from your other PR #47317 . The reason might be that you based this PR not on the 5.4-dev branch of this repository here but on your other PR‘s branch.
Another reason could be that you are not familiar with Git or with your IDE.

Besides this, your PR here is wrong for the reasons stated in previous comments.

In this way you only waste time of maintainers.

Anyway, thanks for trying. Feel free to propose a new PR if you have learned to handle different branches for different PRs right and to test your changes yourself before proposing PRs.

@richard67 richard67 closed this Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The alphabetic sorting in danish i not correct

5 participants