[SOLVED] language dependent module

How to support more than one language on your site.

Moderator: General Support Moderators

User avatar
Beata
Joomla! Ace
Joomla! Ace
Posts: 1084
Joined: Fri Mar 02, 2007 2:06 pm
Location: Lithuania

Re: [SOLVED] language dependent module

Post by Beata » Sat Aug 04, 2007 11:54 am

OK, my modules work only for left
How I could figured it?

mainmenu is for lithuanian
mainmenu_en is for English

designguru wrote:
Okay Guys,  I figured it out and this is a fantastic soluton I'm sure lots of you implementing Joomfish will love!

I decided to write a simple php statement that will load certain module positions in the same space on a template, depending which language I want them to independantly handle.

Benefits of this approach:
  • you can create content in any language you want and hide the default message or auto-created joomfish version
  • you have flexibility in what you want each language's menu-modules to display
  • you can still include native language menu items in your alternate language menus - effectively using joomfish for parts of your site and not the whole site
Here's the code:

Code: Select all

<!-- BEGIN custom language switch by http://www.designguru.org to load language-specific modules -->

<?php
if ($mosConfig_lang== english )
{mosLoadModules ( 'inside_r', -2 );} 
?>

<?php
if ($mosConfig_lang== french )
{mosLoadModules ( 'inside_rfr', -2 );} 
?>

<!-- END language switch -->
Of course, you can use any module position - you aren't restricted to 'inside_r' and 'inside_rfr' - I arbitrarily chose 'em ;)


Cheers,

q./

User avatar
Beata
Joomla! Ace
Joomla! Ace
Posts: 1084
Joined: Fri Mar 02, 2007 2:06 pm
Location: Lithuania

Re: [SOLVED] language dependent module

Post by Beata » Sat Aug 04, 2007 12:04 pm

nothing helps !!!!!!!!!!!!!!!!!!!!!!!
adrianmak wrote: after reading this post, for language dependent menu module there are two solutions
1. making depend language menu like mainmenu, mainmenu_nl, mainmenu_jp and install the multilingual aware mod_mainmenu for Joomla

2. use php code like others posted, to call different language module

Am I right ?

User avatar
panter011
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Fri Sep 02, 2005 8:45 pm
Location: Peru - The Land for All Your Senses
Contact:

Re: [SOLVED] language dependent module

Post by panter011 » Sat Oct 27, 2007 9:20 pm

designguru wrote:
Okay Guys,  I figured it out and this is a fantastic soluton I'm sure lots of you implementing Joomfish will love!

I decided to write a simple php statement that will load certain module positions in the same space on a template, depending which language I want them to independantly handle.

Benefits of this approach:
  • you can create content in any language you want and hide the default message or auto-created joomfish version
  • you have flexibility in what you want each language's menu-modules to display
  • you can still include native language menu items in your alternate language menus - effectively using joomfish for parts of your site and not the whole site
Here's the code:

Code: Select all

<!-- BEGIN custom language switch by http://www.designguru.org to load language-specific modules -->

<?php
if ($mosConfig_lang== english )
{mosLoadModules ( 'inside_r', -2 );} 
?>

<?php
if ($mosConfig_lang== french )
{mosLoadModules ( 'inside_rfr', -2 );} 
?>

<!-- END language switch -->
Of course, you can use any module position - you aren't restricted to 'inside_r' and 'inside_rfr' - I arbitrarily chose 'em ;)


Cheers,

q./
and where should i put this code?

thanks
JYG

dabbish
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Fri Nov 02, 2007 4:26 am

Re: [SOLVED] language dependent module

Post by dabbish » Tue Jan 22, 2008 3:26 pm

u should put that code in the index.php of your template.

if you're gettin parse errors try encapsulating the language strings with quotes like:

if ($mosConfig_lang== 'english' )


Locked

Return to “Joom!Fish and Multilingual Sites”