-
Notifications
You must be signed in to change notification settings - Fork 185
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
Parse system locales in env_preferences
#6158
Draft
Finchiedev
wants to merge
3
commits into
unicode-org:main
Choose a base branch
from
Finchiedev:parse_locales
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
As per the discussion in unicode-org#6028, I have implemented POSIX locale parsing functionality, and a `try_convert_lossy()` function to attempt converting to a `icu_locale::Locale`. This code is currently in the private `parse` module, as a temporary solution while support for other platforms is added and the code structure is finalized.
Basic testing of each edge case, error case, along with end-to-end tests using some common POSIX locales.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code looks great, @zbraniecki can you also take a look
(whoops wrong button) |
Finchiedev
added a commit
to Finchiedev/icu4x
that referenced
this pull request
Feb 19, 2025
Adding fixes from @roberbastian as discussed in unicode-org#6158: unicode-org#6158 (review)
Adding fixes from @robertbastian as discussed in unicode-org#6158: unicode-org#6158 (review)
12c8f4d
to
e912dfd
Compare
Thanks very much for your time and feedback @robertbastian, I have implemented all the suggested changes and marked them as resolved. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As per the discussion in #6028, I have created a POSIX locale parser/converter, currently hidden in the private
env_preferences::parse
module. This is meant to change at some point while the PR is being drafted, especially once I add support for other platforms. Once more platforms are supported, I would also like to implement universal and platform-specific APIs, as per this comment by @zbraniecki.My current thinking on code structure is to have some distinction between platform
fetch
andparse
code (either using modules or files), but please let me know if all platform logic should just be kept in the same file.Of course, feedback on the code itself would be very much appreciated!