Closed mathieu-morchipont closed 6 years ago
There is currently no support in the ReCaptcha Library to change the language through javascript. The language identifier is passed in through the URL param and needs script reloading to refresh the language.
We could probably expose the captcha service which is currently set to be private but manipulating DOM this way seems to hacky.
@achimha What are your thoughts on this?
We need the ability to change the language of recaptcha too. The next condition should be changed to check the variability of language. https://yadi.sk/i/A1NK_Gxi3LdLn2
But the best way to achieve this goal is to define @Input language: string in ReCaptchaComponent to allow data binding to him.
Could you provide this solution in the closest time?
@User3290 That's not the problem. We already have the language input that works. Just not the way OP wants.
I have troubles with the language , is shown in spain and i need on english, how i can change the language??
This is not currently supported in ReCaptcha library. Changing language means re-rendering the component and that is something that can be handled in application code easily.
Anyone can share some code on how they achieved this?
Check the constructor of the class you can send the language
@Filip1986 There is a way you can do it, atleast it makes logical sense. The idea is to re-render/re-initiate the component everytime you need to change language. @patroclo404 Changing the bound language param will not work. The captcha needs to be reinitialized to make the language change work.
@xmaestro: What would be the best way to re-render/re-initiate re-captcha component? I added language attibute and *ngIf="flag" to re-captcha and then I changed language and flag to false and then to true. Re-captcha was reloaded, but language was'nt changed. What could be possibly wrong?
This captcha log good language but it's not refresh.
Thks ( sorry for my english :) )