nioakeim Posted April 21, 2010 Share Posted April 21, 2010 Hello to all! i have a problem and i could really need you help. The problem started when i needed to translate my custom fields. I know, whmcs is not ready for that. But then i thought why couldn't i do this my self. So i opened my clientareadetails.tpl and looked at the code. So here is my thought. In the bottom of the template there is a foreach statement that shows the $customfield.name variable and then prints the input boxes: {if $customfields} <br /> <table width="100%" cellspacing="0" cellpadding="0" class="frame"> <tr> <td><table width="100%" border="0" cellpadding="10" cellspacing="0"> {foreach key=num item=customfield from=$customfields} <tr> <td width="150" class="fieldarea">{$customfield.name}</td> <td>{$customfield.input} {$customfield.required}</td> </tr> {/foreach} </table></td> </tr> </table> {/if} What if i could instead of this <td width="150" class="fieldarea">{$customfield.name}</td> something like this: <td width="150" class="fieldarea">{{$LANG}.{$customfield.name}}</td> in order for the whmcs to look in the lang file for the appropriate translation. Of course the above example does not work. So is it possible to combine and create a dynamic search of the translation? maybe we could construct a variable that is going to be a compination of $LANG and the {$customfield.name} so we could use it like {$customvariable} 0 Quote Link to comment Share on other sites More sharing options...
Grizzlyware Josh Posted January 3, 2011 Share Posted January 3, 2011 Add the word to the lang file... and then try this, I haven't tested it, but it might work? {$LANG.{$customfield.name}} Yours had to many curly brackets, but try the above. 0 Quote Link to comment Share on other sites More sharing options...
Grizzlyware Josh Posted January 3, 2011 Share Posted January 3, 2011 Or even: {$LANG.$customfield.name} 0 Quote Link to comment Share on other sites More sharing options...
CRBAman Posted January 16, 2011 Share Posted January 16, 2011 Hi! I've tryed both solutions, but it didn't help. Is it realy worked in your whms? Maybe somebody know another solutions? 0 Quote Link to comment Share on other sites More sharing options...
nasos75 Posted January 16, 2011 Share Posted January 16, 2011 In my setup I have in English.txt: $_LANG['customclientfield']['DOY'] = 'IRS Office'; $_LANG['customclientfield']['VAT'] = 'VAT number'; Then at line 89 of clientareadetails.tpl, I replaced the code with: <td width="150" class="fieldarea">{$LANG.customclientfield[$customfield.name]}</td> And worked fine! 0 Quote Link to comment Share on other sites More sharing options...
CRBAman Posted January 16, 2011 Share Posted January 16, 2011 Wery smart solution! Thank you! 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.