NadalKumar Posted May 22, 2019 Share Posted May 22, 2019 The current language processing seems unnecessarily complex and can be simplified by using PHP parse_ini_file() method and define() each value. $language = parse_ini_file(ROOTDIR.'/lang/'.Setting::getValue('Language').'.ini'); foreach($language as $key => $value) { define(strtoupper($key), $value, true); } The language constants and values (english.ini) would simply be written as ; navigation labels NAV_LBL_HOME="Home" NAV_LBL_CLIENTAREA="Clientarea" ; client area head tags HEAD_TAG_ACCOUNT_INFO="Account Information" HEAD_TAG_ACCOUNT_STATS="Account Statistics" and output is simply // tpl files {HEAD_TAG_ACCOUNT_INFO} // php echo HEAD_TAG_ACCOUNT_INFO This adds greater global usage as the constants can be used in XML, TXT and any other file type. Yes I realize it would be a massive change but isn't that what makes applications better... flowing with change. 0 Quote Link to comment Share on other sites More sharing options...
WHMCS ChrisD Posted May 27, 2019 Share Posted May 27, 2019 Thank you for your feedback @NadalKumar I would also recommend adding a feature request at https://requests.whmcs.com 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.