I know Joomla supports multiple languages since version 1.6, but what is the correct way to configure Joomla and set up my multilingual content/modules?
Joomla is an excellent system for multilingual websites, once it's correctly set up. No 3rd party extensions are required. But the configuration is not always intuitive (although recent versions of Joomla can be automatically configured during installation).
Here's a short guide on how to get all pieces together:
1. Install languages
Any language you want to use in Joomla has to be installed. Languages can be found here, and installed just like any other Joomla extension.
Joomla 3 has an option to install languages directly from the Language Manager.
2. Add content languages
While still in the Language Manager, click the Content tab, and then click New on the toolbar to set up a new content language.
- 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". 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.
- Status: Whether this content language is published or not. If published, it will display as a choice in the Language Switcher module in frontend.
- Metadata: These metadata definitions will override Global Configuration Metadata in Multilanguage configuration for each language used.
- Site Name: The translated name of the site if you choose to use one.
Repeat the process for all languages you want to add.
Screenshot from the English (UK) content language:
3. Configure Language Filter
Go to the Joomla Plugin Manager and find the
System - Language Filter plugin. This plugin has several options that can be changed depending on your needs. Remember to publish the plugin once all settings have been configured.
4. Create menu items
Joomla requires a "Default Page" to be set for each language, in addition to a default page for
It's recommended to create a new Menu for each language, (go to Menu > Add new Menu) and a hidden menu for the
All languages default page.
Create the Default Page for
All languages (or keep the existing one).
Create a Defalut Page for each additional language, and set "Default Page" to "Yes" and "Language" to the corresponding language.
(If your language don't show up in the "Language" list when creating a menu, there's probably an error in the Content Language setup.)
When done, your menu structure should look something like this:
Main Menu (or Hidden menu) - Home (set as a Home in menu item list, language: ALL) Menu for English Language - Home for English Lang (set as a Home in menu item list, language: English) Menu for Spanish - Home for Spanish (set as a Home in menu item list, language: Spanish)
Menus dropdown should display the corresponding flag together with the menu name.
5. Add Language Switcher module (optional)
The Language Switcher is part of the default Joomla modules, and can be added just as any other module from the module manager. Publish it to any template position, and change the module settings as needed. You can also change language directly in the URL (or with a link) by adding
/URLlanguagecode/ to your URL (eg. www.mysite.com/es).
6. Duplicate your content
On a multilingual Joomla site, every article and module can be assigned a specific language or "All". It's a good idea to create a Category for each language to keep your articles separated. Use the Batch tool to assign the corresponding language to each article, or duplicate your content as needed. The same method can be used with modules, but keep in mind that modules with specific menu assignments will need to be configured accordingly.
7. 404 errors
It's common to see
404-Not Found errors when building a multilingual site. This is usually because the article your trying to display has a different language than the menu item language.