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

eZ debug

Timing: Jan 18 2025 11:01:55
Script start
Timing: Jan 18 2025 11:01:55
Module start 'content'
Timing: Jan 18 2025 11:01:56
Module end 'content'
Timing: Jan 18 2025 11:01:56
Script end

Main resources:

Total runtime1.0797 sec
Peak memory usage4,096.0000 KB
Database Queries199

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0070 588.9766180.8125
Module start 'content' 0.00700.9076 769.7891589.8203
Module end 'content' 0.91460.1650 1,359.6094337.3672
Script end 1.0796  1,696.9766 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00440.4068210.0002
Check MTime0.00180.1658210.0001
Mysql Total
Database connection0.00100.088710.0010
Mysqli_queries0.998692.48841990.0050
Looping result0.00220.20081970.0000
Template Total1.050097.220.5250
Template load0.00210.191420.0010
Template processing1.047997.055920.5239
Template load and register function0.00010.009710.0001
states
state_id_array0.00080.076210.0008
state_identifier_array0.00070.069420.0004
Override
Cache load0.00170.1559340.0000
Sytem overhead
Fetch class attribute can translate value0.00170.155340.0004
Fetch class attribute name0.00120.106850.0002
XML
Image XML parsing0.00100.095140.0003
class_abstraction
Instantiating content class attribute0.00000.001060.0000
General
dbfile0.00500.4594270.0002
String conversion0.00000.000530.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 24
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs