Multi-language Sites in Joomla
- We now have a complete training class on this topic for our membes: Joomla Multi-Lingual Sites.
- This tutorial is now updated for Joomla 2.5.
Joomla includes a basic way to implement a multi-language site. This doesn't replace other multi-language content management like, Joomfish, for example. You can find a complete list of these in the JED.
What you can do is activate the language switcher module, and let visitors switch the joomla core labels and headings to their preferred language. You will need to download and install specific language packs for each language you want to use. You can find the language packs in the JED.
1. Activate the Language Filter Plugin and set basic site options.
New to Joomla 1.7 go to Extensions>Plug-in Manager and find the System-Language Filter Plugin and click on the name to edit it.
2. NEW option - Automatic Language Change
Choose 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"
NEW to 1.7: You can now associate menu items in different languages. If a menu item is not associated, the behavior will be the same as in 1.6, that is, redirect to the home page in the language concerned.
3. Open the Language Manager and add to Content.
Start out by going to Extensions>Language Manager
4. Go to the Content tab to start configuring your languages.
Click on the "Content " tab.
5. View the default as an example.
You will only see "Englisth (UK). Click on the name and look at the way this one is configured. You'll be doing the additional ones in a similar manner
Title = The name of the language as it will appear in the dropdown lists when assigning the language to an item. This Title will also be used by the langswitcher module in front-end when flags are not used.
Title Native = A title in any language desired by the admin to be displayed in the Content Language list.
URL Language Code= This Language Code will be appended to the site url. When SEF is enabled, one will get http://mysite.com/en/. If SEF is disabled the suffix &lang=en will be appended at the end of the URL. Note the Language Code must be unique among all the languages.
Image Prefix = Prefix of the image file for this language when using the "Use image flags" Language Switcher basic option. Example: if 'en' is chosen, then the image shall be en.gif. Images and CSS for this module are in media/mod_languages/
Users can add any image/flag there with any prefix. Example: pt_br for the Brazilian flag.
Language Tag = Enter here the language tag example: en-GB for English (UK). This should be the exact prefix used for the language installed or to be installed.
Published = Whether this content language is published or not. If published, it will display as a choice in the Language Switcher module in frontend.
To work OK, the specific site language must be installed. But, you can prepare contents in a specific Content Language without even installing the language concerned. You can complete this process and install the language packs when you need to.
Metadata (Not pictured) These metadata definitions will override Global Configuration Metadata in Multilanguage configuration for each language used.
6. Add A new language
Simply click the "New" Icon and you'll see the form, but everything will be blank. In the one below you can see how it was set up for the German language.
Repeat this step for each language you are going to use.
7. Configure the new language.
You can get the image prefix from the images already loaded into /public_html/yourjoomladirectory/media/mod_languages/images
And the language tag is the name of the folder that has the language files after you upload them. You will find them in /language
8. Activate the System-Laguage Filter
Go back to the Extensions menu and go to the Plug-in Manager. Locate the System - Language Filter by scrolling or using the search box. Make sure it is enabled.
9. Go back to the main menu and create a new menu item for each language.
You need to create a menu item for each language, including English. Main home page link will use 'All" in the language designation. At least one button has to be designated to use "All" and you won't be able to change the main home page language selection.
You can name the pages anything you want and they do not need to be published. If everything is going well, you'll see the flags. You can also make detailed menu assignments when you set the parameters in the menu item.
10. When you create the menu item, choose the language and set it as a default.
You need to have a page for each language you use, and you need to have it be the default page for that language. So check the "Yes" in Default Page. This will not change the main default page which is on the main menu. These pages will be hidden.
Choose the language for this page in the Language drop down
You can also set the template style for this language if you need multiple designs. For example, you might want a each language section to have it's own header, colors and layout.
11. Make Menu Associations
For example: When a menu item is tagged to fr-FR, and is associated to a menu item tagged en-GB, if the language switcher module is present on the page, clicking on the en-GB flag/name redirects to the en-GB menu item. You will only see this option in the slider if you chose "Yes" to Menu Associations in step 1, when you activated and configured the plugin.
12. Go to the Module Manager and enable the Language Switcher module.
There will be a default copy there already.
You can activate this one, and/or create additional copies for inclusion on different pages or positions.
13. Set the module parameters
It's just like any other module. Pay attention to the position, though. It installs with a default position, that may not be on your template. Be sure it is published in a visible position.
NEW to 1.7
New to Joomla 1.7: is an option for a dropdown menu instead of the country flags. If you prefer a text, set this to yes.
14. Set module page assignments.
You must have the module assigned at least to the default language home pages.
15. Check the language setting on your default home page.
The actual site home page should have the language set to "All" at least one page on the site has to be set to "All"
16. Go back Extensions>Extension Manager to upload your language packs.
You can do this before, or after, creating the Language Content entries. If you add new languages at a later time be sure to go through the process for the new language.
17. Upload the language package files.
You can find language packs at http://extensions.joomla.org/extensions/languages/translations-for-joomla
You may see two zip files, one for admin and one for site. Sometimes they are combined in a single package. Just be sure to carefully check the download pages to make sure you get the right one. Be careful not to confuse the language pack with the full foreign language distribution, which is a fully translated Joomla installation, not just an add on language.
You will know you are successful if you see the language switcher module in your desired location, and the flags, or text dropdown, are visible. When you click on them you'll see the alternate translation.