Question

I have to use multiple languages of Recaptcha on a website which is programmed in jsp and serverside-javascript and uses Liferay.

Now since Recapchas language option is buggy, the only way to change the language of the plugin is by adding &hl=de (german for example) after the public key in the script tag.

My question is now: can i use something like this?

<script type="text/javascript"
        src="http://www.google.com/recaptcha/api/challenge?k=my_public_key&hl=<%= liferay-ui:message key="captchalang"%>">
    </script>

I've defined the different language keys already in my language config files. I just need to get the value of it into the src""

I know this isn't much information but I just started working as a programmer and i've never seen something like jsp/serverside-javascript before(so I have little to no idea of how this works...).

Thanks and Cheers

Jutschge

Was it helpful?

Solution

Instead of

 <%= liferay-ui:message key="captchalang"%>

use

 <liferay-ui:message key="captchalang"></liferay-ui:message>

because this liferay thing is apparently a tag library.

That also means at the top of your JSP you will need to include the tag library. It should look something like this:

 <%@ taglib uri="http://liferay.com/tld/liferay-ui" prefix="liferay-ui" %>

and you will also need to put the jar file of the tag library in the right spot on the server.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top