Use Laravel translator in translation string
Can I use it trans()
in a lang file?
For example: string Please fill in your :attribute
Let say :attribute
be the password.
Could put password
in an English lang file
and then use wachtwoord
in dutch lang file for :attribute
?
You can use language specific attributes for this inside the language check file lang/nl/validation.php
in an array attributes
, e.g .:
'attributes' => [
'name' => 'naam'
'password' => 'wachtwoord'
],
This will translate these attributes in all forms.
for a broader check explanation: Laravel's "nice names" validation attributes