Open Bug 1945295 Opened 1 year ago Updated 8 months ago

Use ICU4X collator to compare engines for sorting

Categories

(Firefox :: Search, task, P3)

task

Tracking

()

People

(Reporter: mcheang, Assigned: mcheang)

References

(Depends on 1 open bug)

Details

(Whiteboard: [sng])

If the engines do not have order_hints we should sort them by alphabetical order. We need to use ICU4X collator to sort engines that are non-ascii characters.

In Firefox, there is now an app_collator crate that exposes collation according to the Firefox app locale to C++. It would now be trivial to add a Rust entry point.

Does you caller code need to work outside the desktop Firefox context?

Flags: needinfo?(mcheang)

In bug 2022559, I'm adding app_collator::compare() for Firefox desktop internal Rust callers.

We need the app_collator::compare() for application-services.
Our code is here.

Since it would be called within application-services, I think it will be okay to use, right?

Flags: needinfo?(mcheang) → needinfo?(hsivonen)

(In reply to Mandy Cheang [:mcheang][she/her] from comment #3)

We need the app_collator::compare() for application-services.

Sorry about forgetting how I named the crate: It's app_collator_glue. app_collator_glue::compare() is now on autoland in bug 2022559.

Our code is here.

Since it would be called within application-services, I think it will be okay to use, right?

It's OK to use right away when bug 2022559 merges from autoland if this part of application-services is only compiled in the desktop Firefox context. If this code is also compiled in the megazord/Android/iOS context, then app_collator_glue is not available there at this time.

The megazord config should build a pruned (the sqlite / C++ bits removed) version of app_collator_glue and initialize it in some Android/iOS-specific way: If language-specific data can be included in terms of megazord size, then the initialization needs to know what language to pick. OTOH, if the decision is to minimize size to the point of not having language-specific data, then obviously there's no need to find out the app language.

See bug 1986876 comment 1 for ideas for reducing the data size in the megazord case.

Flags: needinfo?(hsivonen)
Depends on: 2023163
You need to log in before you can comment on or make changes to this bug.