From d016a9a8601b2919efdb398583dc172795cd1711 Mon Sep 17 00:00:00 2001 From: Parwinder <46927214+parwinderD4D@users.noreply.github.com> Date: Wed, 15 Sep 2021 21:24:13 +0530 Subject: [PATCH] recaptcha text language. The system will get the currently active language automatically and display text based on it --- src/services/CraftRecaptchaService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/CraftRecaptchaService.php b/src/services/CraftRecaptchaService.php index 57e6ea7..9293de2 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()