Skip to content

Update localization support to include form hints, validations and placeholders.#243

Open
hydra wants to merge 2 commits into
khonsulabs:mainfrom
hydra:add-localization-support-3
Open

Update localization support to include form hints, validations and placeholders.#243
hydra wants to merge 2 commits into
khonsulabs:mainfrom
hydra:add-localization-support-3

Conversation

@hydra

@hydra hydra commented Jan 14, 2025

Copy link
Copy Markdown
Contributor
Recording.2025-01-14.142838.mp4

Notes for reviewers:

  • I'm not sure about many of the things I had to do to make this work, but it does indeed seem to work for the included example. Please review carefully.

@hydra

hydra commented Jan 14, 2025

Copy link
Copy Markdown
Contributor Author

I just remembered I still need to add placeholder localization support too. EDIT: Done.

@hydra hydra changed the title Update localization support to include form hints and validations. Update localization support to include form hints, validations and placeholders. Jan 14, 2025
@hydra
hydra force-pushed the add-localization-support-3 branch from 7497c10 to f0f9ecc Compare January 27, 2025 10:46
@hydra

hydra commented Jan 27, 2025

Copy link
Copy Markdown
Contributor Author

rebased

@hydra
hydra force-pushed the add-localization-support-3 branch from f0f9ecc to 34f63ce Compare February 4, 2025 17:27
@hydra

hydra commented Feb 4, 2025

Copy link
Copy Markdown
Contributor Author

rebased again.

@ecton ecton left a comment

Copy link
Copy Markdown
Member

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.

Comment thread src/reactive/value.rs

impl<T> PartialEq for Value<T>
where
T: PartialEq + Clone

Copy link
Copy Markdown
Member

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.

Comment thread src/reactive/value.rs
Valid,
/// The data is invalid. The string contains a human-readable message.
Invalid(String),
Invalid(Value<MaybeLocalized>),

Copy link
Copy Markdown
Member

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?

Comment thread src/reactive/value.rs
/// validation status will include this validation.
#[must_use]
pub fn validate<T, E, Valid>(
pub fn validate<T, Valid, R>(

Copy link
Copy Markdown
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants