Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Ligonsker's avatar

Checking if translation string exists when using trans()

Hello,

Is there a way to check if translation exists when using trans()? I want to ignore the value entirely and not display the string key in the translation array. All I found was an old post from Stack Overflow from Laravel 4: https://stackoverflow.com/questions/29210690/check-line-existence-in-laravels-trans

What is the way to do it now?

Thanks

0 likes
2 replies

Please or to participate in this conversation.