eZ Community » Forums » Setup & design » Site Language List vs Translation SA
expandshrink

Site Language List vs Translation SA

Site Language List vs Translation SA

Monday 09 April 2012 10:19:26 pm - 9 replies

I want to have multiple similar languages based on locale:
English US, English UK, Spanish Spain, Spanish Mexico for example.

Looking at settings.ini and how the language switcher works, seems I need to create a specific siteaccess for each language (sitelanguagelist). This seems weird in that everything on the admin side allows what I want, but it just seems a bit cryptic on how to get on the front end so that the visitor can have the option to change the language.

I see that language switcher also changes to eng vs the http locale code. Perhaps most of this is done in htaccess?

So the questions:

How can I show a list of the available sitelanguagelist similar to language switcher?

How do I get the switcher to switch to translated url alias and http locale code (../en-gb/urlalias ../en-us/urlalias)?

Thanks - probably (hopefully) just something I am overlooking.

Modified on Monday 09 April 2012 10:46:54 pm by David H

Tuesday 10 April 2012 7:41:57 am

Hello,

In fact swicht language don't switch between one lnaguage to another : it switch between one siteaccess to another.

sinc one siteacess has a language :

{set $url = concat('/switchlanguage/to/en/',$node.url_alias)|ezurl()}

tell the system to switch to the siteaccess en for the url $node.url_alias

Do has if it is magic ...

Alexandre

Tuesday 10 April 2012 8:36:07 am

Hi Sebbane,

Yes. That all works fine and I understand switching between the site access which then has the settings for language hierarchy. But, the question is related more to if I need to create a unique site access for every translation I have available such as eng-US and eng-GB. Current language is just eng but if I create a translation for eng-US and eng-GB, how is the visitor able to switch to those specifically? I know I can create a siteaccess for eng-US but is that really the right way to go about doing this?

Tuesday 10 April 2012 9:49:29 am

Hello

i am afraid it is the only way todo it : i mean in one siteaccess there is one lnaguage y default and then if it dont exist noather and another ...etc.

But if you want to have a website in one language : no doubt , you will have to add a siteaccess.

Then, with the cache system, if you want one siteaccess, a node will be cache with a locale  and to have content in another locale you have to erase the cache : so this solution is not good for performance

 

See you

 

Alex

Wednesday 11 April 2012 3:44:14 am

Hi David,

I'm implementing a multi-lingual, multi-locale site and have hacked/improved the http://projects.ez.no/region extension to use and override the built-in language switcher.

Here's my setup in my site.ini override:

 [RegionalSettings]
TranslationSA[]
TranslationSA[siteaccess_uk]=United Kingdom
TranslationSA[siteaccess_uk]=United States
TranslationSA[siteaccess_fr]=France
 
# Example mapping between languages and siteaccess, mapping is done by convention if not defined
# like eg: eng-GB => eng
# In both cases sa name needs to be present in [SiteAccessSettings]\RelatedSiteAccessList[]
# Example: LanguageSA[<language>]=<name of siteaccess>
LanguageSA[]
LanguageSA[eng-US]=siteaccess_us
LanguageSA[eng-GB]=siteaccess_uk
LanguageSA[fre-FR]=siteaccess_fr

The TranslationSA values are what appear in the language switcher.  I'm using HostUriMatch mapping to set the URI to uk/us/fr, but you could use plain URI mapping too.

You also need to ensure your siteaccess has the right SiteURL set (eg. mysite.com/uk ).

Let me know if this helps - happy to share the code with you too.

Cheers,

Geoff

Wednesday 11 April 2012 8:46:15 am

Hi Geoff,

What you have going on is exactly what I am in need of. I'll take you up on your generous offer - sent you a direct message.

/ David

-------------------

So I have my head around this now. Thanks for the assistance.

Geoff - still reviewing what you sent.

Modified on Thursday 12 April 2012 3:38:05 pm by David H

Friday 13 July 2012 12:01:00 am

Since a while we're struggling with multi-site multi-locale setups. He have now created an ezpublish extension that allows to create sub-siteaccesses to solve this task:

