October CMS | Throw AJAX Exception With Translated Message
According to the documentation (here) I can throw AJAX exception by using the following code:
throw new AjaxException([ 'error' => 'Not enough questions', 'questionsNeeded' => 2 ]);
But my website is multilingual, so I need to return translated messages, how I can create those messages and return them according to the selected language?
Or there are onother GOOD practices to solve that?
I think you can refer to the localization options on the Documentation
It's a nice way to handle that things
- → OctoberCMS Backend Loging Hash Error
- → "failed to open stream" error when executing "migrate:make"
- → OctoberCMS - How to make collapsible list default to active only on non-mobile
- → Create plugin that makes objects from model in back-end
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → How to install console for plugin development in October CMS
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS create a multi select Form field
- → How to update data attribute on Ajax complete
- → October CMS - Conditionally Load a Different Page