-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Improve the locale support #7981
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
Conversation
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.
Pull Request Overview
This pull request enhances locale support by improving fallback behavior, removing the default locale configuration, and adding tests to cover these changes.
- Updated locale generation commands to include Spanish UTF-8 support.
- Adjusted workflow configurations to improve locale fallback consistency.
GNU testsuite comparison:
|
GNU testsuite comparison:
|
fn format(&self, id: &str, args: Option<&FluentArgs>, default: &str) -> String { | ||
match self.bundle.get_message(id).and_then(|m| m.value()) { | ||
Some(value) => { | ||
fn format(&self, id: &str, args: Option<&FluentArgs>) -> String { |
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.
I think it would be more logical to return an Option<String>
to distinguish between found/not found.
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.
if not found, i think we should just return the id instead of an empty string.
it isn't ideal but better than an empty string
no ?
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.
Hm, it wouldn't be an empty string but None
.
888542f
to
8882cd8
Compare
GNU testsuite comparison:
|
GNU testsuite comparison:
|
GNU testsuite comparison:
|
GNU testsuite comparison:
|
GNU testsuite comparison:
|
GNU testsuite comparison:
|
GNU testsuite comparison:
|
* remove the default value. Avoid duplication of the english string + facilitate translation * have english as a default. Load english when the translated string isn't available
GNU testsuite comparison:
|
Good job, now we have the first (partially) bilingual util :) |
Improve the fallback + remove the default + add tests