Vinay Kaithwas
Vinay Kaithwas

Reputation: 1513

How to use seprate translation file(en.json) for admin and frontend in laravel 6

I am using laravel 6 and need to separate en.json for admin and front end because of some reason

Upvotes: 0

Views: 2027

Answers (1)

Sjoerd Loeve
Sjoerd Loeve

Reputation: 231

You better don't use the Using Translation Strings As Keys for this purpose. But if you want to.. do the following:

Create in resources/lang/ a folder named admin and put en.json in it. Then add in your middleware, controller or whatever you like:

Lang::setLocale('admin/en');

In your template you can now refer with @lang('areyou') to translate.

Upvotes: 2

Related Questions