Joomla Tutorials and Blog Posts

Building Multi-lingual Joomla 2.5 Sites

About a year ago we wrote a tutorial which showed how to build multi-lingual sites in Joomla.

This tutorial proved to be one of the most popular we've ever written. However, Joomla has made some updates since last year, and so this is our update to that tutorial. We also now have a complete training class on multi-lingual sites for our members.

This tutorial covers how to build a multi-lingual site with only the Joomla core. This doesn't replace other multi-lingual content extensions such as Falang or Joomfish.

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.

Full Class on this topic

Step 1: Activate the plugin

tutuploadsmedia_1339713411524.png
  • Go to Extensions > Plugin Manager.
  • Use the Filter to search for language plugins.
  • Activate the plugins by clicking the red circles. Alternately you can put a check in the boxes and click the green Enable icon on the toolbar.
  • When the plugins are enabled, the red circles will change to green with a check mark.
  • Click the name System - Language Filter in the Plugin Name column to open the options page.

Step 2: Set the basic plugin options

tutuploadsmedia_1339781503147.png
  • You can set the language selection for viewers to always show the default language, or you can have Joomla try to detect the country from the browser settings and open with the correct language.

Step 3: Add the content language

tutuploadsmedia_1339710126218.png
  • Go to Extensions > Language Manager on the admin menu.
tutuploadsmedia_1339710152296.png
  • Click the Content tab.
  • Click the English (UK) Title to see an example of the default set up.
tutuploadsmedia_1339710193449.png
  1. 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.
  2. Title Native = A title in any language desired by the admin to be displayed in the Content Language list.
  3. 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.
  4. 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.
  5. 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.
  6. Status = Whether this content language is published or not. If published, it will display as a choice in the Language Switcher module in frontend.
  7. Metadata (Pictured below) These metadata definitions will override Global Configuration Metadata in Multilanguage configuration for each language used.
  8. Site Name (Pictured below) = The translated name of the site if you choose to use one.

Notes: Flag Images and CSS for this module are in media/mod_languages/.Users can add any image/flag there with any prefix. Example: pt for the Brazilian Portuguese flag, for example, and pg for the Portuguese flag.

At this point, you don't need the language pack installed. We'll cover that below. 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.

tutuploadsmedia_1339710212250.png
  • You can leave this blank for the base language. It will get the Site Name from the Global Configuration.

Here's an example using French:

tutuploadsmedia_1339783767236.png
  • Here is a picture of what I have filled out for the French version.
tutuploadsmedia_1339781046154.png
  • The alternate site name for this language.
  • After completing the form. Save and close.
tutuploadsmedia_1339783805587.png
  • Your content tab will now show the added language in the list. Be sure the Status has a green check.

Step 4: Install the language pack

tutuploadsmedia_1339786882090.png
  • You can get language packs for the specific language you want from the Joomla Extension directory. http://extensions.joomla.org/search?q=language+packs
  • You install it using the extension Manager as you would any other Joomla Extension. You can install the pack before you start or at any phase of the process. But you won't be able to see the results in the Language Manager module until it is installed.
  • Don't get confused. A language pack is different than a foreign language distribution. A language pack only supplies translations for Joomla's main labels. So buttons names, commands and messages will be translated.
tutuploadsmedia_1339787649073.png

You may be asked to unzip first before installation. and it's possible you will see two two files to upload - one for admin and one for site. Sometimes the complete language distribution is included.. 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.

The default Joomla installation comes with the English language. So that is the base language, and the language packs can be added. It is also possible to get a complete distribution in another language, French or German for instance. That would make that the base language, and you would then need to get a language pack for English if you wanted to make English the second language on the site.

Step 5: Create a category structure for languages

tutuploadsmedia_1339792446632.png
  • Create a root category for each language.
  • Choose the language to match the category.
  • Put subcategories and contents for each language below then in a normal hierarchy.

Category root ALL
Contents ALL

Category root Lang1
Contents Lang1

Category root Lang2
Contents Lang2

