sherwin_flight Posted October 12, 2016 Share Posted October 12, 2016 I am developing an addon module, and it also uses a hooks.php file. I have two hooks: AdminAreaFooterOutput and AdminAreaHeadOutput. My module also includes a lang/english.php file, and I have that working for the main part of my module, now i need to get it working for the hooks file. I have searched the forums and have found many posts relating to the use of Lang::trans. However, in pretty much all cases it says the language string needs to be added to the Language Overrides files. Since this is a module, I'd like it to work without needing any modifications to the main language overrides files. I would rather use the language files distributed with my module for this purpose. So how can I use the text strings from my module/lang/ folder in my hooks.php file? 0 Quote Link to comment Share on other sites More sharing options...
sherwin_flight Posted October 12, 2016 Author Share Posted October 12, 2016 So I have a partial answer so far. I have this code: include "lang/english.php"; foreach ($_ADDONLANG as $key => $value) { $LANG[$key] = $value; } That reads the language file, and creates variables in the exact same format that are used in other places in a module. I just need to know a way to access the currently logged in admin's language. using {debug} in the admin area, it shows a variable "$adminLanguage" but for some reason I can't get that variable into the PHP code of my hooks.php file. Any ideas? 0 Quote Link to comment Share on other sites More sharing options...
sherwin_flight Posted October 12, 2016 Author Share Posted October 12, 2016 I figured it out: $varName = Capsule::table('tbladmins')->where('id', '=', $admin_id)->value('language'); 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.