Different menus for different languages?
|
Rostyslav
![]()
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? {g->theme include="engl-header.tpl"} If browser detected RU language in theme.tpl Gallery should use other line I can make any lines for needs Thanks. |
|
| Login or register to post comments |


Posts: 173
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.
Posts: 17
Thanks a lot!
Good idea, but unfortunally not working.
Posts: 173
{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
Posts: 177
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
Posts: 17
If not top secret, please prompt me.
What code are you use for language switcher on site?
I try realize your idea with serbanc caode.
Posts: 177
serbanc - www.e-poze.ro
Posts: 173
The idea is kinda the same, I used the languageselector didn't know there was g->language till now ;)
Posts: 177
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
Posts: 17
Good Idea. Could you please what code you use?
I tried but have error by wrong authToken.
Thanks.
Posts: 177
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
Posts: 4
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?
Posts: 17
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
Posts: 4
Yeah, that's what I want! :- )
And how exactly did you realise this?
Posts: 17
It is built-in function
Nothing specially to do.
http://wedding.malenko.com
Posts: 4
Is it the multilanguage-plugin? If it is, how did you manage the transformation from the select-box to the flags?