Forums / General / [Solved] Same Problem with the Language Switcher in 4.1.1

[Solved] Same Problem with the Language Switcher in 4.1.1

Author Message

Hakim Bouras

Friday 08 May 2009 7:46:07 am

Hi,

I tried to set a multilingual site with french language as default and english, german and italian as other languages. I tried eZ Webin and eZ Flow installation, with URL setting and host settings and I never get the language switcher to work.

I thought that I will maybe be fixed with the version 4.1.1, I retry to set the same multiligual site and it is still not working.

When I create a french version of an object "test_node_fre" that I translate in english and german, I can access the different version by manually typing the URL:
- fre.site.test/test_node_fre (the language switcher toolbar highlight the "Fre" link)
- ger.site.test/test_node_ger (the language switcher toolbar highlight the "Ger" link)
- eng.site.test/test_node_eng (the language switcher toolbar highlight the "Eng" link)

From the french version of the node, if I click on the "Eng" link of the switcher (URL of the link is : fre.site.test/switchlanguage/to/eng/test_node_fre ), the navigator tries to go to the page :
- <b>fre</b>.site.test/test_node_<b>eng</b>

The problem is that the switcher get a proper translation of the node name (test_node_eng) but does not translate correctly the site-access (fre.site.test instead of eng.site.test). Whatever the current siteaccess is, and the language I try to change to, It always tries to use the default site access (fre.site.test).

As I did with the 4.1.0, I have set the SiteAccess used by the switcher both :
- from the "Site Settings" page (of the eZ Flow UI)
- from the setting.ini file in the override folder

[RegionalSettings]
TranslationSA[]
TranslationSA[fre]=Fre
TranslationSA[ger]=Ger
TranslationSA[eng]=Eng
TranslationSA[ita]=Ita

Any idea what I could have done wrong that could explan this problem ? Does anyone have successfully use the language switcher in a similar config ?

Thank you for your help,
Hakim

Hakim Bouras

Sunday 10 May 2009 4:14:30 am

Hi,

I have made further testing with an installation with eng-GB as default language, and it is still the same problem (see below the description of the installation).

Any clue to go further with this issue will be greatly appreciated.

Thanks,
Hakim

I use the following package for my installation : http://ez.no/download/ez_publish/ez_publish_4_stable_releases/4_1/4_1_1/ezpublish_4_1_1_with_ezc_gpl_zip

  Site package  - ezflow_site
  Title         - Test multilingual site
  URL           - http://eng.site.test
  Admin URL     - http://admin.site.test
  Access type   - hostname
  Access value  - eng.site.test

Web server info:
Version - Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i mod_autoindex_color PHP/5.2.8

PHP info:
Version - 5.2.8

OS info
Name - Windows NT 6.0 build 6001

Database info:
Type - MySQL Improved
Driver - ezmysqli

Email info:
Transport - SMTP

Regional info:
Primary - eng-GB
Additional - ger-DE, fre-FR, eng-GB

The config of my virtual host is as followed:


<VirtualHost *:80>
    <Directory "D:\Data\test_site\trunk-ezflow">
		Options Indexes FollowSymLinks
		AllowOverride all
		Order Allow,Deny
		Allow from all
    </Directory>

    DocumentRoot "D:\Data\test_site\trunk-ezflow"
	
    <IfModule mod_php5.c>
        php_admin_flag safe_mode Off
        php_admin_value register_globals    0
        php_value magic_quotes_gpc  0
        php_value magic_quotes_runtime  0
        php_value allow_call_time_pass_reference 0
    </IfModule>
 
    DirectoryIndex index.php
 
    <IfModule mod_rewrite.c>
        RewriteEngine On
	RewriteRule content/treemenu/? /index_treemenu.php [L] 
	Rewriterule ^/var/storage/.* - [L]
	Rewriterule ^/var/[^/]+/storage/.* - [L]
	RewriteRule ^/var/cache/texttoimage/.* - [L]
	RewriteRule ^/var/[^/]+/cache/public/.* - [L]
	RewriteRule ^/var/[^/]+/cache/texttoimage/.* - [L]
	Rewriterule ^/design/[^/]+/(stylesheets|images|javascript)/.* - [L]
	Rewriterule ^/share/icons/.* - [L]
	Rewriterule ^/extension/[^/]+/design/[^/]+/(stylesheets|images|javascript|flash|lib?)/.* - [L]	
	Rewriterule ^/packages/styles/.+/(stylesheets|images|javascript)/[^/]+/.* - [L]
	RewriteRule ^/packages/styles/.+/thumbnail/.* - [L]
	RewriteRule ^/favicon\.ico - [L]
	RewriteRule ^/robots\.txt - [L]
	RewriteRule .* /index.php
    </IfModule>
 
    ServerName eng.site.test
    ServerAlias fre.site.test
    ServerAlias ger.site.test
    ServerAlias admin.site.test
	
