问题描述:

The new reCAPTCHA is awesome. Almost everything is great, except one thing. Its font. It's quite stupid to use a font that doesn't support other languages. My website is in Hebrew, and the font that the reCAPTCHA shows is awful. How can I change it?

Is there a Google Api for that? Does it possible to edit the CSS of iframe (cross-domain)?

Thanks.

网友答案:

reCAPTCHA is loaded via <iframe> so customization with your own CSS is not possible, only through reCAPTCHA API.

Using reCAPTCHA API you can implicitly define the language using hl parameter as shown below, with hl=iw for Hebrew. See full list of language codes for more information.

<html>
  <head>
    <title>reCAPTCHA demo: Simple page</title>
     <script src="https://www.google.com/recaptcha/api.js?hl=iw" async defer></script>
  </head>
  <body>
    <form action="?" method="POST">
      <div class="g-recaptcha" data-sitekey="your_site_key"></div>
      <br/>
      <input type="submit" value="Submit">
    </form>
  </body>
</html>

Also it supports two color themes - dark and light.

<html>
  <head>
    <title>reCAPTCHA demo: Simple page</title>
     <script src="https://www.google.com/recaptcha/api.js?hl=iw" async defer></script>
  </head>
  <body>
    <form action="?" method="POST">
      <div class="g-recaptcha" data-sitekey="your_site_key" data-theme="dark"></div>
      <br/>
      <input type="submit" value="Submit">
    </form>
  </body>
</html>

See Developer's Guide for more information.

网友答案:

ReCaptcha API does provide localization. You have to provide the parameter "hl=iw" for Hebrew. See their Language Codes API for more supported languages.

相关阅读:
Top