Translation of Exceptions

dangquan09
Member | 1
+
0
-

Hi,

has anyone a solution for translate the thrown exeptions from Nette without changing the main classes.

For examle the SimpleAuthenticator Class is throwing a

AuthenticationException(‘Invalid password.’, self::INVALID_CREDENTIAL);

or

AuthenticationException(“User ‘$username’ not found.”, self::IDENTITY_NOT_FOUND);

I use Kdyby/Translation, but i find no solution für translate this Exception text to german with this extension.

regards Frank

David Matějka
Moderator | 6443
+
+2
-

hi,
you should not translate exceptions. instead, you should create end-user message based on exception type and its code.