tutuploadsmedia_1339793294257.png
  • Once you've created at least the root categories, you can then create menus and menu items for each language.
  • At this point you don't need the sub-categories to complete the setup of the language plugin.

Step 6: Set the language for your home page

tutuploadsmedia_1339791608708.png
  • Go to Menus > Main Menu.
  • Click the Home menu item.
  • Make sure it is the Default Page.
  • Double check that All is selected as the language.

Step 7: Create individual menus, menu items for each language

tutuploadsmedia_1339791052040.png
  • Go to Menus > Menu Manager > Add New Menu.
  • Create a new menu for each language.
  • Notice that I renamed the Main Menu to "Main Menu - All" to help me remember what it's for. Create one for English (the base language) and any additional languages.
  • For the purposes of a multi-lingual site, Joomla treats All as a language, so it has to have it's own menu and a home page set with the language set to "All".

Step 7: Create individual home menu items on each menu

tutuploadsmedia_1339793785405.png
  • After you've created menus (In this case one was renamed, and I created an English and French menu).
  • Open the menu for the base language (English in this example)
  • Create a menu item that links to the correct language root category.
  • Choose YES for to make this the default page for this language.
  • Repeat this for any other languages you add. Each one needs it's own menu and menu item.
  • Any pages you create in this language should have a menu item on this menu, and the Language for the menu item should also be chosen as French.
tutuploadsmedia_1339794071708.png
  • When you return to the menu item manager the flag for the language will show this as the designated home page. If you see a star here, click the star and it will change to a flag to show that this is the home page for this language.
  • Also make sure it is published. Look for the green check in the "Status" column (not shown in the picture above). If it's a red circle click it to publish the menu item.

Step 8: Enable the Language Switcher Module

tutuploadsmedia_1339784702391.png

Go to Extensions > Module Manager.
Click New.

tutuploadsmedia_1339713580889.png
  • Select the Language Switcher.
  • You must place this in postilion that is visible on your template.
  • After you've added it, open the options for the module.
tutuploadsmedia_1339785293480.png
  • You have the options of using a drop down menu for the display or the flag icons. Choose how you want the switcher to look on the site.
  • Assign the Language Switcher module to each Specific Default Language Content Home page and associated menu items pages and choose the display it to use flags or text..
tutuploadsmedia_1339795721574.png
  • Assign the Language Switcher module to each Specific Default Language Content Home page and associated menu items pages.

Example

tutuploadsmedia_1339795893357.png
  • At this point, the language switcher should show the various flags or dropdown for the language. The standard language strings should be translated into a new language. Clicking the flags will switch between translations.

Step 9: Creating articles

tutuploadsmedia_1339797368630.png
  • If you want to create an article in two languages, you need to create two articles. For example: one in French and one in English.
  • This process can be greatly simplified by using Falang, Joomfish or one of the other extensions from the JED. You'll be able to see both translations on the same page which makes creation and changes much easier.
  • Choose the correct category and set the language to match.
  • When you click the flags in the switcher, you'll be directed to the correct page.
tutuploadsmedia_1339797566732.png
  • Notice what is translated and what is not. If you want the words "Language Switcher" and "Main Menu" to be translated, You will need to create duplicate modules with translated titles and assign them to the correct pages.

 

Comments

 
J-F Bohemier
#1 J-F Bohemier 2012-06-19 16:53

Thanks for the update! This is still quite a complicated process... Espceially when you have to duplicate everything (modules, content, menus, ...) for each language. I haven't migrated to 2.5 much because of this... I hope Joomfish will be ready soon for J2.5. Thanks again for the great tutorial!
 
 
Brad Kelley
#2 Brad Kelley 2012-06-19 21:20

Excellent. Thanks. =)
 
 
GavinHY
#3 GavinHY 2012-06-21 08:23

After struggling for a VERY LONG time to get this right, i found this article - WOW spot on! and very easy to understand... thanks guys!
 
 
Vic Drover
#4 Vic Drover 2012-07-02 22:02

Hi J-F. Have u tried Josetta? I'm pretty sure this addresses your concerns and makes translation a lot easier. Here is an article that helps explain the benefits.

