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

How would you translate form validation messages? #10

Open
epsitec opened this issue Sep 20, 2019 · 5 comments
Open

How would you translate form validation messages? #10

epsitec opened this issue Sep 20, 2019 · 5 comments

Comments

@epsitec
Copy link

epsitec commented Sep 20, 2019

I've come across your I18nText project while looking for a solution which would allow me to translate Blazor validation messages defined using ErrorMessage = "..." constants.

I don't see how I could use I18nText to provide the messages.

Do you have any ideas?

I've also opened an issue for the ASP.NET Core 3.0 documentation on this very same subject.

@epsitec epsitec changed the title How would you handle form validation messages? How would you translate form validation messages? Sep 20, 2019
@agonzalezm
Copy link

+1 add support for data annotations validations

@jsakamoto
Copy link
Owner

For the first step to resolve this issue, I published "LocalizedDataAnnotationsValidator" component for Blazor.

This component is built on "Microsoft.Extensions.Localization" infrastructure, therefore, a combination with this "Blazor I18n Text" doesn't work at this time.

For the next step, I'll integrate this "Blazor I18n Text" into "Microsoft.Extensions.Localization" infrastructure.
In the plan, I'll make this "Blazor I18n Text" provide IStringLocalizer<T> service.

After completing these steps, static typing localization of data annotation validation error messages using "Blazor I18n Text" will come true.

@jsakamoto
Copy link
Owner

Hi, all.

Today, I published the "Blazor Internationalization(I18n) Text - StringLocalizer support" package.

I'm sorry that this is still a "beta" release, and there are no documents about how to use this package, yet.
And also, It will be buggy, I think.

However, "Blazor Internationalization(I18n) Text - StringLocalizer support" maybe can works with "LocalizedDataAnnotationsValidator" component to localize validation messages.

Due to there are not enough documents at this time, please reference the sample site source code bellow.

I hope may this new package be helpful for you!

@Seanxwy
Copy link

Seanxwy commented Apr 24, 2023

Did you stop maintenance?

@jsakamoto
Copy link
Owner

@Seanxwy No, I don't intend to stop maintaining this project for now. But in fact, I admit that the priority of this project was going down lower than other my OSS projects.

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

No branches or pull requests

4 participants