Skip to content

Commit

Permalink
recaptcha text language.
Browse files Browse the repository at this point in the history
The system will get the currently active language automatically and display text based on it
  • Loading branch information
parwinderD4D authored Sep 15, 2021
1 parent 24f3156 commit d016a9a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/services/CraftRecaptchaService.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class CraftRecaptchaService extends Component
public function render(array $options = [])
{
$settings = CraftRecaptcha::$plugin->getSettings();

\Craft::$app->view->registerJsFile('https://www.google.com/recaptcha/api.js');
$currentLanguage = (\Craft::$app->getSites()->getCurrentSite()->language)? \Craft::$app->getSites()->getCurrentSite()->language :'en' ;
\Craft::$app->view->registerJsFile('https://www.google.com/recaptcha/api.js?&hl='. $currentLanguage);

$defaultOptions = [
'siteKey' => $settings->getSiteKey()
Expand Down

0 comments on commit d016a9a

Please sign in to comment.