Multi language site and ezurl

Author Message

laurent le cadet

Wednesday 14 June 2006 9:35:02 am

Hi,

I have a multilanguage site with flags (as on ez.no)
It's easy to change the langage with the site access (/fr , /en, /de) but I would like to be able to change language of the current page without going back to the home page.

Any hints ?

Laurent

J-A Eberhard

Wednesday 14 June 2006 12:10:15 pm

Try this

<ul>
       {def $locales=fetch( 'content', 'translation_list' )}
               {foreach $locales as $locale}
                       <li>
<a href={concat("../",$locale.country_code|downcase(),"/",$module_result.content_info.url_alias)|ezurl}>
{$locale.language_name}</a>
                      </li>
                       {/if}
                {/foreach}
        {undef}
</ul>

Open Source Solution Provider
Open-Net Ltd Switzerland
http://www.open-net.ch

laurent le cadet

Wednesday 14 June 2006 11:43:34 pm

Works fine.

Thanks.

Laurent

Jeroen Sangers

Thursday 15 June 2006 12:40:09 am

Note that it is better not to use flags. After all, a flag is a symbol of a country, and there is no one-to-one mapping between countries and languages.

I find it quite disturbing that ez.no is using flags. Why should, for example, a Portuguese select the flag of Brasil to select his native language? It's quite possible that a Portuguese does not even know the flag of Brazil.

Besides that, they display the names of the languages in the language of the current page, with the result that a Portuguese who doesn't speak English is not even able to find out that his language is available! If you mention the names of the languages, please put them in the language self: English (or British English or US English, if needed), svenska, suomi, Deutsch, français...

If you need something shorter, you can use the codes defined in the international standard ISO 639, either the two-letter codes of ISO 639-1, such as <b>en</b> for English, or the three-letter codes of ISO 639-2, like <b>eng</b> for English.

laurent le cadet

Thursday 15 June 2006 12:56:41 am

Your right (even if brasilian flag is well know as they are on the top 5 football teams ;).

In my case, I used also full text but flags are usefull as they used a small amount of place.

Laurent

I'm not sure the ISO code is comprehensive by current net surfers.

Xavier Dutoit

Thursday 15 June 2006 6:26:37 am

Hi,

Flags are also an usability problem for the colorblinds. If you don't see the difference between red and green, quite a few 3 bands flags are going to look the same.

At least, put a alt tag with the name of the language.

X+

http://www.sydesy.com

laurent le cadet

Thursday 15 June 2006 8:15:48 am

Your also right Xavier,
Happy to see that a 18x12 pixels become a real interesting thread.

My option is a alt+title tag.

Laurent

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 18 2025 18:41:11
Script start
Timing: Jan 18 2025 18:41:11
Module start 'layout'
Timing: Jan 18 2025 18:41:11
Module start 'content'
Timing: Jan 18 2025 18:41:12
Module end 'content'
Timing: Jan 18 2025 18:41:12
Script end

Main resources:

Total runtime1.0206 sec
Peak memory usage4,096.0000 KB
Database Queries73

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 587.9141152.6250
Module start 'layout' 0.00510.0022 740.539139.4453
Module start 'content' 0.00731.0121 779.9844670.1719
Module end 'content' 1.01930.0013 1,450.156316.1641
Script end 1.0206  1,466.3203 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.3084160.0002
Check MTime0.00140.1329160.0001
Mysql Total
Database connection0.00070.070910.0007
Mysqli_queries0.950693.1340730.0130
Looping result0.00070.0729710.0000
Template Total0.991097.120.4955
Template load0.00230.228320.0012
Template processing0.988696.861620.4943
Template load and register function0.00010.007510.0001
states
state_id_array0.00100.099810.0010
state_identifier_array0.00140.134720.0007
Override
Cache load0.00210.2035420.0000
Sytem overhead
Fetch class attribute can translate value0.00050.047340.0001
Fetch class attribute name0.00140.1335110.0001
XML
Image XML parsing0.00170.167740.0004
class_abstraction
Instantiating content class attribute0.00000.0028140.0000
General
dbfile0.00090.0887330.0000
String conversion0.00000.000640.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
7content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 27
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs