Hi,
I’m calling the RegisterService Post method from another service. Now I want to get the errors (e.g. Email already exists) in another language. How do I set this language?
CultureInfo.CurrentUICulture = new CultureInfo(“nl-nl”);
or
ValidatorOptions.Global.LanguageManager.Culture = new CultureInfo(“nl”);
didn’t work.
Thanks!
Code example:
[Route("/aanmelden")]
public class Aanmelden : Register
{
public string Language { get; set; }
}
[DefaultView("login")]
public async Task<object> Post(Aanmelden r)
{
try
{
using (var service = ResolveService<RegisterService>())
{
// Set the language for the next statement
var result = await service.PostAsync(r);
return result;
}
}
catch (Exception ex)
{
return RegistrationError(r, ex.Message);
}
}