2

I have looked at Multi Language Module and Multi Language Support add-ons as solutions for multi language support.

However, both of them require adding a segment in the url/ Something like

http://domain.com/en/page
http://domain.com/fr/page

Now, I really don't like this because it would break pages which rely on how segments are placed. For example, if I expected segment_3 to be X data in a page without the two-char language code in the url, adding the language code would break that page.

Are there other solutions/addons that don't need to do this? Maybe something like a global variable is set instead.

Or are there ways in the listed addons to circumvent this?

2

The language code within the URL wouldn't break the URL segment for the pages. It would be same as http://yoursite.com/en/segment_1/segment_2/segment_3

You can take a look at Multi Language Website with ExpressionEngine how a multilanguage website can be managed easily.

2
  • Ok, will read up on this. I am pretty new to i18n in ExpressionEngine. – developarvin Aug 20 '13 at 8:51
  • Please share you thoughts if there need some improvements so that it can better help. – Bhashkar Yadav Aug 20 '13 at 11:25
1

There aren't many solutions that don't require an addon. Here's how I did one recently http://digitalevangelist.net/blog/multi-lingual-expressionengine-practical and here's the one I've used that doesn't need an addon http://cwcrawley.co.uk/2010/01/multi-lingual-websites-in-expressionengine/

1
  • I am not against using addons. Just want something that integrates easily and doesn't break my current site. There is also no need for me to translate channel data. I am mostly concerned with translating labels and some channels that act as lookup tables(but this are the exception). – developarvin Aug 20 '13 at 8:52
1

Now, I really don't like this because it would break pages which rely on how segments are placed. For example, if I expected segment_3 to be X data in a page without the two-char language code in the url, adding the language code would break that page.

Can't you just have a two character language code for each language, even the default one? This way your segment_x variables would always be consisent, segment_1 being the language, segment_2 being the first data segment?

Or if you have everything else working beautifully, but your only problem is that default language starts data from segment_1 and other languages from segment_2 (seeing for them segment_1 is the language variable) you could just replace the segment_x with your own variables.

Basically in your index.php just write a simple IF statement checking if the user is browsing the default language or not and based on that, set segment_x variables to your own variables, maintaining the same logic.

Default language:

  • language = default
  • part_1 = segment_1
  • part_2 = segment_2

Other languages:

  • language = segment_1
  • part_1 = segment_2
  • part_2 = segment_3

This way you can use part_1 in your templates and it becomes segment_1 for default language, segment_2 for others.

0

I developed a multi language website without add-ons. The technique I used is good both for subdomains as for different TLDs on the same server.

Take a look at my answer. I can explain again here, if you want to.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.