Use message translations in PHP code
0
If you need to translate something with Rainlab.Translate
in the backend from PHP, use the following code:
use Winter\Translate\Models\Message;
// use Winter's Message translation
$translated = Message::trans('key');
If you need to translate something with Laravel default translation in the backend from PHP, use the following code:
// use default Laravel helper function
$translated = trans('key');
The current locale will be used.
There are no comments yet
Be the first one to comment