I am reaching out to discuss an enhancement opportunity for Statamic when used as a Headless CMS, particularly in our Nuxt application. We've encountered a challenge with the localization of error messages generated through the Form API ("/!/forms/.."). Currently, these messages default to the primary language of the website, rather than adapting to the user's preferred locale.
In an attempt to address this, we implemented a middleware solution:
if ($request->hasHeader('x-locale')) {
$locale = $request->header('x-locale');
App::setLocale($locale);
}
Unfortunately, this approach hasn't influenced the language of the error messages.
Could you consider implementing a feature that allows for the localization of error messages in the Form API? This would be a significant improvement for developers using Statamic as a Headless CMS in multilingual environments.
I am reaching out to discuss an enhancement opportunity for Statamic when used as a Headless CMS, particularly in our Nuxt application. We've encountered a challenge with the localization of error messages generated through the Form API ("/!/forms/.."). Currently, these messages default to the primary language of the website, rather than adapting to the user's preferred locale.
In an attempt to address this, we implemented a middleware solution:
Unfortunately, this approach hasn't influenced the language of the error messages. Could you consider implementing a feature that allows for the localization of error messages in the Form API? This would be a significant improvement for developers using Statamic as a Headless CMS in multilingual environments.