vendredi 26 mai 2017

How can I get language translated key and value in controller using laravel5.4 json localization?

I have created json file (lang->de->facilityMessages.json) for localization. But when I access the localization inside controller I am getting no result.

facilityMessages.json.

{
    "Wifi"                                     : "WLAN",
    "shower available"                         : "Dusche vorhanden",
}

FacilityController.php

public function index()
{
  $wifi = __('facilityMessages.shower available');
  dd($wifi);      
}

.env

APP_ENV=de



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2ro7SS5
via IFTTT

Aucun commentaire:

Enregistrer un commentaire