是否可以在 lang 文件中使用 trans()
?
例如:线路Please fill in your :attribute
假设:attribute
是密码。
可以将password
放入英语 lang 文件中
然后在荷兰语 lang 文件中使用 wachtwoord
进行:attribute
?
您可以在语言验证文件lang/nl/validation.php
attributes
数组中为此使用特定于语言的属性,例如:
'attributes' => [
'name' => 'naam'
'password' => 'wachtwoord'
],
这将在所有表单上全面转换这些属性。
对于更广泛的解释检查:Laravel验证属性"好名字"