How to add html tag in json tranlation file

Published 9 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

Dry7
Dry7
9 months ago (151,880 XP)

@sibarra@browns.edu.au

{!! __('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.