How can I use it in Blade
Closed this issue · 4 comments
dreigningking commented
Please tell me how to use this in blade views?
Stichoza commented
This is not a Laravel package, it's framework agnostic.
But you can create your own facades or Blade directives if you want, something like @translate()
and it could use the methods of this package.
iamB0rgy commented
So, this won't work?
{{ GoogleTranslate::trans('{{ $items->name }}', app()->getLocale()) }}
Stichoza commented
@iamB0rgy You shouldn't pass parameter in blade curly braces, do this instead:
{{ GoogleTranslate::trans($items->name, app()->getLocale()) }}
iamB0rgy commented
Thank you. It worked!