Sunday, December 11, 2011

HOW TO: Joomla 1.7 Multi-lingual Sites

Being new to Joomla, I was feeling quite overwhelmed when my boss asked me to configure the built-in language support for a Joomla 1.7 website. Joomfish makes short work of this sort of thing, but as of this writing, the latest version of Joomfish only works with Joomola 1.5. Joomla 1.7 is still pretty new and not many people are using it for commercial websites yet, let alone for multi-lingual websites. So I did what we all do, I headed straight for Google! Imagine my dismay when the only results from Google were posts from other people just like me - asking questions and looking for answers. Nobody, including the fine folks at Open Source Matters, had anything remotely like an idiot's guide that was designed to help a newbie through the process!

Undaunted, I managed to find a few tutorials which I tried time and time again to follow - but they might as well have been in a foreign language! I enlisted my fellow co-worker and resident tech guru, Rocky Cutri. Even he was forced to admit defeat. But I'm Scottish and I don't know the meaning of the word, can't. In the Scottish colloquial, we have a word for that never say die attitude - we call it thrawn. So Rocky and I uninstalled 1.7 AGAIN and, this time without following the tutorials, we finally got it!!

Step by Step Instructions

Here is the step-by-step process I followed, complete with screenshots and big delicious red arrows for those of you who like me, want it nice and easy!

Note: for the purposes of this tutorial, I am using Spanish as my alternative language. But the steps are the same for any language.
  1. Install the latest joomla version (which is version 1.7.2 as of this writing)
  2. Go to plug ins and find the language filter plugin and publish it.
    enable the language-filter plugin
  3. Install a language pack for your alternative language. Make sure the language pack is 1.7 compliant! Many language packs are not.
    1. Log into the Joomla Administrator's control panel
    2. From the top menu, select Extensions -> Extension Manager
    3. In the section that says Upload Package File, supply the URL to the language pack - then click Upload & Install
  4. Go to the Language Manager which you will find in the Joomla! Extensions menu dropdown. and under content, create a new Installed Language for the language you're adding. Take care to follow the conventions for naming languages. Using the Spanish language for example, enter:
    Title:
    "Spanish (Mexico)"
    Title Native:
    "EspaƱol (Mexico)"
    URL Language Code:
    "es"
    Image Prefix:
    "es"
    Language Tag:
    "es-MX"
    create your languages
  5. Create two new menus (one for each language): call one Main English and give it a menu type of mainmenu-en. Call the other one Main Spanish and give it a menu type of mainmenu-sp. Then go to the Module Manager and unpublish the module that corresponds to the Main menu.
    create menus for each language
  6. Create a Menu Module for each new language menu. Put the new modules in the same template position as your original menu.
    create modules for each new language menu
  7. Create three articles: one with the language set to ALL, one to English, and one to Spanish. We'll use these shortly when we create out menu items.
    create articles for each language
  8. For each of the 3 menus, create a Home page menu item and link it to single article. This causes a flag (like the Spanish or U.S. flag) to appear rather than the usual star icon.
    create menu items for each language
  9. When editing your menu items, you'll find that there is a new options heading on the right-hand side of the Menu Manager called Menu Item Associations. It's located just under the "Metadata Options". The Menu Item Associations shows a dropdown box for every language menu, except the one you are currently editing. For example, if you are editing a Spanish menu item, then you'll see a dropdown box for your English menu. The purpose of the dropdown is to associate the current menu items with the other languages on your site. For example, you can associate the Spanish Home menu item with the English Home menu item.
    associate Spanish menu items with English menu items
    associate English menu items with Spanish menu items
  10. Create a language-switcher module. In the Basic Options, choose "no" for "Use Dropdowns" if you want to show the language flags.
    add a language-switcher module
  11. Enjoy your new language enabled Joomla! version 1.7 website!

Please don't hesitate to contact me if you need any further explanations:

Michelle Johnston

0 comments:

About EM Squared

We develop custom softare in C#, Java, PHP, and Python, and we build websites using Joomla, Wordpress, and Drupal.

Find out more about EM Squared