Skip to content

Commit 5c650cc

Browse files
authored
Make Altcha captcha texts translatable (#591)
* Make Altcha captcha texts translatable Add the Altcha i18n all language bundle so the widget automatically displays translated strings based on the store locale (detected from the html lang attribute). Also make the custom Verifying loader dialog text translatable via PHP translation system. * Use dynamic locale for html lang attribute on admin standalone pages
1 parent aef920a commit 5c650cc

File tree

8 files changed

+1173
-6
lines changed

8 files changed

+1173
-6
lines changed

app/design/adminhtml/default/default/template/captcha/captcha.phtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ if (!$helper->isEnabled()) return '';
1818
MahoCaptcha.setup({
1919
frontendSelectors: '#loginForm',
2020
widgetAttributes: <?= $helper->getWidgetAttributes()->toJson() ?>,
21-
loadingImageUrl: '<?= $this->getSkinUrl('images/loading.svg') ?>'
21+
loadingImageUrl: '<?= $this->getSkinUrl('images/loading.svg') ?>',
22+
verifyingText: '<?= $this->jsQuoteEscape($helper->__('Verifying...')) ?>'
2223
});
2324
});
2425
</script>

app/design/adminhtml/default/default/template/forgotpassword.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/** @var Mage_Adminhtml_Block_Template $this */
1313
?>
1414
<!DOCTYPE html>
15-
<html lang="en">
15+
<html lang="<?= substr(Mage::app()->getLocale()->getLocaleCode(), 0, 2) ?>">
1616
<head>
1717
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
1818
<meta name="robots" content="noindex, nofollow" />

app/design/adminhtml/default/default/template/login.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/** @var Mage_Adminhtml_Block_Template $this */
1313
?>
1414
<!DOCTYPE html>
15-
<html lang="en">
15+
<html lang="<?= substr(Mage::app()->getLocale()->getLocaleCode(), 0, 2) ?>">
1616
<head>
1717
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
1818
<meta name="robots" content="noindex, nofollow" />

app/design/adminhtml/default/default/template/resetforgottenpassword.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/** @var Mage_Adminhtml_Block_Template $this */
1313
?>
1414
<!DOCTYPE html>
15-
<html lang="en">
15+
<html lang="<?= substr(Mage::app()->getLocale()->getLocaleCode(), 0, 2) ?>">
1616
<head>
1717
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
1818
<meta name="robots" content="noindex, nofollow" />

app/design/frontend/base/default/template/captcha/footer.phtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ if (!$helper->isEnabled()) return '';
1818
MahoCaptcha.setup({
1919
frontendSelectors: '<?= $helper->getFrontendSelectors() ?>',
2020
widgetAttributes: <?= $helper->getWidgetAttributes()->toJson() ?>,
21-
loadingImageUrl: '<?= $this->getSkinUrl('images/loading.svg') ?>'
21+
loadingImageUrl: '<?= $this->getSkinUrl('images/loading.svg') ?>',
22+
verifyingText: '<?= $this->jsQuoteEscape($helper->__('Verifying...')) ?>'
2223
});
2324
});
2425
</script>

app/locale/en_US/Maho_Captcha.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
"Incorrect CAPTCHA.","Incorrect CAPTCHA."
77
"Internal Error","Internal Error"
88
"These CSS selectors are used to identify the forms for which captcha will be activated.<br />One selector per line.<br />To disable a selector, type // at the beginning of the line.","These CSS selectors are used to identify the forms for which captcha will be activated.<br />One selector per line.<br />To disable a selector, type // at the beginning of the line."
9+
"Verifying...","Verifying..."

0 commit comments

Comments
 (0)