chrono with joomfish

Post any questions you may have here

chrono with joomfish

Postby NickN on Mon Jun 23, 2008 6:43 pm

Hi there! Hope you have an solution for me how to use two language form with joomfish. Have tried to put both in one form with this code:
Code: Select all
<?php
$lang =& JFactory::getLanguage();
switch ( $lang->getName() ) {
  case 'english':
?>
[b]english form code[/b]
<?php
  break;

  case 'nederlands':
  default:
?>
[b]Dutch form code[/b]
<?php
  break;
}
?>
......but this solution is not working for me. Form jumps to default language and stays there. Do someone knows how to?
I'm using Joomla 1.5 :S
NickN
Fresh Boarder
 
Posts: 6
Joined: Tue Jun 10, 2008 8:38 pm

Re:chrono with joomfish

Postby GreyHead on Wed Jun 25, 2008 11:12 am

Hi NickN,

Add a line of code to echo $lang->getName() and see what values are being returned. This *should* work if you have the correct (case-sensitive) values in the cases.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3892
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:chrono with joomfish

Postby NickN on Wed Jun 25, 2008 3:57 pm

GreyHead wrote:Hi NickN,

Add a line of code to echo $lang->getName() and see what values are being returned. This *should* work if you have the correct (case-sensitive) values in the cases.

Bob


Tnx for the replay Bob. I have replaced the code:
Code: Select all
switch ( $lang->getName() )

With this one:
Code: Select all
echo $lang->getName();?>

This is the replay I have:
Code: Select all
Parse error: syntax error, unexpected T_CASE in W:\var\www\test\components\com_chronocontact\chronocontact.html.php(83) : eval()'d code on line 72

I supposed to change the case to right one (line 72 is the case)? Is this right?
NickN
Fresh Boarder
 
Posts: 6
Joined: Tue Jun 10, 2008 8:38 pm

Re:chrono with joomfish

Postby NickN on Wed Jun 25, 2008 4:31 pm

Resolved!!!:woohoo:
Thank you man to point me the right way. My case was not right, echo showed me the right language. Replaced and runs like hell :)
Great tool, time to by a license ;)
NickN
Fresh Boarder
 
Posts: 6
Joined: Tue Jun 10, 2008 8:38 pm

Re: chrono with joomfish

Postby lw_d on Mon Oct 20, 2008 4:26 pm

Can somebody post the final code to use, following the original code and the edits, but can get it working.

Thanks
Lee
lw_d
Junior Boarder
 
Posts: 27
Joined: Tue Jan 22, 2008 10:44 am

Re: chrono with joomfish

Postby admin on Mon Oct 20, 2008 7:00 pm

Hi Lee,

whats your joomla version ? can you show me the progress you made with the code, the steps above posted by Bob are straight forward.

cheers,
Max
ChronoForms/ChronoConnectivity/ChronoComments Developer Thanks for using our components!
If you have any problems with any extension please tell us.
If you like any of our extensions please post a review at Joomla.org
Want users to submit their content to your website ? try Submit Story
Want to list/edit/delete your data ? try ChronoConnectivity
Want to have stylish AJAX comments ? try ChronoComments
User avatar
admin
Platinum Boarder
 
Posts: 4224
Joined: Mon Aug 14, 2006 5:29 am

Re: chrono with joomfish

Postby lw_d on Tue Oct 21, 2008 1:16 pm

Hi Max, my Joomla version is 1.5.7, I am working locally, since the site is still in production, I will try to upload today and pm you a link.

Thanks
Lee
lw_d
Junior Boarder
 
Posts: 27
Joined: Tue Jan 22, 2008 10:44 am

Re: chrono with joomfish

Postby admin on Tue Oct 21, 2008 3:14 pm

you can show me the final code you made only, the one you have in the HTML box!

Cheers
Max
ChronoForms/ChronoConnectivity/ChronoComments Developer Thanks for using our components!
If you have any problems with any extension please tell us.
If you like any of our extensions please post a review at Joomla.org
Want users to submit their content to your website ? try Submit Story
Want to list/edit/delete your data ? try ChronoConnectivity
Want to have stylish AJAX comments ? try ChronoComments
User avatar
admin
Platinum Boarder
 
Posts: 4224
Joined: Mon Aug 14, 2006 5:29 am

Re: chrono with joomfish

Postby lw_d on Tue Oct 21, 2008 4:11 pm

I have tried loads of variations, here is what I have at the minute:

Code: Select all
<?php
$lang =& JFactory::getLanguage();
echo $lang->getName();
switch ( $lang->getName() ) {
{
  case 'english':
?>

[b]english form code[/b]

<?php
  break;

  case 'welsh':
  default:
?>
[b]Welsh form code[/b]


This displays no content.

Thanks
lw_d
Junior Boarder
 
Posts: 27
Joined: Tue Jan 22, 2008 10:44 am

Re: chrono with joomfish

Postby lw_d on Tue Oct 21, 2008 4:12 pm

I have also tried this:

Code: Select all
<?php
$lang =& JFactory::getLanguage();
echo $lang->getName() ) {
{
  case 'english':
?>

[b]english form code[/b]

<?php
  break;

  case 'welsh':
  default:
?>
[b]Welsh form code[/b]
lw_d
Junior Boarder
 
Posts: 27
Joined: Tue Jan 22, 2008 10:44 am

Re: chrono with joomfish

Postby admin on Tue Oct 21, 2008 9:13 pm

you should try this :

Code: Select all
    <?php
    $lang =& JFactory::getLanguage();
    echo $lang->getName();
    switch ( $lang->getName() ) {
    {
      case 'english':
    ?>

    [b]english form code[/b]

    <?php
      break;

      case 'welsh':
      default:
    ?>
    [b]Welsh form code[/b]
<?php
      break;
}
?>
ChronoForms/ChronoConnectivity/ChronoComments Developer Thanks for using our components!
If you have any problems with any extension please tell us.
If you like any of our extensions please post a review at Joomla.org
Want users to submit their content to your website ? try Submit Story
Want to list/edit/delete your data ? try ChronoConnectivity
Want to have stylish AJAX comments ? try ChronoComments
User avatar
admin
Platinum Boarder
 
Posts: 4224
Joined: Mon Aug 14, 2006 5:29 am

Re: chrono with joomfish

Postby lw_d on Wed Oct 22, 2008 7:55 am

Unfortunately, I still don't see any text, can't figure it out :(

Lee
lw_d
Junior Boarder
 
Posts: 27
Joined: Tue Jan 22, 2008 10:44 am

Re: chrono with joomfish

Postby lw_d on Wed Oct 22, 2008 10:22 am

I have managed to create a bilingual form by adding the labels as <?php echo JText::_( 'LABELHERE' ) ?>, I can then go into the two language files and create to separate labels, not sure if this is a good way of doing it, but it works for me.

Thanks
lw_d
Junior Boarder
 
Posts: 27
Joined: Tue Jan 22, 2008 10:44 am

Re: chrono with joomfish

Postby GreyHead on Wed Oct 22, 2008 10:56 am

Hi lw_d,

That's how the language files work in the basic Joomal 1.5 (without Joomfish) so it sounds perfect.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3892
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re: chrono with joomfish

Postby lw_d on Wed Oct 22, 2008 11:11 am

Thanks Bob, its a solution I really like, obviously a manual one, but that's perfect for me.

Lee
lw_d
Junior Boarder
 
Posts: 27
Joined: Tue Jan 22, 2008 10:44 am

Next

Return to ChronoForms Questions & Answers

Who is online

Users browsing this forum: rstevens, Yahoo [Bot] and 8 guests