Change V4.5 reCAPTCHA Language

Hi
I need to change the language on my recaptcha in phpfox 4.5
Donna has a great tutorial about that
http://scripttechs.com/article/384/change-v4-recaptcha-language/
but it looks they changed the folder with version 4.5.
There is no more " PF.Site/Apps/PHPfox_reCAPTCHA/app.json"
Any idea where can i find it now?

Comments

  • I'll update the tutorial.

  • Thank you!

    data66
  • I've updated it. :)

    liviu
  • Thank you again! It works!

    data66
  • Hi Data . Any chance to make the above link working again?

  • edited January 25

    This is the old tut but I note that the user's browser chosen language will display the recaptcha based on what they have set. This is not tested in 4.6


    If you want to use the Google reCAPTCHA app that comes with V4 but need it in a different language, this tutorial shows how to do that.

    Note that you will be editing a default app. Make a copy of it and keep the copy in a safe place in case you want to revert it to default or if you need phpFox support as any core changes will void support.
    First, use a good text editor for this process. We use Netbeans.

    Open PF.Site/Apps/PHPfox_reCAPTCHA/app.json

    Look for (around line 7) the following code:

    "https://www.google.com/recaptcha/api.js?onload=pfRecaptchaLoad&render=explicit"
    

    Now, make sure you know what language abbreviation you want.

    You will add your language abbreviation code like the following (we used French, fr, for our example) so we added:

    hl=fr&

    right after the

    "https://www.google.com/recaptcha/api.js?

    and before the

    onload=pfRecaptchaLoad&render=explicit"

    So it looks like the following:

    "https://www.google.com/recaptcha/api.js?hl=fr&onload=pfRecaptchaLoad&render=explicit"

    We then fully cleared cache and tested and it then showed in French.

    liviu
  • Do you know where I can find that file in 4.7.0?

  • I haven't checked the latest version of phpFox since leaving for SocialEngine. If I have time this weekend, I'll try to look.

    liviu
  • Thank you!

  • Ok I found it. They didn't make it easy but here it is. Note to make a backup of the original file and keep a copy of this file as it'll be overwritten on every upgrade.

    Open PF.Base/static/jscript/main.js
    Find line 3295 which will look like $("<script/>", {src: "//www.google.com/recaptcha/api.js"}).appendTo("body");

    Change that line to $("<script/>", {src: "//www.google.com/recaptcha/api.js?hl=fr"}).appendTo("body");

    Note that is french language. If you want another language, change the fr in ?hl=fr to the language you need from this list https://developers.google.com/recaptcha/docs/language

    DuCarlion
Sign In or Register to comment.