</VirtualHost>

Ole Marius Smestad

Tuesday 12 May 2009 1:51:24 am

Hello Hakim,

Before looking deeper into this, I have a small question. What is the value of the following setting, in each of your translation siteacceses?

From <b>site.ini</b>:

[SiteSettings]
SiteURL=nor.ezp.test

Does the SiteURL setting, in each siteaccess reflect the correct host?

It also seems like you are using host-matching, if the above is in order, could you also try to set your

site.ini.[SiteAccessSettings].MatchOrder to contain 'host' only.


--
Ole Marius Smestad
Lead Engineer eZ Publish
Member of the Community Project Board

zurgutt -

Tuesday 12 May 2009 6:11:34 am

I had the same problem and SiteURL in override siteaccess was the cause. Installer does not set it correctly, they all point to main site, without the lang. host prefix.

Certified eZ developer looking for projects.
zurgutt at gg.ee

Hakim Bouras

Tuesday 12 May 2009 10:15:45 am

Hi Ole (I am not sure what your first name is :-/ ),

Thank you for taking care of this problem.

I redo a complete install with the same parameters given above.

It was not working.

1/ I edit the Site Settings:
the site access where wrong : eng.eng.site.test for eng.eng.site (same for the two other language)

empty the cache - restart - still not working

2/ Edit Site.ini in Override folder :

I remove all parameters related to "ezflow_site_user" which was automatically created during the installation, but which are (unless I am wrong) note necessary :
[SiteSettings]
SiteList[]=ezflow_site_user
[SiteAccessSettings]
AvailableSiteAccessList[]=ezflow_site_user
HostMatchMapItems[]=eng.site.test;ezflow_site_user

<b>SiteURL=eng.site.test</b> (which is correct)
<b>MatchOrder=host</b>

empty the cache - restart - still not working

3/ I check the other site.ini files in settings\siteaccess
I removed the lines related to "ezflow_site_user" site access

SiteURL=eng.site.test (which is correct)

empty the cache - restart - still not working

In case it may help you to understand what is wrong in my settings, I copy the content of my override site.ini:

<?php /* #?ini charset="utf-8"?

[ExtensionSettings]
ActiveExtensions[]
ActiveExtensions[]=ezflow
ActiveExtensions[]=ezwebin
ActiveExtensions[]=ezoe
ActiveExtensions[]=ezodf

[Session]
SessionNameHandler=custom

[SiteSettings]
DefaultAccess=eng
SiteList[]
SiteList[]=eng
SiteList[]=ger
SiteList[]=fre
SiteList[]=ezflow_site_admin
SiteList[]=iphone
RootNodeDepth=1
SiteName=Test Site
MetaDataArray[author]=eZ Systems
MetaDataArray[copyright]=eZ Systems
MetaDataArray[description]=Content Management System
MetaDataArray[keywords]=cms, publish, e-commerce, content management, development framework
SiteURL=eng.site.test

[UserSettings]
LogoutRedirect=/

[SiteAccessSettings]
CheckValidity=false
AvailableSiteAccessList[]
AvailableSiteAccessList[]=eng
AvailableSiteAccessList[]=ger
AvailableSiteAccessList[]=fre
AvailableSiteAccessList[]=ezflow_site_admin
AvailableSiteAccessList[]=iphone
MatchOrder=host
HostMatchMapItems[]
HostMatchMapItems[]=admin.site.test;ezflow_site_admin
HostMatchMapItems[]=eng.site.test;eng
HostMatchMapItems[]=ger.site.test;ger
HostMatchMapItems[]=fre.site.test;fre

[RegionalSettings]
TranslationSA[]
TranslationSA[eng]=Eng
TranslationSA[ger]=Ger
TranslationSA[fre]=Fre

[FileSettings]
VarDir=var/ezflow_site

[MailSettings]
Transport=SMTP
TransportServer=smtp.site.test
TransportUser=
TransportPassword=
AdminEmail=hakim@site.test
EmailSender=

[EmbedViewModeSettings]
AvailableViewModes[]
AvailableViewModes[]=embed
AvailableViewModes[]=embed-inline
InlineViewModes[]
InlineViewModes[]=embed-inline
*/ ?>

and the content of the site.ini of my "eng" site access (I removed the database info) :

