How to set same page URI on page channel entries but shown in different language?

For example i have a 'contact' page entry which will shown as:

http://mysite.com/en/contact

and

http://mysite.com/nl/contact

how to set 'contact' page URI? because i've tried and EE mark it as error, i think because it should be unique.

but i know some site using EE transcribe and they can do it

currently i don't use channel entries for this page, but using template group

but then i wonder if my site will available in many languages, i have to create many template group and i am afraid if this page will not manageable easily

thanks,

  • Just following up, did you find the answer to your question? If it wasn't the one posted here, perhaps you can share the one you found for others. And if the answer here was good, you can identify it as such for others in the future. – Tim FitzGerald Jun 9 '14 at 17:54
  • sorry, i just reply. At last, i don't use the same name, i use transcribe template translation instead. But if you want to, the only way is using Structure Add Ons. Because it will never crashed with EE page URI. – user2942 Jun 20 '14 at 13:20

At its core, Transcribe provides three main functions for translating websites:

  1. It lets you set up languages and will detect from the URL which of those languages the user wants.
  2. It allows you to have different language versions of the same channel entry (e.g. About Us and Over ons) and (using step 1) gives you the correct language version in your {exp:channel:entries} tag.
  3. It gives you variables to abstract out what would otherwise be hard-coded strings in your templates (you can create, for instance a variable called {more_label} which in English you would set to "Read More..." And in Dutch "Leer meer...").

In your case, since you are not using a channel entry, I see two easy choices:

  • If your page contains just snippets of information to translate (for instance, form field labels for a contact form), and the templates look the same in both languages, you can make use of variables in the same template file. EE Harbor has good documentation.
  • If you want to keep two template files for whatever reason (you don't want to use variables, your templates are different or the content is significantly different, that's just how you like it), you can have a contact/_contact-en.html and a contact/_contact-nl.html, and in your contact/index.html use the Transcribe tag {transcribe:language_abbreviation} to embed the right language:

    {if transcribe:language_abbreviation == "en"} {embed="contact/_contact-en"} {if:else} {embed="contact/_contact-nl"} {/if}

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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