-
Notifications
You must be signed in to change notification settings - Fork 29
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
Update localization support to include form hints, validations and placeholders. #243
base: main
Are you sure you want to change the base?
Conversation
I just remembered I still need to add |
7497c10
to
f0f9ecc
Compare
rebased |
… for testing localized validation support.
f0f9ecc
to
34f63ce
Compare
rebased again. |
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.
In addition to the existing comments, it looks like this PR also needs cargo fmt
to be run against it. Additionally I suspect running cargo clippy
will return warnings that should be addressed too.
@@ -2927,6 +2928,15 @@ pub enum Value<T> { | |||
Dynamic(Dynamic<T>), | |||
} | |||
|
|||
impl<T> PartialEq for Value<T> | |||
where | |||
T: PartialEq + Clone |
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.
This shouldn't require Clone, and I also don't like that Dynamic
's implementation of PartialEq
is different than Value::Dynamic
's PartialEq result. To me PartialEq should work the same for a wrapped value as the wrapper in this situation.
@@ -3604,16 +3614,16 @@ pub enum Validation { | |||
/// The data is valid. | |||
Valid, | |||
/// The data is invalid. The string contains a human-readable message. | |||
Invalid(String), | |||
Invalid(Value<MaybeLocalized>), |
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.
Why is this a Value
rather than just a MaybeLocalized
? Have you made sure that everywhere this is used that the contained value is properly being tracked to ensure external updates invalidate where it is being used?
@@ -3675,15 +3685,16 @@ impl Validations { | |||
/// The validation is linked with `self` such that checking `self`'s | |||
/// validation status will include this validation. | |||
#[must_use] | |||
pub fn validate<T, E, Valid>( | |||
pub fn validate<T, Valid, R>( |
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.
Why was this changed from E to R? E stands for Error, I don't know what R
would stand for.
Recording.2025-01-14.142838.mp4
Notes for reviewers: