F
F
FairyFox57002020-04-29 21:16:23
ASP.NET
FairyFox5700, 2020-04-29 21:16:23

What is the best way to format text errors for ASP.NET CORE web api localization?

The bottom line is that my custom errors look something like this

return new IdentityUserResult()
                {
                    Errors =  new List<string>(){ "Check your email and password. Login attempt is not succesful" }
                };

But with a multilingual application, they told me that it was inconvenient.
How best to represent them then?
Is it possible to represent them as an enum or is there an even better solution?
Is it generally a normal practice to apply localization for the web api or should it happen on the client side closer to the view?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya, 2020-04-30
@sarapinit

Everything you need is in the docks
https://docs.microsoft.com/ru-ru/aspnet/core/funda...

It is generally a normal practice to apply localization for web api

Yes

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question