Eduardo G. Posted March 17, 2012 Share Posted March 17, 2012 Hi all. I've built a custom server module. In this provisioning module I'm using a custom function calling a custom template, as described at "WHMCS Provisioning Module Docs" documentation: function template_extrapage($params) { $pagearray = array( 'templatefile' => 'extrapage', 'breadcrumb' => ' > <a href="#">Example Page</a>', 'vars' => array( 'var1' => 'demo1', 'var2' => 'demo2', ), ); return $pagearray; } So I have my extrapage template (extrapage.tpl) showing the information and it's working right. Well, now I want that extrapage.tpl in the same language customer is viewing the client's area. Question is: how do I implement multi language from a provisioning module? 0 Quote Link to comment Share on other sites More sharing options...
leemason Posted March 22, 2012 Share Posted March 22, 2012 you need to pass the language as one of the vars when returning the page array, ie: function template_extrapage($params) { //get lang name with some php and load the approriate lang file include_once(dirname(__FILE__).'/langfile.php'); $lang = $_ADDONLANG; $pagearray = array( 'templatefile' => 'extrapage', 'breadcrumb' => ' > <a href="#">Example Page</a>', 'vars' => array( 'var1' => 'demo1', 'var2' => 'demo2', 'module_lang' => $lang, ), ); return $pagearray; } 0 Quote Link to comment Share on other sites More sharing options...
Eduardo G. Posted March 22, 2012 Author Share Posted March 22, 2012 Thanks, leemason I finally found the variable I needed in a $_SESSION variable so I can know the language file being used in each moment to include it. Regards ;-) 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.