Lek Posted August 29, 2016 Share Posted August 29, 2016 Good morning, I add a link via hook in the main navigation bar (client area) in the "support" drop down menu. It works perfectly: <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { if (!is_null($primaryNavbar->getChild('Support'))) { $primaryNavbar->getChild('Support') ->addChild('Emergency Contacts', array( 'label' => 'Contacts', 'uri' => '../contacts.html', 'order' => '100', )); } }); Now the name of the new link is ... ('Support') ... I would like this word (Support) to change depending on language. So I think I have to first add the string in any language file I want to use, for example, for English $_LANG['extralinkSupport'] = "Contacts"; for Italian: $_LANG['extralinkSupport'] = "Contatti"; And how to I implement the above php code of the hook so I will have a different word depending on the language? Thank you. 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted August 29, 2016 Share Posted August 29, 2016 use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { if (!is_null($primaryNavbar->getChild('Support'))) { $primaryNavbar->getChild('Support') ->addChild('Emergency Contacts', array( 'label' => Lang::trans('extralinkSupport'), 'uri' => '../contacts.html', 'order' => '100', )); } }); 0 Quote Link to comment Share on other sites More sharing options...
Lek Posted September 1, 2016 Author Share Posted September 1, 2016 WOW! Thanks a lot, grazie. 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted September 1, 2016 Share Posted September 1, 2016 Nessun problem 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.