[英]Laravel: lang file in subfolder
我想“多本地化”我的Laravel項目。
我創建了這樣的目錄結構:
lang
- en
- front
- contact.php
-footer.php
我像這樣建立了我的頁腳:
{{ link_to('/', trans('footer.frontpage'))}}
它工作得很好,但是當我想要本地化其他刀片頁面時,例如contact us
頁面如下:
@lang('front.contact.name')
或這個:
{{ __('front.contact.name') }}
或這個:
{{ trans('front.contact.name') }}
我只回到了頁面上:
front.contact.name
有什么問題?
只需使用/
作為目錄分隔符。
{{ trans('front/contact.name') }}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.