Laravel translation not working

北慕城南 提交于 2019-12-10 14:48:37

问题


I have languages for french and english. Fallback and standard is french (fr).

My folder structure:

This is the content of the login.php (english):

<?php
return [
    'welcome' => 'Welcome',
    'mail' => 'E-Mail address',
    'password' => 'Password'
];

I am referencing the keys either using @lang() or {{ trans('') }}. Example:

<label for="email" class="col-md-4 control-label">{{ trans('admin.login.mail') }}</label>

However this gets returned as:


回答1:


When you're putting language files into subfolder, you need to specify it using slash. So, try this instead:

{{ trans('admin/login.mail') }}


来源:https://stackoverflow.com/questions/40153529/laravel-translation-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!