anything-digital.com/k6fkp
 
 
José
#5 José 2012-07-06 12:06

Could this work for a multilanguage site that is being built from a JoomlaBamboo Quick start installation? I am having problems with the sample data. I know you should design the multilanguage structure without sample data, but using this kind of template, it seems to me a better way to build it using them. But, even though the multilanguage structure works fine, some, and only some, of the data disappeared... Any hints of How can I solve this? Thanks!!!!!
 
 
Rui
#6 Rui 2012-09-16 08:58

Thank you.

But I have a doubt: The default flags are all *.gif files and I know where they are located. I created new flags in PNG format, but I cannot find anyfile that calls out the GIF file so that I can change it to my new PNG file.

Do you know where it's located?
 
 
JEM
#7 JEM 2012-09-27 01:47

I can not recommend "Josetta" for their products, documentation or support. We have not had very satisfying experiences with any of their products.

Look at: KM FasTrans,
(www.kmel-joomla-extensions.com )

the new kid on the block. So far looks like a working solution.
 
 
carlo
#8 carlo 2012-09-30 18:11

Great! thanks for this great article! make it very easy!
 
 
Esten
#9 Esten 2012-10-08 12:40

This is a very good tutorial when starting from scratch!

For those who want to transform their existing website to a multilingual site, you can use the step-by-step Joomla multilanguage tutorial from cooltricks. I used this myself for a client and got it working from the first attempt :)
 
 
Guest
#10 Guest 2012-10-19 06:30

I create multi-language website with joomla 2.5. When I click the language switcher why it directs to home page. I want it go to the correct page that I click.

What I need to fix the setting.
 
 
VictorB
#11 VictorB 2012-11-14 10:03

Very good tutorial!
I'm a beginner and I got the language switcher working on the first time! It was not the case with other tutorials before. Thank you!
 
 
Shariff
#12 Shariff 2012-11-21 09:48

Very good Tutorial!!

As a beginner it kept me two days finding this out, before i got link to your site!
 
 
M. Gabar
#13 M. Gabar 2012-11-25 01:30

Many thanks. This is a wonderful tutorial. It helped me a lot!
 
 
sohrab
#14 sohrab 2012-11-27 08:30

excellent!!!
 
 
Aleksandra
#15 Aleksandra 2012-11-28 12:47

First of all, thank you for this tutorial, it was really helpful. :)

I have a problem with multilingual J 2.5 site, because it opens /en/ as default, and I need it to be in Serbian for the first time visitors, and in English as optional.

I've set Serbian as default site language, even uninstalled old site and created it from the beginning, and still no joy.

Could you please help me on this?

Thanks in advance,

Aleksandra
 
 
Eugene
#16 Eugene 2012-12-03 05:33

Thank you for this work! But i have one question. What can i do, if my second leguage for example Hebrew? RTL?
 
 
Profr.org
#17 Profr.org 2012-12-12 15:02

Hi

Great tutorial. Can you advise on the best way to create geographically specific versions of the site in different languages? For example I want a version of profr.org for Argentina that defaults to Spanish. Is it better to use Falang for this?
 
 
joapen
#18 joapen 2013-01-06 22:00

This is a great tutorial, kudos!!!!!
 
 
Waliur Rahman
#19 Waliur Rahman 2013-01-08 08:55

This is really great article which help me very much. Could you help me how I could change my native language "Bengali to English"
 
 
Hugo
#20 Hugo 2013-01-08 16:12

Great guide. I am almost done. I have All, en & es. Do I need to have 3 articles, one in All, one in en and one in es? Or can I elimite the All articles? Please help!
 
 
Costas Vassalos
#21 Costas Vassalos 2013-01-18 17:32

Excellent
 
 
Mauro Leggieri
#22 Mauro Leggieri 2013-01-24 22:36

Good tutorial.

I have a question. Can I manually create a language named esar (for spanish argentina) but use es-ES for the tag, so the original spanish language will still be used (and updated) but it will let me "play" with 2 different countries?

