tobytwigger / laravel-translate

Supercharged instant translations for any Laravel project.
https://tobytwigger.github.io/laravel-translate
MIT License
6 stars 9 forks source link

Clarify translations returning null #8

Closed tobytwigger closed 4 years ago

tobytwigger commented 4 years ago

If a translation fails, the translator returns null. This makes it easy to implement a translator or interceptor, but means calling \Twigger\Translate\Translate::translate(...); could return null.

This needs to be made obvious in the documentation (using ?? $line), and making the other methods return the original line.

This will involve changing the @trans and @__t blade directives and the trans() and __t() functions to return the original line if the translation is null.

tobytwigger commented 4 years ago

Merged with #18