How to add html tag in json tranlation file

Published 3 months ago by [email protected]

I have created json translation file : en.json i would like to add html tag to the translation string

{ "Hello :user, How are you ?" : "Hello :user, how are you?" }

When i am using it in blade something like this

{{ __('Hello :user, How are you ?', ['user' => $guest])}} or {!! __('Hello :user, How are you ?', ['user' => $guest]) !!}

both does not work.

Any idea how i render that html tag using json translation file.

Thank you

3 months ago (143,050 XP)

{!! __('Hello :user, How are you ?', ['user' => $guest]) !!}

should work. or try

{!! htmlspecialchars_decode(__('Hello :user, How are you ?', ['user' => $guest])) !!}

Please sign in or create an account to participate in this conversation.