switch language link

Author Message

andre müller

Tuesday 19 August 2003 12:02:06 am

is there a nice way to detect, which language is currently set and to dynamically set a link to switch language?
thanks

Alexandre Cunha

Tuesday 19 August 2003 2:19:38 pm

way to detect ? what you mean ?

How to make a link on your front site do swith language ?

First, read this answer from Paulo Almeida how setup a multilingual site:
http://ez.no/developer/ez_publish_3/forum/setup_design/really_i_need_help_about_ulr_alias_language_

The, you can create links to switch between languages by this way:
- assuming you have settings\siteaccess\yoursite_eng\ and settings\siteaccess\yoursite_por\ for each language.
- create this links:
<a href="/index.php/yoursite_por/">Portugu&ecirc;s</a>
<a href="/index.php/yoursite_eng/">English</a>

axel

http://AlexandreCunha.com

andre müller

Thursday 11 September 2003 12:44:49 am

thank you very much, axel. I did exactly what you said and this works. i simply thought i could have one link only. if i'm on the english site there would appear a text saying switch to german and vice versa. for this to work, i would have to be able to find out in my template what language is currently set.

Gunnstein Lye

Thursday 11 September 2003 4:50:07 am

You can read the current language from the ini settings using the ezini operator.

{section show=eq(ezini('RegionalSettings','Locale'),'eng-GB')}
This is english
{/section}

It will automatically pick up ini overrides.
(To read variables from other ini files than site.ini, use the file name as a third parameter to the ezini call.)

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 06:11:45
Script start
Timing: Jan 31 2025 06:11:45
Module start 'layout'
Timing: Jan 31 2025 06:11:45
Module start 'content'
Timing: Jan 31 2025 06:11:45
Module end 'content'
Timing: Jan 31 2025 06:11:45
Script end

Main resources:

Total runtime0.0100 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0036 588.1250151.2109
Module start 'layout' 0.00360.0018 739.335936.6484
Module start 'content' 0.00540.0033 775.984490.1250
Module end 'content' 0.00870.0013 866.109433.9922
Script end 0.0100  900.1016 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002020.2364140.0001
Check MTime0.00109.6473140.0001
Mysql Total
Database connection0.00044.010210.0004
Mysqli_queries0.001615.900430.0005
Looping result0.00000.080910.0000
Template Total0.001010.210.0010
Template load0.00087.701610.0008
Template processing0.00022.435610.0002
Override
Cache load0.00055.159010.0005
General
dbfile0.00021.774480.0000
String conversion0.00000.038140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs