Different menus for different languages?

Rostyslav
Rostyslav's picture

Joined: 2006-10-22
Posts: 17
Posted: Sat, 2007-11-10 19:49

Please prompt to me. What I should do that having different menus for different languages?
I have in theme.tpl this line for menu

{g->theme include="engl-header.tpl"}

If browser detected RU language in theme.tpl Gallery should use other line
{g->theme include="rus-header.tpl"}

I can make any lines for needs :)

Thanks.

Login or register to post comments
Slayergirl
Slayergirl's picture

Joined: 2007-09-12
Posts: 173
Posted: Tue, 2007-11-13 12:49

On top of the theme.tpl put this {g->callback type="core.LoadLanguageSelector"}

$block.core.LanguageSelector.language gives the language now selected

{if $block.core.LanguageSelector.language == 'ru_RU'}
{g->theme include="rus-header.tpl"}
{else}
{g->theme include="engl-header.tpl"}
{/if}

I did not try the code so you may get an error but it should look something like this.

Login or register to post comments
Rostyslav
Rostyslav's picture

Joined: 2006-10-22
Posts: 17
Posted: Tue, 2007-11-13 19:08

Thanks a lot!
Good idea, but unfortunally not working.

Login or register to post comments
Slayergirl
Slayergirl's picture

Joined: 2007-09-12
Posts: 173
Posted: Wed, 2007-11-14 08:34

{g->callback type="core.LoadLanguageSelector"} --> need to be at the top above '<!DOCTYPE html' else the page will end up blank.

this on place where header is called:
<div id="gsHeader">
{if $block.core.LanguageSelector.language == 'ru_RU'}
{g->theme include="bla.tpl"}
{else}
{g->theme include="bla_different.tpl"}
{/if}
</div>

It takes the language Gallery2 uses (may not be the same as the browser -- unless browser language detection is on)

Just tried it out en it works...so there's probably something wrong with the tpl's you created or they are placed somewhere else than where gallery2 looks for them (templates dir of active theme)

Now i am going to try to get Gallery2 back in English...Russian is not my thing :(

Login or register to post comments
serbanc

Joined: 2006-05-19
Posts: 177
Posted: Wed, 2007-11-14 12:27

you can use:

{capture name="lang"}{g->language}{/capture}

{ $smarty.capture.lang == 'ro-RO'} {* serbanc: my case, note the '-' *}
/* do something */
{/if}

serbanc - www.e-poze.ro

Login or register to post comments
Rostyslav
Rostyslav's picture

Joined: 2006-10-22
Posts: 17
Posted: Wed, 2007-11-14 13:31
Quote:
serbanc

If not top secret, please prompt me. :) What code are you use for language switcher on site?

Quote:
Slayergirl

I try realize your idea with serbanc caode. :)

Login or register to post comments
serbanc

Joined: 2006-05-19
Posts: 177
Posted: Wed, 2007-11-14 16:30
Rostyslav wrote:
Quote:
serbanc

If not top secret, please prompt me. :) What code are you use for language switcher on site?
prompt = message ?
on which site ? e-poze.ro ?

Quote:
Slayergirl

I try realize your idea with serbanc caode. :)

serbanc - www.e-poze.ro

Login or register to post comments
Slayergirl
Slayergirl's picture

Joined: 2007-09-12
Posts: 173
Posted: Thu, 2007-11-15 09:18
Rostyslav wrote:
Quote:
serbanc

If not top secret, please prompt me. :) What code are you use for language switcher on site?

Quote:
Slayergirl

I try realize your idea with serbanc caode. :)

The idea is kinda the same, I used the languageselector didn't know there was g->language till now ;)

Login or register to post comments
serbanc

Joined: 2006-05-19
Posts: 177
Posted: Thu, 2007-11-15 12:23

as ideea, in my site I use the language selector from joomfish.

now, I am trying something different: http://www.e-poze.ro/gallery2/main.php?g2_view=frontpage.FrontPage
I will let you know about the results

serbanc - www.e-poze.ro

Login or register to post comments
Rostyslav
Rostyslav's picture

Joined: 2006-10-22
Posts: 17
Posted: Mon, 2007-12-03 13:20
Quote:
serbanc

Good Idea. Could you please what code you use?
I tried but have error by wrong authToken.
Thanks.

Login or register to post comments
serbanc

Joined: 2006-05-19
Posts: 177
Posted: Mon, 2007-12-03 14:30

I have a preliminar version working - as you can see.
The problem today is that you have to create the template file by hand (editing of a .TPL file) and not by choosing the positioning of different blocks.

Where did you encountered authToken error ?

serbanc - www.e-poze.ro

Login or register to post comments
AndivomBerg
AndivomBerg's picture

Joined: 2008-05-05
Posts: 4
Posted: Wed, 2008-05-07 20:27

I wonder if this is the solution of my problem: I want to display my gallery2 in german and english language. In my theme.tpl I have an HTML-Navigation. I want to change the language of the navigation when changig the language in the switch-box of gallery2. Is that possible?

Login or register to post comments
Rostyslav
Rostyslav's picture

Joined: 2006-10-22
Posts: 17
Posted: Wed, 2008-05-07 21:02

I did like this for 3 language
http://wedding.malenko.com/?g2_language=ru
http://wedding.malenko.com/?g2_language=en
http://wedding.malenko.com/?g2_language=hr

You may see in my site on the right top corner.
http://wedding.malenko.com

Login or register to post comments
AndivomBerg
AndivomBerg's picture

Joined: 2008-05-05
Posts: 4
Posted: Wed, 2008-05-07 23:29

Yeah, that's what I want! :- )

And how exactly did you realise this?

Login or register to post comments
Rostyslav
Rostyslav's picture

Joined: 2006-10-22
Posts: 17
Posted: Wed, 2008-05-07 23:38

It is built-in function :) Nothing specially to do.

http://wedding.malenko.com

Login or register to post comments
AndivomBerg
AndivomBerg's picture

Joined: 2008-05-05
Posts: 4
Posted: Wed, 2008-05-07 23:43

Is it the multilanguage-plugin? If it is, how did you manage the transformation from the select-box to the flags?

Login or register to post comments