How can I use HTML tags in a Laravel localization file?

后端 未结 3 749
臣服心动
臣服心动 2020-12-30 18:36

I\'m trying to utilize Laravel\'s localization feature, but I need to be able to put emphasis or bolden a portion of a phrase. Inserting a HTML tag into the language file ca

相关标签:
3条回答
  • 2020-12-30 18:55

    Using @lang directive:

    @lang('nav.find')
    

    Source: Retrieving Translation Strings

    0 讨论(0)
  • 2020-12-30 19:00

    Using Laravel 5.6 and above, can use the __ helper along with the blade syntax:

    {!! __('pagination.next') !!}

    Had to do those for the pagination blade templates.

    0 讨论(0)
  • 2020-12-30 19:06

    Use {!! !!} instead of {{ }} to prevent escaping:

    {!! trans('nav.find') !!}
    
    0 讨论(0)
提交回复
热议问题