You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I will check if I get something together.
One way would be to share() the translator itself as $trans or similar.
The second idea I have is a global function that uses your container and/or the translator instance.
I will see if I can come up with runnable code.
$trans = new Translator($loader, $locale);
$container->instance(\Illuminate\Translation\Translator::class, $trans);
$container->alias(
\Illuminate\Translation\Translator::class,
(new class extends \Illuminate\Support\Facades\Lang {
public static function getFacadeAccessor() { return parent::getFacadeAccessor(); }
})::getFacadeAccessor()
);
Please, anyone knows how to use the translator component in the view component?
In Laravel I use the helper funcion but I don't know how to do it in this view component.
An example in the index.php of the view could be interesting.
Thanks and best regards
The text was updated successfully, but these errors were encountered: