Parsing system locales #6028
Finchiedev
started this conversation in
General
Replies: 1 comment
-
Yes, we'd welcome contributions! I think the legacy variant section is correct, though note that ICU4X doesn't ship any data around these by default. @sffc to confirm that this is the route we should take. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello all!
I've been experimenting with integrating icu4x into user-facing applications for a while now, and was very excited to see the progress made by GSoC student @ashu26jha in #5081 and #5358 on retrieving the system locale. If there is interest in doing so, I would be very interested in contributing to the
env_preferences
crate that came out of this work to make it easier to use out-of-the-box.This is motivated by my computer (
x86_64-unknown-linux-gnu
) returningOk({All: "C"})
from the linux implementation ofenv_preferences::get_locales
. Ideally,env_preferences::get_locales
would returnLocale
instead ofString
, so I can immediately use the unwrapped result withicu_datetime
,icu_plurals
etc. I assume parsing these strings into locales is the kind of logic that should be handled by icu4x rather than duplicated across downstream users - but please correct me if I'm wrong!At least on Linux, I would expect to solve this according to TR35's section on legacy variants. If possible, I'd love feedback on this solution, and if there's interest in such a contribution at all. I am very happy to do the work but don't want to interfere with anyone's existing progress or create an unwanted PR :)
Beta Was this translation helpful? Give feedback.
All reactions