<?php /* #?ini charset="utf-8"?

[InformationCollectionSettings]
EmailReceiver=

[Session]
SessionNamePerSiteAccess=disabled

[SiteSettings]
SiteName=Test Site
SiteURL=eng.site.test
LoginPage=embedded
AdditionalLoginFormActionURL=http://admin.site.test/user/login

[UserSettings]
RegistrationEmail=

[SiteAccessSettings]
RequireUserLogin=false
RelatedSiteAccessList[]
RelatedSiteAccessList[]=eng
RelatedSiteAccessList[]=ger
RelatedSiteAccessList[]=fre
RelatedSiteAccessList[]=ezflow_site_admin
RelatedSiteAccessList[]=iphone
ShowHiddenNodes=false

[DesignSettings]
SiteDesign=ezflow
AdditionalSiteDesignList[]
AdditionalSiteDesignList[]=ezwebin
AdditionalSiteDesignList[]=base
AdditionalSiteDesignList[]=standard

[RegionalSettings]
Locale=eng-GB
ContentObjectLocale=eng-GB
ShowUntranslatedObjects=disabled
SiteLanguageList[]
SiteLanguageList[]=eng-GB
SiteLanguageList[]=fre-FR
SiteLanguageList[]=ger-DE
TextTranslation=disabled

[FileSettings]
VarDir=var/ezflow_site

[ContentSettings]
TranslationList=ger-DE;fre-FR

[MailSettings]
AdminEmail=hakim@site.test
EmailSender=
*/ ?>

and the site.ini for the "fre" site access :

<?php /* #?ini charset="utf-8"?

[InformationCollectionSettings]
EmailReceiver=

[Session]
SessionNamePerSiteAccess=disabled

[SiteSettings]
SiteName=Test Site
SiteURL=eng.site.test
LoginPage=embedded
AdditionalLoginFormActionURL=http://admin.site.test/user/login

[UserSettings]
RegistrationEmail=

[SiteAccessSettings]
RequireUserLogin=false
RelatedSiteAccessList[]
RelatedSiteAccessList[]=eng
RelatedSiteAccessList[]=ger
RelatedSiteAccessList[]=fre
RelatedSiteAccessList[]=ezflow_site_admin
RelatedSiteAccessList[]=iphone
ShowHiddenNodes=false

[DesignSettings]
SiteDesign=ezflow
AdditionalSiteDesignList[]
AdditionalSiteDesignList[]=ezwebin
AdditionalSiteDesignList[]=base
AdditionalSiteDesignList[]=standard

[RegionalSettings]
Locale=fre-FR
ContentObjectLocale=fre-FR
ShowUntranslatedObjects=disabled
SiteLanguageList[]
SiteLanguageList[]=fre-FR
SiteLanguageList[]=eng-GB
TextTranslation=enabled

[FileSettings]
VarDir=var/ezflow_site

[ContentSettings]
TranslationList=ger-DE;eng-GB

[MailSettings]
AdminEmail=hakim@site.test
EmailSender=
*/ ?>

Let me know if there are any further tests I can try to understand the source of the problem.

Hakim

André R.

Tuesday 12 May 2009 12:54:28 pm

Hakim: As zurgutt - points out, you can't define 'SiteURL=eng.site.test' in override setting when some of the siteaccesses use different hosts ( fre and ger ). So comment out that line (using '#') in settings/override/site.ini*

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Hakim Bouras

Wednesday 13 May 2009 12:32:50 am

Thanks all for your help !

The problem was that if you try to <b>install a multilingual site with a hostname access type</b>, the installer does not set correct settings:
- it duplicates the default user site with the one created for the default language (which obviously should be the same)
- the installer set a SiteURL value in the settings\override\site.ini.append.php which override the value of the same setting that should be defined by each language site access.

<b>The solution I used is :</b>

1/ I put the correct host name for each language site access :
- I edited the Site Settings (from the UI after login) - although I am not sure if editing this parameters in this place has a real effect
- I updated HostMatchMapItems[] in the settings\override\site.ini.append.php

2/ I removed from each site.ini (override and site access) all parameters related to the default site access (ie : for an eZ Flow install, I removed parameters related to ezflow_site_user)

3/ I removed the SiteURL line in the settings\override\site.ini.append.php (as proposed by Andre)

4/ for each site access, in the site.ini.append.php I matched the value of the SiteURL with the host value of the site access (as proposed by Zurgutt)

5/ finally, in each site.ini, I verified the coherence of the parameters related to the language :
- SiteLanguageList[]
- TranslationList

Cheers,
Hakim

Christophe Condomines

Wednesday 13 May 2009 1:16:12 am

If this is an eZ bug during the installation, please, report it at issues.ez.no !
Thanks.

Microblau SL
http://www.microblau.net