pequeno Posted July 7, 2022 Posted July 7, 2022 Hello, hCaptcha doesn't show my language correctly in the website. How to force the language in h-captcha? Thanks.
Marc Posted July 7, 2022 Posted July 7, 2022 There is nothing specific within our softwarew that will change the language used on h-captcha. We simply provide the key and secret for this
pequeno Posted July 7, 2022 Author Posted July 7, 2022 Just now, Marc Stridgen said: There is nothing specific within our softwarew that will change the language used on h-captcha. We simply provide the key and secret for this Hello @Marc Stridgen I suppose that in the code of your application there will be the h-Captcha API to include this: https://docs.hcaptcha.com/languages/ For example in this file (Template>core>global>forms>hCaptcha) , is it possible ?: <div data-ipsCaptcha data-ipsCaptcha-service='hcaptcha' data-ipsCaptcha-key="{$siteKey}" data-ipsCaptcha-lang="{$lang}"> <div class="h-captcha" data-sitekey="{$siteKey}"></div> </div> Many Thanks!
Marc Posted July 7, 2022 Posted July 7, 2022 That is very likely. You would however need to post up a suggestion in our suggestions area if you wish to see something to directly set that. At present there isnt anything to directly set that option pequeno 1
opentype Posted July 7, 2022 Posted July 7, 2022 But are we sure it’s not a bug? Hcaptcha should auto detect the language of the system and I can confirm that this is not working. If I use an hcaptcha demo site like this, the captcha is shown in German. But if I open the registration form of my German IPS community, everything in the captcha is shown in English. So, it looks like the difference is caused by IPS’ implementation. For now, I fixed it by changing the template. <div class="h-captcha" data-hl="de" data-sitekey="{$siteKey}"></div> pequeno 1
Marc Posted July 7, 2022 Posted July 7, 2022 This is actually only if you wish to enforce it for all users, which is something that would be a feature request. It should be being detected by the browser automatically. There is nothing in the software that allows for it to be forced, which is what the request was here. As you have been testing yourself on the automatic detection not working there, I can certainly get that reported as a bug, and have just done this SeNioR- and pequeno 1 1
pequeno Posted July 7, 2022 Author Posted July 7, 2022 50 minutes ago, opentype said: But are we sure it’s not a bug? Hcaptcha should auto detect the language of the system and I can confirm that this is not working. If I use an hcaptcha demo site like this, the captcha is shown in German. But if I open the registration form of my German IPS community, everything in the captcha is shown in English. So, it looks like the difference is caused by IPS’ implementation. For now, I fixed it by changing the template. <div class="h-captcha" data-hl="de" data-sitekey="{$siteKey}"></div> Thanks @opentype In which template is the modification made?
Marc Posted July 7, 2022 Posted July 7, 2022 Global->Forms->hcaptcha would be the one being looked at there
pequeno Posted July 7, 2022 Author Posted July 7, 2022 3 hours ago, opentype said: For now, I fixed it by changing the template. <div class="h-captcha" data-hl="de" data-sitekey="{$siteKey}"></div> Perfect! Solve the language issue. SeNioR- 1
Daniel F Posted July 10, 2022 Posted July 10, 2022 This should already be supported because we're passing the users language while loading the JS as query parameter, so there's no need for the data-hl parameter \IPS\Output::i()->jsFilesAsync[] = "https://js.hcaptcha.com/1/api.js?hl=" . \IPS\Member::loggedIn()->language()->short ; But I see here 2 problems with our approach. 1. It won't return the correct language if it isn't installed. So in my case I'm expecting German, but pequeno has no German language installed, so it will return his primary installed language. 2. hcatpcha is expecting a different format than what we're returning here. SeNioR- 1
Solution Marc Posted September 13, 2022 Solution Posted September 13, 2022 This has now been resolved in the latest release (4.7.2). Please update to this version to resolve the problem. If you are still experiencing the issue after upgrade, please let us know.
Recommended Posts