diff --git a/src/services/CraftRecaptchaService.php b/src/services/CraftRecaptchaService.php index f46e363..4a9e006 100644 --- a/src/services/CraftRecaptchaService.php +++ b/src/services/CraftRecaptchaService.php @@ -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()