feat(i18n): every server A→Z list in the reader's alphabet (E30 S3)
The Postgres image is Alpine, whose en_US.utf8 is byte order: "Életrajzi" and "Ötödik" sorted after "Zorró" in the feed, the channel lists, the Plex grid, its genres and collections. `app/collation.py` names the ICU collation of the reader's language (hu-x-icu puts "Ö" after "O" and "Cs" after "Cu"), wraps every text ORDER BY with it - the feed's keyset cursor compares with the same expression, so paging walks the order it sorted in - and orders the lists built in Python (genre and studio facets, collection members, the discovery re-sort) through the same collation. Plex title tiebreaks use the shown (HU) title.
This commit is contained in:
@@ -21,6 +21,8 @@ from pydantic import BaseModel
|
||||
from sqlalchemy import and_, case, delete, func, or_, select
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from app.mailtext import lang_for_user
|
||||
from app.collation import collated
|
||||
from app.auth import require_human, resolved_user_id
|
||||
from app.db import SessionLocal, get_db
|
||||
from app.models import Message, MessageKey, User
|
||||
@@ -246,7 +248,7 @@ def list_recipients(
|
||||
select(User)
|
||||
.join(MessageKey, MessageKey.user_id == User.id)
|
||||
.where(User.id != user.id, *messageable_clauses())
|
||||
.order_by(func.lower(func.coalesce(User.display_name, User.email)))
|
||||
.order_by(collated(func.coalesce(User.display_name, User.email), lang_for_user(user)))
|
||||
)
|
||||
.scalars()
|
||||
.all()
|
||||
|
||||
Reference in New Issue
Block a user