Cannot translate form with plugin?

kai920 28 Sep, 2009
Hi,

I am using the latest multi language plugin but am unable to get any of the strings to translate. Any ideas? let me know if more info is needed for diagnosis...

Here is a row of the form. It was not created using the wizard:

<tr>
															<td width="150"><font size="2" face="Arial, Helvetica, sans-serif"><nobr>Last Name </nobr></font><font size="2" face="Arial, Helvetica, sans-serif" color="#ee0000"><nobr>*</nobr></font><font size="2" face="Arial, Helvetica, sans-serif"><nobr> :</nobr></font></td>
														<td><input type="text" maxlength="50" size="25" name="lastname"/></td>
															</tr>


In the plugin I have set it up like this, but no strings are translated when I change languages using Joomfish:
[attachment=0]Screen shot 2009-09-28 at 8.14.24 PM.jpg[/attachment]

I am using Chronoforms 3.1 RC5.5 and Joomfish 2.03.
GreyHead 28 Sep, 2009
Hi kai920,

a) do you have the plugin enabled in the form Plugins tab?

b) What do you see in the 'translated' version?

Bob

PS I have no idea if this will work with ideograms - but I don't see why not.
kai920 28 Sep, 2009
Ah, I double checked the plugins tab... I thought they were all enabled because of the green check marks, but I was wrong. I got confused by the colors.

I believe it is enabled now:
[attachment=0]Screen shot 2009-09-28 at 9.29.45 PM.jpg[/attachment]

But now I get this error on the form:

Warning: Missing argument 4 for cf_multi_language::onload(), called in /public_html/plugins/content/chronocontact.php on line 370 and defined in /public_html/components/com_chronocontact/plugins/cf_multi_language.php on line 181

Fatal error: Call to a member function get() on a non-object in /public_html/components/com_chronocontact/plugins/cf_multi_language.php on line 190

GreyHead 28 Sep, 2009
Hi kai920,

Please will you test first without using the ChronoForms Plugin - just open the form from the link in the Forms manager.

It looks as though there is something missing between the ChronoForms Plugin and the multi-langiage plugin.

Bob
kai920 28 Sep, 2009
It appears to work with the non-SEF URL. The Last Name translates if I put in &lang=zh-CN , &lang=zh-HK.

What should I try next?
GreyHead 28 Sep, 2009
Hi kai920,

I don't know; it checks the Joomla Language tag
$lang =& JFactory::getLanguage();
$LangTag = $lang->getTag();
If that isn't set then it has no way of knowing which language to use.

Bob
kai920 28 Sep, 2009
Think I could try a simple getVar on lang in the URL?
GreyHead 28 Sep, 2009
Hi kai920,

By all means try it.

How does the lang info get passed if there is nothing in the url?

Bob
kai920 28 Sep, 2009
Maybe I could hard-code it to default to 'en-GB' if there's nothing there? I don't know :?

Something like getVar('lang','en-GB') perhaps.

I'll give it a go tomorrow and let you know how it turns out...
kai920 29 Sep, 2009
Hi GreyHead,

I hard-coded the $formname to be 'contact' (I only have one form)



		$formname = JRequest::getVar('chronoformname');
		if ( !$formname ) {
 			$formname = $params->get('formname');
		}
		$formname = 'contact';
		$MyForm =& CFChronoForm::getInstance($formname);


Now I have a different issue -

Fatal error: Class 'CFChronoForm' not found in /public_html/components/com_chronocontact/plugins/cf_multi_language.php on line 192

Class not found - hmmm, is something not installed properly on my end? Am I using an outdated version of something?


Thanks
GreyHead 29 Sep, 2009
Hi kai920,

I'm not sure about that error. I'll take a look. Are you running the form from the ChronoForms Plugin?

Bob

PS There were some typos left in the modified plugin I posted elsewhere. Fixed version (I hope) attached.
kai920 29 Sep, 2009
Hi Bob,

I am using the ChronoForms plugin, I assume you mean this part in my article?

{chronocontact}contact{/chronocontact}


I've uploaded your updated php file and it appears the fatal errors are gone. Not translating though. I'll try creating a direct Joomla menu link instead of using an article/chronocontact plugin. Hopefully that'll be the key..

edit: oops, I activated the multipage plugin instead🙂 activated the multilang plugin for real this time, no errors and looks like translations working. will do more translations and test.
kai920 29 Sep, 2009
I got the translations to work finally with the direct menu link... but the plugin doesn't seem to work with an embedded form using { chronocontact }

Anyhow, thanks for the help Bob. Cheers
This topic is locked and no more replies can be posted.