Default language

Author Message

Carlos Revillo

Tuesday 06 June 2006 9:33:34 am

Hi. I'm working in a site with three languages. I have three siteacces. site_sp, site_fr, site_en

What i want is redirect visitor to one of these siteaccess by the language his browser is.

I mean. If the browser has default language is Spanish, i would like visitor goes to site_sp.
...
And in other cases, visitor goes to site_en.

Sorry for my english, by the way :).

Is there any quick way to do that?.

Thanks.

Kristof Coomans

Tuesday 06 June 2006 10:01:36 am

Hi Carlos

I would make an index page outside of eZ publish, that reads the needed HTTP request header ( Accept-Language I guess ) and let that page redirect to the right site access.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Marc Boon

Wednesday 07 June 2006 2:25:00 pm

You could also use siteaccess based on a server variable directly.
In site.ini.append.php:

[SiteAccessSettings]
AvailableSiteAccessList[]=admin
AvailableSiteAccessList[]=en
AvailableSiteAccessList[]=es
AvailableSiteAccessList[]=fr
MatchOrder=servervar;host
HostMatchType=map
HostMatchMapItems[]=admin.example.com;admin
ServerVariableName=HTTP_ACCEPT_LANGUAGE

In this example you use host access for your admin site, using a subdomain.

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 01:15:13
Script start
Timing: Jan 31 2025 01:15:13
Module start 'layout'
Timing: Jan 31 2025 01:15:13
Module start 'content'
Timing: Jan 31 2025 01:15:13
Module end 'content'
Timing: Jan 31 2025 01:15:13
Script end

Main resources:

Total runtime0.0429 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 588.0078151.1953
Module start 'layout' 0.00540.0047 739.2031220.6484
Module start 'content' 0.01010.0308 959.8516997.8594
Module end 'content' 0.04090.0020 1,957.710929.9922
Script end 0.0428  1,987.7031 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00296.8503140.0002
Check MTime0.00133.0795140.0001
Mysql Total
Database connection0.00092.191110.0009
Mysqli_queries0.00266.129430.0009
Looping result0.00000.041710.0000
Template Total0.00143.310.0014
Template load0.00112.492010.0011
Template processing0.00030.749310.0003
Override
Cache load0.00081.763910.0008
General
dbfile0.013130.525980.0016
String conversion0.00000.020640.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