I have a website in the Thai language and I have been requested to mirror that site in English. The site would be a 1 to 1 copy of the original. Every Page and Entry would have a corresponding Page or Entry on the English site. I have been asked if there is a way to put a Thai/English toggle link that would allow me to switch to the same page on the corresponding site.
Is something like this possible with MT tags in my template headers? I’m not sure where to begin on this one.
François Nonnenmacher on August 7, 2012, 2:04 a.m. Reply
Bill, here’s how I do it on my own site with MT: use the language negotiation capability of browsers and the web server (Apache in my case, here’s the feature in detail). The process works as follows:
.html.LANG
whereLANG
is the ISO country code (.fr
for my French site and.en
for the English one)index.html.en
andindex.html.fr
, or/folder/mypage.hml.en
and/folder/mypage.html.fr
are produced next to each other on the server document rootIf you want to see it live (and study the code for the language switch via cookie), you can check http://ubiquitic.com/ - If your browser language preference is set to anything but French, you should see any page in English. If you set ti in French, you’ll see them in French.
The advantage of this system is that all your pages can have exactly the same URL, because you do not need to expose the
.LANG
part of it. This means that I can send people to my home page with the URL above (or any other, really), without thinking about the language (they’ll get what they prefer). The only caveat I see with this solution is a potential drawback in SEO (meaning that the language in which you chose to write the basenames will be reflected in the URLs, but I don’t know how much weight search engines place in URLs). But many big sites have URLs written in English even so the pages language isn’t, so reckon it’s a small issue.Dan Wolfgang on August 7, 2012, 7:09 a.m. Reply
Hey Bill — I recently built a custom field specifically for this purpose: the Reciprocal Entry Association (and Reciprocal Page Association) fields that are part of the More Custom Fields plugin.
The field is used to link two entries together, and a popup entry picker lets the author easily find which entries they want linked together. When editing Entry A and linking to Entry B, an association from Entry B back to Entry A is automatically created. When deleting an association, the reciprocal is also removed. The best part: on the Edit Entry screen is a link to edit the reciprocal Entry, allowing authors to easily jump between Entries.
The advantage of this system is that it’s a familiar and user-friendly interface to build the cross-language link. A benefit for my client’s use (though perhaps a drawback for your use) is that entries must be explicitly linked together.
Shmuel Fomberg on August 8, 2012, 10:52 p.m. Reply
Hi.
Just a month ago I created a plugin exactly for your problem: https://github.com/semuel/mt-plugin-multilangsite
The plugin uses some MT5 features (such as the listing framework) and generally assumes MT5, so it won’t work on MT4.
It let you makes multiple language versions of a site and manage which page needs update. If you will look in the TODO section, you can see that I planed to add a tag for switching between languages, but decided to wait and see if someone will want to use this plugin.
So if you do, I will add the tag.
Shmuel.