settings/siteaccess/website1
settings/siteaccess/website1/de
settings/siteaccess/website1/en
settings/siteaccess/website1/it
settings/siteaccess/website2
settings/siteaccess/website2/de
settings/siteaccess/website2/en
settings/siteaccess/website2/it

Have a look at https://github.com/holzweg/hwgroupsa

 

Cheers,

Tobi

Modified on Friday 13 July 2012 12:02:13 am by Team Holzweg

Friday 13 July 2012 1:59:43 am

Quote from Team Holzweg :

Since a while we're struggling with multi-site multi-locale setups. He have now created an ezpublish extension that allows to create sub-siteaccesses to solve this task:

settings/siteaccess/website1
settings/siteaccess/website1/de
settings/siteaccess/website1/en
settings/siteaccess/website1/it
settings/siteaccess/website2
settings/siteaccess/website2/de
settings/siteaccess/website2/en
settings/siteaccess/website2/it

Have a look at https://github.com/holzweg/hwgroupsa

 

Cheers,

Tobi

What a fantastic extension Tobi!!  This would certainly solve my current need to replicate certain settings (via ln -s/cp) for every siteaccess.  Have you added this to projects.ez.no ?

Does this work with site extensions?

Friday 20 July 2012 6:08:06 pm

it's not yet on projects.ez.no, but i'll add it soon.

What do you mean with "site extensions"?

Regarding different design packages (like ezdemo, ezwebin), it works independently. In current setups we're using both ezwebin as default package, as well as the new ezdemo. It basically overrides two core files (1 kernel, 1 lib), which makes it work together with any extension that's not also overriding these files.

Any extension that customly parses ini files could potentially harm functionality, but whenever you're using the eZINI- context (either via PHP or as a template operator), you should be fine.

It does need to be set up differently regarding the HostMap settings in you site.ini.append.php, so read the documentation carefully.

There's still one major bug yet:
Opening the base hostname (like www.yoursite.com) without the subsiteaccess string (like "en" in www.yoursite.com/en) will result in using a fallback siteaccess, and not the expected main siteaccess).
Currently, you can use rewrite directives to for example redirect connections to www.yoursite.com to www.yoursite.com/en in your .htaccess or virtualhost configuration.

As it's still quite "young", please file an issue on github whenever you experience problems, as we're eager to have it stable.

Kind regards,

Tobi

Thursday 03 October 2013 12:09:37 pm

Hello all, 

First of all, thank you for this extension. It seems that it's what i'm looking for.

I have now an EZPublish site with the next structure:

 

siteaccess/admin (admin area) 
siteaccess/de (main web in German) 
siteaccess/en (main web in English language)
=>siteacces/magazine (the new web) 

This new web is another web with another content but with the same database that the main web.
This new web "magazine" must be now multilanguage and I don't want to create a new siteaccess "magazine-en". 
For this reason I think that this extensions is appropiate to my pourposes.
Sadly I can't make that the extension works fine. I have read the instructions again and again but I can't get it.

My new configuration is:
 

siteaccess/admin (admin area) 
siteaccess/de (main language) 
siteaccess/en (secondary language) 
=>siteacces/magazine/de (the new web in German) 
=>siteacces/magazine/en (the new web in English)  

My override/site.ini.append.php is now:

[SiteAccessSettings]

AvailableSiteAccessList[]
AvailableSiteAccessList[]=de
AvailableSiteAccessList[]=en
AvailableSiteAccessList[]=magazin
AvailableSiteAccessList[]=cms
HostMatchMapItems[]
MatchOrder=host_uri_group
HostUriGroupMatchMapItems[]

HostUriGroupMatchMapItems[]=XXX;;admin
HostUriGroupMatchMapItems[]=XXX;;de
HostUriGroupMatchMapItems[]=XXX;;en
HostUriGroupMatchMapItems[]=XXX;de|en;magazin
ForceVirtualHost=true
I don't want to change the main website, thereby I have no chaged the siteccesses.
However the site doesn't work. An now I can't access to the main site too.

Really I'm very interested to work with this extension. Can someone help me?

Thank you in advance.

Raul Garcia 

Modified on Thursday 03 October 2013 12:12:50 pm by RAUL GARCIA

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from