Bars & Bistros

0 down vote favorite

I’m helping with a custom multi language site. We have one page in English, then an equivalent page in French. I’ve got a “SWITCH LANGUAGE” link in the main container (next to the breadcrumbs) that takes you to the English home page if on any French page, and vice versa.

Aside from using a plugin, how can I make this link more dynamic by having it point to the equivalent page, whether French or Engligh? E.g. when a user is on the “Events” page, the l ink points to the “Evènements” page, but when on the “Fundraising” page, it points to “Levée de fonds” page.

Here’s the code I’m using now to switch languages, using custom fields to give all Engligh pages a Name of “MenuName” and a Value of “English”. This then serves either the breadcrumbs.php or my new breadcrumbs-en.php, which has the appropriate link to it. I don’t think this is the best way to do this however, since it is dependent on the breadcrumbs.