Exception messages and locale

Hm, good question. One option would be to actually define that single language like you did in your test. If you set your URL to /, you will not notice the difference to a single language page, only all text files will have the language extensions.

This would work instead as well:

I18n::template($e->getKey(), null, $e->getData(), 'de');

Don’t know if there is a better way.

Turns out you could also set

Kirby\Toolkit\I18n::$locale = 'de';

in a template or controller where you want to call the Exception method.

2 Likes