Forums / Setup & design / Problem deciding which language is in use

Problem deciding which language is in use

Author Message

Felix Laate

Monday 15 May 2006 4:35:52 am

Hi all!

I'm setting up a multiligual site with 3.8, and it goes quite well. Really nice improvements have been done to the ligual part of the system.

I have one problem though. In my pagelayout I want write a heading according to which language is in use.

In the old days I used to do it like this:

{section show=eq(ezini('RegionalSettings','Locale'),'eng-GB')}ยจ
..

This doesn't work anymore, so I tried this:

{if begins_with($module_result.uri,'/eng')}
<h3>Latest Calls:</h3>
{else}						
<h3>Siste utlysninger:</h3>
{/if}

This should work, as I use siteaccess as "language-decider". But for some reason <i>begins_with</i> will not work. If I use I use <i>eq</i>, it works.. but I obvioulsy need the former..

Any answer could be the right one!

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Fabio Carissimi

Monday 15 May 2006 6:07:18 am

I think you can watch the content of $node.object.current_language, it
should contain the language code in the format eng-GB (or fre-FR, ...)

so you can do something like :

 {if eq($node.object.current_language,'eng-GB')} ...

You can also put {$node.object|attribute('show',2)} to see what variables
concerning languages you can use.

Have also a look at this thread : http://ez.no/community/forum/setup_design/available_languages_for_objects_in_3_8
it can help you to understand some things, and if you find an answer ...

I hope this helps you

Marc Boon

Monday 15 May 2006 9:08:11 am

ezini('RegionalSettings','Locale') gives you the locale as defined in the siteaccess, which still works in 3.8. New in 3.8 is $node.object.current_language, which gives you the language of the actual object. This is not necessarily the same as the language of the site access. In site.ini.append you can specify in SiteLanguageList[] which translations are to be presented, and in which priority. If the object is not available in the language of the site access, it can be displayed in another language. The value of ShowUntranslatedObjects also influences which translation is actually shown.

Felix Laate

Tuesday 16 May 2006 12:50:15 am

Hi there!

Thank you people for answering!

I went for this model:

{if eq($current_node.object.current_language,'eng-GB')}
 English content..
{else}
 Other content..
{/if}

Only "problem" is that, since this is done in the pagelayout, I need to fetch the node.

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com