ugurterzi Posted May 18, 2017 Share Posted May 18, 2017 Hello guys, I added the code below in to header. Then added a new string in to language file "$_LANG['isocode'] = "tr";" {if $capatacha && $capatacha eq "recaptcha"}{literal}<script type="text/javascript"> var RecaptchaOptions = { theme : 'theme_name', lang: '{/literal}{$LANG.isocode}{literal}' }; </script>{/literal}{/if} The result at the frontend is; the script loads at the header as I expected with lang:'tr' But reCAPTCHA still loading it's default language english. Do you have any idea? If yes it would be huge help. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 18, 2017 Share Posted May 18, 2017 what version of WHMCS are you trying to do this for ? I know how to do this for v7.2.1, but your above code looks like it's for v1 of recaptcha and so I would guess that it's not a recent version of WHMCS... 0 Quote Link to comment Share on other sites More sharing options...
ugurterzi Posted May 18, 2017 Author Share Posted May 18, 2017 hi there, thank you for your reply. we're using 7.1.2 (unable to update it to 7.2 but will do it soon, I guess.) 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 18, 2017 Share Posted May 18, 2017 hi there, thank you for your reply.we're using 7.1.2 (unable to update it to 7.2 but will do it soon, I guess.) good news / bad news time... good news is that it's very easy with v7.2.1... bad news is that it's slightly more long-winded with v7.1.2 because the variable you need doesn't exist. so let's start making Google reCAPTCHA multilingual with the easier way using v7.2.1 - all you need to do is tweak the URL that calls the Google API JS file... with v7.2.1, I think that only occurs in three places: 1. standard_cart/domainregister.tpl 2. standard_cart/domaintransfer.tpl 3. six/includes/captcha.tpl (used on homepage, contact page etc) all three templates should contain the following URL... <script src="https://www.google.com/recaptcha/api.js" async defer></script> just change that URL to... <script src="https://www.google.com/recaptcha/api.js?hl={$activeLocale.languageCode}" async defer></script> ... and when the user changes the website language via the dropdown, the language used in the reCAPTCHA will also change to that same language. ok, that's the easier method with v7.2.1... moving back to v7.1.2, we find that the $activeLocale.languageCode variable doesn't exist, so the above method won't work. one way around this is that we can easily find the current language chosen in the site and then search the $locales array for the equivalent languageCode value. <script src="https://www.google.com/recaptcha/api.js" async defer></script> changes to... {foreach $locales as $mylocal} {if $mylocal.language eq $language} {assign languageCode $mylocal.languageCode} {/if} {/foreach} <script src="https://www.google.com/recaptcha/api.js?hl={$languageCode}" async defer></script> 0 Quote Link to comment Share on other sites More sharing options...
ugurterzi Posted May 18, 2017 Author Share Posted May 18, 2017 Really! You know WHMCS man! I owe you. Let's try to upgrade (eventually we have to do that). If it fails again I'll do the second one which you explained very perfectly crystal clear. I'll share the result. 0 Quote Link to comment Share on other sites More sharing options...
ugurterzi Posted May 19, 2017 Author Share Posted May 19, 2017 It worked like a charm. I know this is another case but I'm still unable to update whmcs. I tried evry way possible like manual update, auto update, changing the time out settings, changing ram settings, disable the cagefs, changing php version.. no luck.. apache log says: [Fri May 19 18:39:26.738350 2017] [cgid:error] [pid 409484:tid 139970425612032] [client xx.xxx.xxx.xxx:65244] Script timed out before returning headers: ea-php56 error log is: [19-May-2017 14:24:03 UTC] PHP Fatal error: Class 'Log' not found in /home/xxxxxxxx/public_html/control/vendor/whmcs/whmcs-foundation/lib/Exception/Handler/ExceptionLoggingTrait.php on line 0 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 19, 2017 Share Posted May 19, 2017 I know this is another case but I'm still unable to update whmcs. I tried evry way possible like manual update, auto update, changing the time out settings, changing ram settings, disable the cagefs, changing php version.. no luck..apache log says: [Fri May 19 18:39:26.738350 2017] [cgid:error] [pid 409484:tid 139970425612032] [client xx.xxx.xxx.xxx:65244] Script timed out before returning headers: ea-php56 error log is: [19-May-2017 14:24:03 UTC] PHP Fatal error: Class 'Log' not found in /home/xxxxxxxx/public_html/control/vendor/whmcs/whmcs-foundation/lib/Exception/Handler/ExceptionLoggingTrait.php on line 0 for something like this, it's probably best to open a ticket with support and let them examine your setup. 0 Quote Link to comment Share on other sites More sharing options...
ugurterzi Posted May 19, 2017 Author Share Posted May 19, 2017 I did. they tried to run auto update and broke the installation during the business hours Any way thank you for your help regarding the "reCAPTCHA - define the language" issue. 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.