Skip to content
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

Implement i18n and l10n support for hints #2

Closed
nlochschmidt opened this issue Mar 22, 2018 · 6 comments
Closed

Implement i18n and l10n support for hints #2

nlochschmidt opened this issue Mar 22, 2018 · 6 comments
Labels
enhancement New feature or request
Milestone

Comments

@nlochschmidt
Copy link
Member

No description provided.

@nlochschmidt nlochschmidt added this to the v0.2 milestone Mar 22, 2018
@raderio
Copy link

raderio commented Apr 12, 2019

Is there ETA for this?

@magro
Copy link

magro commented Mar 2, 2020

@nlochschmidt do you have plans to work on this?

@nlochschmidt
Copy link
Member Author

Yes, but I need to design the API for #3 first.
Regarding i18n, multi-platform is the tricky part here. I like the way https://github.com/valiktor/valiktor does it, but it relies on java.util.ResourceBundle.

@magro
Copy link

magro commented Mar 2, 2020

Ok, thanks!

@nlochschmidt nlochschmidt added the enhancement New feature or request label May 3, 2022
@nlochschmidt nlochschmidt removed this from the v0.3 milestone Jun 1, 2022
@dhoepelman
Copy link
Collaborator

Thinking of doing this with customs properties, see #48

@dhoepelman
Copy link
Collaborator

I think with #155 and #167 there are enough tools for the user to do this. You can do things like this:

val validation = Validation<User> { User::age { minimum(0) hint "{some id for the i18n library}" }}

val localized = validation.validate(...).errors.map { it.copy(hint = localize(it.hint) } }

or

val validation = Validation<User> { User::age { minimum(0) userContext I18nLibrary.someReference } }

val localized = validation.validate(...).errors.map { it.copy(hint = I18nLibrary.localize(it.userContext as I18nLibraryRef) } }

@dhoepelman dhoepelman added this to the v0.9.0 milestone Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants