reCaptcha language in K2

GK User
Wed Feb 02, 2011 4:00 pm
I see in other forum how to change the language in reCaptcha.

The solution is:

1. Globally:

Open up the following files in a text editor then add below block of code to right before </head> tag:

* joomla-directory/templates/your-default-template/index.php
* joomla-directory/templates/your-default-template/component.php

Code: Select all
<script type="text/javascript" language="javascript"><!-- // --><![CDATA[
var RecaptchaOptions = {
   lang : 'es'
};
// ]]></script>


2. Locally:

In the view template file where you either placing the inclusion syntax or triggerEvent code for embedding captcha verification, put following block of code right before the inclusion syntax or triggerEvent code:

Code: Select all
<?php
$document =& JFactory::getDocument();
$document->addScriptDeclaration("
var RecaptchaOptions = {
   lang : 'es'
};
");
?>


I need to locate (line number) to put the first option and in method 2 I have no idea in what file I need to add that code.

could you help me?
User avatar
Fresh Boarder

teitbite
Thu Feb 03, 2011 5:02 am
Hi

Please try in /layouts/blocks/head.php
User avatar
Moderator

GK User
Thu Feb 03, 2011 11:26 am
I put this code in head.php, after script in line 48:
Code: Select all
<script type="text/javascript">
var siteurl='<?php echo $this->baseurl();?>';
var tmplurl='<?php echo $this->templateurl();?>';
</script>


<script type="text/javascript">
var RecaptchaOptions = {
   lang : 'pt',
};
</script>


And I put this same code in component.php after line 38:
Code: Select all
<?php endif; ?>


<script type="text/javascript">
var RecaptchaOptions = {lang : 'pt',};
</script>


But not work.

Any ideas where I put the code from item 2 (locally)?

Thanks!
User avatar
Fresh Boarder

teitbite
Fri Feb 04, 2011 12:48 am
Hi

Sorry. If this code is working at all than placing it anywhere in html code should work. Try maby just before this capcha element.
User avatar
Moderator


cron