Skip to content

enhance(sidebar): make natural sort the default #225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 5, 2025

Conversation

caugner
Copy link
Contributor

@caugner caugner commented Jun 4, 2025

Description

Updates the listSubPages sidebar template to use natural sorting.

Motivation

Ensures that Firefox release notes pages are properly sorted.

Additional details

Related issues and pull requests

Fixes #222.

@caugner caugner requested a review from fiji-flo June 4, 2025 16:19
Copy link
Contributor Author

@caugner caugner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, reviewed the diff.

let locale = locale!("en-US").into();
let mut options = CollatorOptions::new();
pub static COLLATOR: CollatorBorrowed<'static> = {
let mut prefs = CollatorPreferences::from(locale!("en-US"));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to use the right locale for translated content, but that's an independent enhancement.

Comment on lines +358 to +359
let mut prefs = CollatorPreferences::from(locale!("en-US"));
prefs.numeric_ordering = Some(CollationNumericOrdering::True);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw in previous icu_collator versions, this was a collator option, rather than a preference.

@caugner caugner changed the title enhance(sidebar): use natural sort in listSubPages enhance(sidebar): make natural sort the default Jun 5, 2025
@caugner caugner merged commit 31154b8 into main Jun 5, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sidebar listSubPages performs sorting by string only
2 participants