Thanks,
Mauro.
 
 
Gerard Francos
#23 Gerard Francos 2013-01-30 15:20

This method indeed works but it generates a multitude of duplicate URLS... such a pity now i will have to try an extension instead of this method...

example: the 'read more' buttons give 1 url, article title another, and both are redirected to a third URL.

Very messy, don't use this method if SEO is any concern for you!
 
 
Brad Kelley
#24 Brad Kelley 2013-01-30 15:30

Gerard: Can you elaborate a bit? The method provides a URL for each language, which is a good thing. Are you seeing other additional URLs beyond those expected?

Thanks,
Brad
 
 
gerard francos
#25 gerard francos 2013-01-30 15:48

Well, i followed the method to the letter and everything worked great, until i saw duplicate URLS

Example:
upon clicking on article title (linkable):
/en/1-designer- furniture

the link in the read more button:
/en/article/1-designer-furniture

and the page that displayed when clicking the read more button (double slash intended):
/en//1-designer-furniture

Now FYI, 'article' is the alias i gave to the english 'home' because i didn't want to see 'home' in my url and there didnt seem to be a way to get just /en/1-designer- furniture without inclusion of the alias for the EN home item in the url...

I hope that made sense :-)

PS the same think happened in all 3 languages: 3 url versions per article...

Thanks a lot for your reaction by the way!
 
 
Hugo Cuevas-Mohr
#26 Hugo Cuevas-Mohr 2013-01-30 16:22

After a lot of frustration we eliminated the joomla multilingual site system and deleted all the large quantities of duplication, the many urls, etc. that made things too messy, too complicated for us. We are now using falang which is good, can be improved but it is better for us.
 
 
vdrover
#27 vdrover 2013-01-30 16:43

Duplicate URLs are a "feature" of Joomla, not of the multilingual system. You should user an SEO extension like sh404SEF to remove these.
 
 
gerard francos
#28 gerard francos 2013-01-30 18:31

Amen to that! Well put, I make a lot of Joomla sites and spend half my time eliminating droves of duplicate URLS.

I like joomla but i would like it more if they could remove this duplicate URL 'feature' :-)
 
 
Rosa
#29 Rosa 2013-02-07 12:19

For Eugene & Waliur Rahman

All language packs are available on this website
(even Hebrew and Bengali):

community.joomla.org/.../...
 
 
Marios
#30 Marios 2013-02-15 16:27

Hi. Great tutorial
I have a problem. I follow all the instactions carefully but at the end i have only English flag on my site and not Greek.
I also chose Languages Full Names instead pf flags and again i get only English.
Can you help?
 
 
Bdroid
#31 Bdroid 2013-02-18 09:14

Thank you a lot it's work great
 
 
Rosa
#32 Rosa 2013-02-19 04:57

@ Marios

I had the same problem; check the following sollution:

1. Language tag (language manager --> content --> language tag) should be exactly the same as the language tag in your installation pack. In your case it should be el-GR I think.
If you choose any other language tag, the language switcher doesn`t work and can`t find your flag.
 
 
Sona
#33 Sona 2013-02-25 06:55

@ Marios

I had same problem, but it is removed by creating the Home menu as 'Default page'.
Menus -> French (FR) -> Home (to Default page)
 
 
beyowi
#34 beyowi 2013-04-07 19:29

Great tuto!
 

Add comment


Security code
Refresh

blog-ad

Start Online Training

Members get access to all our video training. That's 1,142 training sessions in Joomla, Drupal, WordPress and Coding.

Latest Comments

The License for Our Tutorials

All of our tutorials are published under the Creative Commons Attribution-NonCommercial license. This means:

  • You can re-use these tutorials.
  • You can modify these tutorials.
  • You must link back to our original tutorial.
  • You can't use these tutorials commercially.

Click here to read the full license.

Open Source Training is not affiliated with or endorsed by the Joomla, WordPress or Drupal projects.
All product names and trademarks are the property of their respective owners.

Copyright 2013 Open Source Training, LLC. All rights reserved.