This tutorial is going to show you how to implement a multi-language site in Joomla 2.5 with K2 and Gantry. In order to do this:
- Download a language pack from http://community.joomla.org/translations.html depending on your Joomla version.
- In your Joomla admin panel go to Extensions -> Extensions Manager.
- Click on Browse, navigate to the directory where you saved the language pack on your computer, double click on it and click Upload & Install.
- When it’s installed, go to Extensions -> Language Manager to see the new language listed there
- Click the Content tab, then click New.
- Create a new content language with unique parameters. The Language Tag is the same as the one used for the pack ( fr-FR, en-GB, etc.):
- Click on Save and Close. You will see a message saying "Content Language successfully saved"
- Go to Extensions -> Plugin Manager.
- Look for the one called System – Language Filter and enable it
- Click on it in order to set the proper configuration. There you can select the site language or try to detect the users browser settings and it will automatically switch to that language. Set Automatic Language Change to “Yes”. Click on "Save" when you are done.
- We needto create a menu for every installed language and one additional for both languages. Go to Menus -> Menu Manager -> Add New Menu
- For example, if you have the Main Menu with a default menu item, like in our case, this is going to be the one for all languages, and you will need to create two more Main Menus for English and the new language you have just installed.
- We should see them if we mouse over the Menus
- In our case, if we go to Menus -> Main Menu , we will see a Home item set to default. Make sure that in the Language option All is selected.
- Now we need to create two more ‘Home’ menus like this per each language, including English. Go to
- And create a new menu item for English. Check the “Yes” in Default Page. Choose the language for this page in the Language drop down
and the corresponding main menu in the Menu Location drop-down:
- Save it and create a new menu item for the new language we have just installed. That is go to
- Now, if we mouse over then Main Menu, we should see the new menus with flags
- Go to Extensions -> Module Manager and click New.
- In the new window select Language Switcher
- Configure the options of the module (the position depends on your particular template) and click Save when you are done.
- Now we will need to duplicate all modules / K2 items and Categories
- As an example, we will duplicate a Slider module. Assign each copy to its own Language and specify menu item for it.
- Once we’ve duplicated all the modules, go to Extensions -> Template Manager
- We need to duplicate themeXXXX for each language. Give it a “Style Name”, assign Default Language and activate “Menu Control” with “Select a Menu” options. Select appropriate menu for this particular language.
- After that, go to Components -> K2. Duplicate all your K2 Categories and K2 Items.
- Specify appropriate language for each duplicated Category and give it a unique name, for example you can add a FR / EN prefix: About US – FR or About US – EN.
- Duplicate K2 item and specify appropriate Category for it. For example: About US – FR or About US – EN
- Once all of the above is successfully accomplished, we can assign modules / K2 items and K2 Categories for each menu items specifically to its language.
- Lastly, we need to duplicate a language file “en-GB.tpl_themeXXXX.ini”, located in “\language\en-GB” folder. Copy it to “\language\YOUR ADDITIONAL LANGUAGE” folder, for example “language\fr-FR”. Change or rename file prefix from “en-GB.tpl_themeXXXX.ini” to “fr-FR.tpl_theme1023.ini”.
- You can open this file in any text editor and alter or translate the text to fit your needs.
Feel free to check the detailed video tutorial below: