I use Joomfish for the rest of my site to translate pages, and I couldn't get the multi language ChronoForms plugin to work with the Joomfish frontend flags some reason, so here is a work around that I am using to get Joomfish to play nice with ChronoForms.
1) Create the form you want in CF in the default language (mine is called signup_en).
2) Copy the form, edit and change the language, and change the form name, I used signup_it for an Italian translation.
3) Go to Joomfish and translate the menu item for the form. Under Parameters (Basic) change the translated menu name to the copied form name (in my case, signup_it)
All done. Clicking on the flag icons works perfectly (although they are really just redirecting the user to a different form). Obviously the drawback is if you are going to be making changes, you'd have to change multiple forms. Not ideal, but workable in some cases.
hi drleper...
have exactly the same problem...
did all, as you explained but no luck
did you mean by "2) Copy the form, edit and change the language" using the multilanguage-plugin of chronoforms and specifying for the 2nd form (in your case) in "Laguages Supported" and "Default Languages" "it-IT" ???
i did that for me, but no luck
any help?
thanks in advance!
Hi dee25,
If I understand drleper's post correctly you need to create a second copy of the form and translate that into the second language. I can see that should work OK.
Bob
PS I don't understand why the multi-language plugin doesn't do it more easily though . . .
hi bob, thanks for the quick reply,
the trouble is not that the translations are not working. either way works great, the multilanguage-plugin and drlepers solution. the issue i am having, and the reason why drleper suggested his solution (i guess) was that for some reason joomfish-frontend-flags do not switch for correctly chronoforms. let me explain:
- default language is german (DE)
- second language (translations) are in (EN)
- when i am in DE and click on the chronoforms-link (which is just a link on the site linking to the chrono-link which is inside a hidden-menu) everything is fine
- when i switch (while in the chronoform) to EN, the form changes to english (in both solutions: with multilanguage-plug and drlepers way) BUT (and here is the trouble) the flag switches back to DE ... ??? so DE stays enabled with EN-form-content ... this is very confusing for a user, i am sure. but why happens this missbehaviour?
unfortunately i am currently working on a big clients new site which is on a test-server, so i cant give you a link with login etc. but maybe you can setup a test with my description above and see what i mean / or you already know why this happens? any help / suggestion would be great and appreciated deeply, as i have to finish the project in 2 weeks time. it took me a long time to evaluate all kinds of form-plugins and finally chose yours, as it has most features and is most flexible. but so close before finishing the project encountering this error is really annoying... (its due to the fact that i always incorporate 2nd language towards the end...)
best regards,
dee
thanks for the quick reply.
your flag doesnt change because you do not set any visible changes in your css for id="active_language". but as i can see in the behaviour of your link it works fine. when you click on "FR" this SPAN gets the id="active_language" and when you click on "EN", "EN" gets it... thats the trouble on my site! for some reason, clicking on "EN", "DE"s LI (i am using a list) gets the id="active_language" instead of "EN" ...
i didnt change any joomfish or chronoforms corefiles...
i will investigate further tomorrow... maybe you get any other idea as well, or you can replicate the problem... (as i said, i am using a list for showing the flags)
good night then and thanks!
Hi dee25,
I played around a bit with the options in the JoomFish module but they all seem to work correctly for me :-(
Bob
thanks bob so far! i wasnt so lucky...
i think the trouble lies somewhere inside chronoforms in combination on how it works with joomfish...
could you please try create a module, lets say with jumi and add the following code to it:
$lang = &JFactory::getLanguage();
$mylang = substr($lang->getTag(), 0, 2);
echo $mylang;
then publish the module on a certain position and see what language the module writes when you switch on the chronoform-page from one language to another!
is it the correct one?
i am getting mental on this...
thanks bob,
it is great how fast you helped!
it seems that the trouble lied within two modules i created with JUMI...
as long as i used:
$lang = &JFactory::getLanguage();
$mylang = substr($lang->getTag(), 0, 2);
it didnt worked...
i replaced that code with:
$thelang = &JFactory::getLanguage();
$mylang = substr($thelang->getTag(), 0, 2);
and now it works!!!
dont have any idea why this happens...
maybe it helps somebody in future!
thanks again!
Hi dee25,
Ah - that might be because ChronoForms is also using $lang . . . I'm not sure. Next time I edit the plugin I'll change it to $cf_lang.
Bob
its good practice to use always prefixes for variables when you build plugins/modules/components i guess... had similar trouble with chronoforms-testing a couple of months ago. didnt use it back then for the project coz i couldnt fix it, but i guess now it was due to variables after this experience.
if this was the problem indeed this time (which it seems to be) then "$cf_" before all variables the plugins uses would be a great addition to the next version
take care
Hi dee25,
I think Max has fixed most of the core ChronoForms variables - at least where they overlap with Joomla variables. I guess we'll keep working at it.
Though I guess the reverse is true too, if you use a variable in Jumi that should have a unique name . . .
Bob
of course it is! but sometimes in prototyping you just write code in order to test... half blame on me! take care and thanks again!
Making multiple copies worked like a charm. 3 to be precise.
I have another problem actually. The logo on the website links to the index page and keeps defaulting to English regardless of what language i am currently using. I have 3 languages. English, French and Japanese.
I am not sure if this is the right place to ask, but how can i check for the current language and display the corresponding language url (index.php/fr or index.php/jp)??
Any help on this would be greatly appreciated.
Thanks
Hi skidhard,
The code to get the current language is about three posts back. How you set it in the URL I've no idea. Equally I've no idea why using three forms to handle three languages is a good idea :-(
Bob
Hey there,
Thanks for the reply. Getting the URL is the most important thing really. but naturally its beyond the purview of this forum.
About the other comment you made, what do you propose should the solution be? I would really like to know that....😉
Cheers...
PS: A saw your site as an example in one of the posts and when I click on the logo it remains in the same language instead of reverting to the default language. So i thought you might be able to help on the URL thingy.
Hi skidhard,
On my site I did nothing special with the URLs, just let Joomfish do it's work in the background :-(
I have two approaches with multi-language forms - both similar.
The easiest is the ChronoForms Multi-language plugin which - in my experience - just works. (There is the one problem identified with using it in the module earlier in this thread.) This is fine where the text snippets to be translated are no more than one line.
For more complex forms with large blocks of text I keep the Form HTMl the same but include a language file or files into the page using a switch statement depending on the language tag. This is closer to the Joomla approach with external language files. (If I recall correctly I also did this once when one of the languages was rtl by switching a class statement too.)
The *great* advantage of both these approaches over the 'three form' approach is that I only have one set of Form Code to maintain and update.
Bob
Hey Bob,
Thanks for the reply (again). I think temporarily I will stick to the different forms per language option. However (i might be asking too much here), would it be possible for you to take a look at my site? Its a localhost (you can use teamviewer for that)??
Waiting for a reply.....
Cheers.....
Hi skiddhard,
Sorry, don't know the software and I really don't want to go down the road of linking through other computers.
Bob
Hey Bob,
I knew I was asking for too much. But that really was a crisis situation for me, and I kinda knew what your response would be. Anyway, the software is actually pretty helpful. I wanted you to take control of my PC not the other way round.
About the issue, its solved. And like you had mentioned, it really was nothing special about the logo. It was Joomla (cookie) all the way.
Thanks for the help anyway.
Cheers.....
Siddharth Lele