Forums / Setup & design / Multi language site and ezurl

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

eZ debug

Timing: Jan 18 2025 15:52:58
Script start
Timing: Jan 18 2025 15:52:58
Module start 'content'
Timing: Jan 18 2025 15:52:59
Module end 'content'
Timing: Jan 18 2025 15:52:59
Script end

Main resources:

Total runtime0.8235 sec
Peak memory usage4,096.0000 KB
Database Queries210

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0067 589.1406180.8359
Module start 'content' 0.00670.6997 769.9766675.2500
Module end 'content' 0.70640.1170 1,445.2266341.0938
Script end 0.8234  1,786.3203 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.4759210.0002
Check MTime0.00150.1867210.0001
Mysql Total
Database connection0.00070.079510.0007
Mysqli_queries0.740889.96742100.0035
Looping result0.00210.25612080.0000
Template Total0.795596.620.3978
Template load0.00220.261620.0011
Template processing0.793396.342920.3967
Template load and register function0.00010.016310.0001
states
state_id_array0.00180.217910.0018
state_identifier_array0.00140.174420.0007
Override
Cache load0.00190.2294420.0000
Sytem overhead
Fetch class attribute can translate value0.00140.173650.0003
Fetch class attribute name0.00130.1522110.0001
XML
Image XML parsing0.00280.341350.0006
class_abstraction
Instantiating content class attribute0.00000.0031140.0000
General
dbfile0.00270.3310440.0001
String conversion0.00000.000830.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
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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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