atom icon indicating copy to clipboard operation
atom copied to clipboard

Problem: Alphabetical sorting by "Title" does not work in multiple languages

Open ravengermain opened this issue 11 months ago • 1 comments

Current Behavior

Users can only search descriptions alphabetically by "Title" when the language is toggled to the same language that the descriptions were originally added in.

For example, for an English site, archival descriptions can not be sorted alphabetically by Title when the language is toggled to French. For a French site, descriptions can not be sorted alphabetically by Title when the language is toggled to English. It does not work.

Steps to reproduce the behavior

  1. Go to https://demo.accesstomemory.org/
  2. Toggle the language in the navigation bar to any language other than English
  3. Go to "Archival descriptions" under Browse by
  4. Click Sort by: Title

The descriptions will not be sorted correctly by title.

This issue also persists in AtoM 2.9.

Expected Behavior

You should be able to sort descriptions alphabetically, regardless of the language and the original language of the descriptions.

Possible Solution

No response

Context and Notes

No response

Version used

2.8.2

Operating System and version

No response

Default installation culture

No response

PHP version

No response

Contact details

No response

ravengermain avatar Mar 10 '25 21:03 ravengermain

I think this might need more testing - there is an issue here for sure, but it doesn't appear to be exactly as described. It looks like AtoM IS sorting translated results alphabetically, or as best as it can.... there are just 2 complicating factors.

First, reminder that AtoM does not currently support natural language sorting - what we think of as alphabetical - but ASCIIbetical instead. See the "Important" admonition in this section of the docs, for example:

  • https://www.accesstomemory.org/docs/latest/user-manual/access-content/navigate/#sort-buttons

This means that an a will sort in a different order than an A or an à or â.

Second, from what I could tell when adding more translated record titles in the demo site, it seems that AtoM WILL add the translated records matching the selected UI language first in ASCIIbetical order.... but then when there are no more results matching the selected UI language and culture fallback kicks in, the original source records (i.e. the English ones) are the disordered ones - I could not figure out the order in which the English records appeared after my properly sorted translated results.

I thought it might be presenting the fallback English records in the default sort order configured in the site (which was descending by date modified for logged in users) but i tried editing an untranslated English record and it did not cause it to appear first in the fallback results ( and i tried edits in both Braziian Portuguese and English). Nor were the English results ASCIIbetical.... maybe it's just falling back to like objectID sorting internally? who knows.

Anyway, that seems to be the issue - the FALLBACK records appear in a random order that ignores the user's sort settings. From my quick test (flip the UI to pt-BR, add translated titles to a number of records like AA , aa, a, B, BB, b, etc. then sort the results in the pt-BR interface), translated records did sort fine, it was the rest of them that appeared out of order.

fiver-watson avatar Mar 11 '25 12:03 fiver-watson