Laravel 8 trans() {#collection-method}
trans 函数使用您的 本地化文件 来翻译指定键:
echo trans('messages.welcome'); 如果指定的翻译键不存在,trans 函数将会返回给定的键。因此在上方的例子中,如果翻译键不存在,trans 函数将返回 messages.welcome:
trans 函数使用您的 本地化文件 来翻译指定键:
echo trans('messages.welcome'); 如果指定的翻译键不存在,trans 函数将会返回给定的键。因此在上方的例子中,如果翻译键不存在,trans 函数将返回 messages.welcome: