0
votes

I'm making a plugin (a part on back and another on frontend).

I would like to use my lang.php file (in plugins/me/myplugin/lang/en/lang.php) to my component (I add 'Use Lang') like https://octobercms.com/docs/plugin/localization#file-structure.

How can I use fields on the frontend (in the backend, all works fine) in this lang file (I try, ie, Lang::get('me.myplugin::lang.myfield.name') like https://octobercms.com/docs/plugin/localization#accessing-strings, trans('me.myplugin::lang.myfield.name'), but nothing.

Thanks

1

1 Answers

0
votes

Can you clarify a bit more on this. I'm assuming your Lang file is basically just returning an associative array. In that case, you could just access it like a normal php array.

If I'm wrong, you might want to look at these https://octobercms.com/docs/services/helpers#method-trans