Search code examples
multilingualexpressionengine

Is it possible for an entry to have two URL in Expression Engine, and translate template names?


I'm currently making a bilingual Expression Engine 2.5.2 website. I'm using this technique to create the two langues, which works perfectly.

I have created a {country_code} global variable in the two index.php files which allows me to detect the current language.

Using this technique, I have no problems to get language-relative data when accessing an entry. My only concern is that I apparently have to privilege a language-specific "clean" URL.

Example entry:

  • {entry_id} = 123
  • {title} = My test article
  • {title_permalink} = my-test-article
  • {name_fr} = Mon article
  • {name_en} = My article

If I request http://www.example.com/index.php/en/blog/articles/my-test-article, I expect to to find, in english, "My article" using the template articles in the blog template group.

Everything is fine, but the french translation is accessible when requesting http://www.example.com/index.php/fr/blog/articles/my-test-article. The correct translation of the URL should be http://www.example.com/index.php/fr/blogue/articles/mon-article-test.

Anyone encountered a problem like this? Any solutions via extensions or modules?


Solution

  • I believe the Transcribe module solves this by both providing the ability to translate template group and template names, and having you create a separate entry for each language and piece of content in your site (hence, you have two separate URL titles). But that means buying into their entire methodology for a multi-lingual site.

    Myself, I usually just stick to using the entry_id instead of the url_title, and live with the template names being in the primary language.