Alternate-Language Template Groups in eeSiteKit
Most multilingual solutions for ExpressionEngine use either a sub-domain or a "special segment" in the URI to trigger the correct language for content display. eeSiteKit uses a Template Group with a custom embed tag for the job. This makes it appears as if there is no language trigger in the URL/URI, as we think that's the way it should be.
Creating an Alternate-Language Template Group
You will be creating one template group for each language of each multilingual Channel of your site. If your site has three languages, then you'll have three template groups for each Channel.
In this example, we're creating the a new Template Group for the Dutch equivalent of the English Channel called "About Us". While we don't speak Duch, we have a source that tells us the Dutch translation of "About Us" is "Over ons".
Site Name › Templates › Template Management
- From the Template Management area of ExpressionEngine's control panel, click on the big green "Create a New Template Group" button (top right-hand corner).
- Template Group Name: over-ons (This must be identical to the "language_channel_url" you set up in the Alternate-Language Template for this language.)
- Duplicate an Existing Template Group?: Do not duplicate a group
- Make the index template in this group your site's home page?: No, do not check the box
- Click Submit
- Select your new Template Group from the list in the first column of the page so that the "index" page of the new group shows up in the right-hand column
- Click on the index template so that you can edit it.
- Place a custom embed tag like this one into the index template
{embed='kit_language/dutch' template='kit_system/index' weblog='about-us'}
{embed='kit_language/dutch' template='kit_system/index' weblog='about-us'}
In our example tag, we've set the language file that will be used as "dutch" and the host-language's Channel name as "about-us". Note that you do not translate the name of the Channel from the host-language. - Click Submit
By using a custom embed tag in this way, we are telling ExpressionEngine to use content from the Channel called "About Us" and display it as Dutch.
If you ever rename a Channel, you must rename the associated Template Groups also, and update the custom embed tag in the index templates of the group with the new Channel name. Forget to update these, and you'll start seeing your 404 page when you don't want to.
