Closed MarcHoffmann closed 5 years ago
Try changing [[++cultureKey]]
in the Chunk tpl to whatever modx placeholder is being set with your culture key.
Sorry @MarcHoffmann I misunderstood the issue.
You're right, the Chunk tpls provided reference the MODX cultureKey
instead of the lang
. It is identical to the behaviour of the Snippet, actually because the option does not come from the Snippet properties but rather the MODX config.
If you would require customization of the language string, I would suggest adding it as a Context Setting or custom System Setting and referencing that from the Chunk, like: [[++my-custom-lang-setting]]
In future if customizing this via Snippet properties becomes an often-requested feature we can certainly add it in :)
What do you means by:
If you would require customization of the language string, I would suggest adding it as a Context Setting or custom System Setting and referencing that from the Chunk, like:
[[++my-custom-lang-setting]]``
here's the tpl for the captcha, i don't see what you suggested to do.. thx `
<div class="controls">
<div class="input-prepend">
<span class="add-on">
<i class="icon-eye-open"></i>
</span>
[[!recaptchav2_render]]
<span class=" pt-txt help-block muted">Visiteur réel? Merci de cocher svp.
</span>
</div>
<span class="alert live" role="alert">
<span class="badge badge-warning">!
</span> [[%i18n.required? &language=`[[++cultureKey]]` &namespace=`i18ncustom`]]
<span class="label label-warning">Attention
</span>
</span> [[!+fi.error.recaptchav2_error:notempty=`
<span class="alert">
<span class="badge badge-warning">!
</span>[[!+fi.error.recaptchav2_error]]
</span>`]]
</div>
The [[recaptchav2_render]]
Snippet calls a Chunk to render the ReCaptcha form elements and script tags. The Chunk is recaptchav2_html
by default or you can choose the included recaptchav2_invisible_html
, OR you can customize the Chunk to have whatever you want in it.
The default Chunk is:
<div class="g-recaptcha" data-sitekey="[[+site_key]]"></div>
<script type="text/javascript" src="https://www.google.com/recaptcha/api.js?hl=[[++cultureKey]]"></script>
You can change it to:
<div class="g-recaptcha" data-sitekey="[[+site_key]]"></div>
<script type="text/javascript" src="https://www.google.com/recaptcha/api.js?hl=[[++my-custom-setting]]"></script>
I encountered a problem, as i had a mutlilingual website, but the Language of the ReCaptcha wasn't adapted to the cultureKey i had set. So i digged through the snippet an discovered that there is a "Lang" variable, and that my culturKey's are named a little differently as Google has chosen theirs. I tried then to adapt my cultureKeys to those of Google, i have used a switch to change the strings of the Lang variable, only to find out, that it isn't used in the template.
My question is : Why?