Ad

October CMS | Throw AJAX Exception With Translated Message

- 1 answer

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?

Ad

Answer

I think you can refer to the localization options on the Documentation

https://octobercms.com/docs/plugin/localization

It's a nice way to handle that things

Ad
source: stackoverflow.com
Ad