Setting up a Multilingual site in Joomla 4
The ablity to add extra languages to Joomla has been available for a long time. Obviously when viewing content such as articles in a particular language one does not wish to see the articles from other languages mixed up in the list. And of course there needs to be a simple way for users to dynamically select the relevant language. Again most sites are public so language selection cannot require being logged in.
To meet these needs a multilingual site needs a menu for each language. Also for content each language needs a matching article category, and each language needs matching articles. Also the relevant categories and articles need to be associating accross languages. For example if we have an article Category called 'Articles en français' whose language setting is French and another one called 'Articles in English' then the two article Categories need to be associated. The same applies to the relevant articles themselves.
Doing this is not difficult but it is very tedious setting up this infrastructure and sometimes challenging getting it right if you are doing this for the first time.
Aditiononally one needs to set up the 'language plugins'. Again not difficult but easily missed.
But now adding the multilanguage menus, example multilingual categories and multilingual articles, and activating the relevant plugins is available from a button! This article takes you through the steps of the automation process.
1. Select the installation language and the name of the site;
2. setting login data;
3. setting the Database configuration.
These are illustrated in the three images below.
When done you get a 'Joomla site is ready' message together with the opportunity to install additional languages.
So click on the button to start the process.
Note if you are installing on XAMPP or similar then you may get a warning as below about the installation folder:Just remove the installation folder manually.
Add Additional Languages
Tick the the box,, alongside the required languages. Then scroll to the bottom of the list and click in the button.
Again on XAMPP you may get a message such as
In this example three additional languages were added, giving four in total. This makes the illustration of setting up a multilingual site more realistic.
Arabic wasa choosen as one of the languages because it is a 'right to left' language.
To proceed click on the button.
If you are installing on XAMPP or similar then you may get a warning as below:
Just remove the installation folder manually. And click on the button again.
You will be asked to login
Setup Multilingual site
1. Publish Languages
Publish the new languages by clicking on each.
2.Install Multilingual Sample Data
This will go through several steps and when done it will return to the Home menu. At the top of the view there will be a message
3.Content Language Plugins Enabled
Personally I always enable the 'System - Language Code' plugin as it helps to improve SEO but it is not essential.
The 'System - Language Filter' filters the displayed content so that only the current language items are included.
The 'Web Services - Langages' plugin adds language routes to the API for your website.
A main menu is created for each language as ilustrated opposite.
The relevant menu and its associated module is shown in the front end in the 'side bar right' position.
The language is of course set appropriately.
More significantly each article has been Associated with the relevant other language artices.
Similarly example multilingual aricles, one for each language, are created.
Again the language has been set and the articles are associatedassociated.
7.Language Switcher - Frontend
The front end will now look something like the image shown opposite.
ColinM 21 September 2023, modified Feb 2024