Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions ReCaptchaFrontendUi/view/frontend/web/js/reCaptcha.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ define(

element.async = true;
element.src = 'https://www.google.com/recaptcha/api.js' +
'?onload=globalOnRecaptchaOnLoadCallback&render=explicit' +
(this.settings.rendering.lang ? '&hl=' + this.settings.rendering.lang : '');
'?onload=globalOnRecaptchaOnLoadCallback&render=explicit';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated also for Admin panel


scriptTag.parentNode.insertBefore(element, scriptTag);

Expand Down
4 changes: 1 addition & 3 deletions ReCaptchaUser/view/adminhtml/templates/recaptcha.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
$config = $block->getCaptchaUiConfig();
$renderingOptions = $config['rendering'] ?? [];
$isInvisible = !empty($config['invisible']);
$languageCode = $config['rendering']['lang'] ?? null;
?>
<div class="admin__field <?= /* @noEscape */ $isInvisible ? 'field-invisible-recaptcha' : 'field-recaptcha' ?>">
<div id="admin-recaptcha"
Expand All @@ -25,8 +24,7 @@ $languageCode = $config['rendering']['lang'] ?? null;

element.async = true;
element.src = 'https://www.google.com/recaptcha/api.js'
+ '?onload=globalOnRecaptchaOnLoadCallback&render=explicit'
<?php if (null !== $languageCode): ?><?="+'&hl={$languageCode}'" ?><?php endif; ?>;
+ '?onload=globalOnRecaptchaOnLoadCallback&render=explicit';

window.globalOnRecaptchaOnLoadCallback = function () {
let token = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function get(): array
'sitekey' => $this->getPublicKey(),
'size' => $this->getSize(),
'theme' => $this->getTheme(),
'lang' => $this->getLanguageCode(),
'hl' => $this->getLanguageCode(),
],
'invisible' => false,
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function get(): array
'sitekey' => $this->getPublicKey(),
'size' => $this->getSize(),
'theme' => $this->getTheme(),
'lang' => $this->getLanguageCode(),
'hl' => $this->getLanguageCode()
],
'invisible' => false,
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function get(): array
'badge' => $this->getInvisibleBadgePosition(),
'size' => 'invisible',
'theme' => $this->getTheme(),
'lang'=> $this->getLanguageCode()
'hl' => $this->getLanguageCode()
],
'invisible' => true,
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function get(): array
'badge' => $this->getInvisibleBadgePosition(),
'size' => 'invisible',
'theme' => $this->getTheme(),
'lang' => $this->getLanguageCode()
'hl' => $this->getLanguageCode()
],
'invisible' => true,
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function get(): array
'badge' => $this->getInvisibleBadgePosition(),
'size' => 'invisible',
'theme' => $this->getTheme(),
'lang'=> $this->getLanguageCode()
'hl'=> $this->getLanguageCode()
],
'invisible' => true,
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function get(): array
'badge' => $this->getInvisibleBadgePosition(),
'size' => 'invisible',
'theme' => $this->getTheme(),
'lang'=> $this->getLanguageCode()
'hl' => $this->getLanguageCode()
],
'invisible' => true,
];
Expand Down