Categories

Bilingual website

Hi!
Just found ElefantCMS a couple of days ago and I like it.
I have a question though... How can I create a bilingual website. I searched the docs and tutorials but couldn't find any instructions about it.

2. Add each language under Tools > Languages so the site knows they're available

3. Create additional pages for that language and place them under the appropriate index page in Tools > Navigation

4. Set up any dynamic navigation elements as sections based on the site tree in step 3, instead of a top-level site menu. For example, a dynamic menu in your layout template might use this tag: {! navigation/section?section=index-fr !}

5. Create a custom bootstrap.php file in the root of the site that contains roughly the following:

This will cause requests to the homepage to automatically redirect to their preferred language's homepage based on the visitor's browser language preferences.

One likely minor limitation is that if you're viewing a French page but your language settings chose Spanish, then the page itself will of course be French, but the surrounding text that's translated through the Tools > Language area would appear in Spanish since the language isn't being switched by the page.

This is likely minor because visitors would tend to stick to the language that they've set as preferred anyway, so they would start at the Spanish index and browse Spanish pages (with surrounding text in Spanish) and never see the French pages. Similarly, a French visitor would be directed to the French homepage with links to the other French pages (with surrounding text in French based on their browser preference).

Hello Guys, I'm new to this cms/framework. First I want to congratulate to this great work and I want to say thanks you for providing it as opensourse too.
I'm seriously thinking about using it for the next project.

However I need to ask this: Should I use the version 2 Beta 6 for Production?

I'm trying to setup a multilingual site, but I'm having some errors:
I've followed the steps in this tutorial http://www.elefantcms.com/wiki/Multilingual-website-setup
I'm in step 4 and I can't move on. When I turn the multilingual function to On (multilingual = On), the main Menu disappears. What am I doing wrong?
Thank you in advance

I've been using the betas in production for a while myself. It's been a fairly natural evolution from Elefant 1.x so the framework itself should be pretty stable. The next update will probably be a release candidate once I'm back from a bit of travel this next week :)

If you set the pages up to match your language codes in step 3, the navigation/top handler should read the sub-pages of the current language from the site tree. What does your site tree look like? Should be something like this:

en
about
etc
es
etc

So when 'en' is the language of the current request, you should see 'about, etc' as the menu. It also expects the top-level page IDs to match the language codes in order to match them up.

Hello Johnny, thank you for your help. It's working now!
I forgot to create the subpages, that's why the menu was disappearing. And then i did the adjust negotiation_method and everything worked like a charm. Thank you

I am trying to do what hailton_silva managed to do!
A bilingual site (el -greek- and en). My problem is, after adding the greek language and creating the two top pages with IDs el and en and four more pages, 2 for each language , I fail to build the navigation tree. I do not know where to put the Multilanguage Dynamic Object. In the 2 top pages? in all the pages ? somewhere else?
Any help welcome

You should only need to add the multilingual homepage redirect to the main 'index' page. All it does is redirect requests for the current page to the default language of the site. The purpose is just to automatically redirect / to /el for new visitors.

Also note that you only need to use that when you've set negotiation_method=url in your config. I tend to leave it to default to http which uses the browser/system language preferences of the visitor to choose the best language for them automatically.

From there, you should be able to use the regular navigation handlers such as {! navigation/top !} the same as you would on a non-multilingual site.

; Turn this on if your site is multilingual. This will change
; the behaviour of the site navigation so that the appropriate
; language's section of the site tree is shown, depending on
; the user's language choice.

multilingual = On

; This is the method for determining which language to show the
; current visitor. Options are: url (e.g., /fr/), subdomain
; (e.g., fr.example.com), http (uses Accept-Language header),
; or cookie.

negotiation_method = url

Everything works like a charm, but now i have duplicate content pages >

The regular page links will continue to work for the default language (so /home will resolve to the page with ID "home"), but there are few things that you can do to minimize this:

1) Edit the "index" page, click on the Dynamic Objects icon and choose "Multilingual Homepage Redirect" which will automatically redirect new visitors to /cz. Once the visitor is on the /cz page, the dynamic navigation should automatically include the language, so /home will become /cz/home.

2) A number of apps don't include the language code prefix, but you can use this gist to force all internal links to have one: