10
Forgot your password? Login Joomla Tutorials and Blog Posts Building Multi-lingual Joomla 2.5 Sites June 19, 2012 | Joomla Tutorials | Written by Steve Burge 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. Step 1: Activate the plugin 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 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 Start Online Training Members get access to all our video training. That's 975 training sessions. in Joomla, Drupal, WordPress and Coding. Latest Blog Posts and Tutorials Video Showing New Features in WordPress 3.5 December is Free Drupal Month at OSTraining Meet Rod at DrupalCamp Ohio Build Naked Websites The State of Drupal 8: Before the Feature Freeze Load Custom CSS for Each Joomla Component Magic Quotes Error With Drupal 8 Installation A Beginners Guide to Joomla Overrides Automatically Generating Node Titles in Drupal See You at the Joomla World Conference Blog Categories Joomla Tutorials Drupal Tutorials WordPress Tutorials Coding Tutorials Webdesign Tutorials Live Blogs OSTraining News Joomla News Drupal News WordPress News OSToolbar General 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. ABOUT OUR TRAINING ONLINE TRAINING LIVE TRAINING search... Building Multi-lingual Joomla 2.5 Sites - OSTraining http://www.ostraining.com/blog/joomla/joomla-multi-lingual/ 1 / 10 2012.12.01. 11:55

Building Multi-Lingual Joomla 2.5 Sites - OSTraining

Embed Size (px)

DESCRIPTION

Building Multi-Lingual Joomla 2.5 Sites - OSTraining

Citation preview

Page 1: Building Multi-Lingual Joomla 2.5 Sites - OSTraining

Forgot your password?

Login

Joomla Tutorials and Blog Posts

Building Multi-lingual Joomla 2.5 SitesJune 19, 2012 | Joomla Tutorials | Written by Steve Burge

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 someupdates since last year, and so this is our update to that tutorial. We also now have a complete training classon 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 othermulti-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 andheadings to their preferred language. You will need to download and install specific language packs for eachlanguage you want to use. You can find the language packs in the JED.

Step 1: Activate the plugin

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 clickthe 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

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

Step 3: Add the content language

Start Online Training

Members get access to allour video training. That's975 training sessions. inJoomla, Drupal, WordPressand Coding.

Latest Blog Posts and Tutorials

Video Showing New Features inWordPress 3.5December is Free Drupal Month atOSTrainingMeet Rod at DrupalCamp OhioBuild Naked WebsitesThe State of Drupal 8: Before theFeature FreezeLoad Custom CSS for Each JoomlaComponentMagic Quotes Error With Drupal 8InstallationA Beginners Guide to JoomlaOverridesAutomatically Generating NodeTitles in DrupalSee You at the Joomla WorldConference

Blog Categories

Joomla TutorialsDrupal TutorialsWordPress TutorialsCoding TutorialsWebdesign TutorialsLive BlogsOSTraining NewsJoomla NewsDrupal NewsWordPress NewsOSToolbarGeneral

The License for Our Tutorials

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

You can re-use these tutorials.You can modify these tutorials.You must link back to our originaltutorial.You can't use these tutorialscommercially.

ABOUT OUR TRAINING ONLINE TRAINING LIVE TRAINING search...

Building Multi-lingual Joomla 2.5 Sites - OSTraining http://www.ostraining.com/blog/joomla/joomla-multi-lingual/

1 / 10 2012.12.01. 11:55

Page 2: Building Multi-Lingual Joomla 2.5 Sites - OSTraining

Go to Extensions > Language Manager on the admin menu.

Click the Content tab.Click the English (UK) Title to see an example of the default set up.

Title = The name of the language as it will appear in the dropdown lists when assigning the languageto an item. This Title will also be used by the langswitcher module in front-end when flags are notused.

1.

Title Native = A title in any language desired by the admin to be displayed in the Content Languagelist.

2.

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 endof the URL. Note the Language Code must be unique among all the languages.

3.

Image Prefix = Prefix of the image file for this language when using the "Use image flags" LanguageSwitcher basic option. Example: if 'en' is chosen, then the image shall be en.gif. Images and CSS forthis module are in media/mod_languages/ Users can add any image/flag there with any prefix.Example: pt_br for the Brazilian flag.

4.

Language Tag = Enter here the language tag example: en-GB for English (UK). This should be theexact prefix used for the language installed or to be installed.

5.

Status = Whether this content language is published or not. If published, it will display as a choice inthe Language Switcher module in frontend.

6.

Metadata (Pictured below) These metadata definitions will override Global Configuration Metadata inMultilanguage configuration for each language used.

7.

Site Name (Pictured below) = The translated name of the site if you choose to use one.8.

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

At this point, you don't need the language pack installed. We'll cover that below. But, you can preparecontents in a specific Content Language without even installing the language concerned. You can completethis process and install the language packs when you need to.

Click here to read the full license.

Building Multi-lingual Joomla 2.5 Sites - OSTraining http://www.ostraining.com/blog/joomla/joomla-multi-lingual/

2 / 10 2012.12.01. 11:55

Page 3: Building Multi-Lingual Joomla 2.5 Sites - OSTraining

You can leave this blank for the base language. It will get the Site Name from the GlobalConfiguration.

Here's an example using French:

Here is a picture of what I have filled out for the French version.

The alternate site name for this language.After completing the form. Save and close.

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

Building Multi-lingual Joomla 2.5 Sites - OSTraining http://www.ostraining.com/blog/joomla/joomla-multi-lingual/

3 / 10 2012.12.01. 11:55

Page 4: Building Multi-Lingual Joomla 2.5 Sites - OSTraining

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

You may be asked to unzip first before installation. and it's possible you will see two two files to upload - onefor admin and one for site. Sometimes the complete language distribution is included.. Just be sure tocarefully check the download pages to make sure you get the right one. Be careful not to confuse thelanguage pack with the full foreign language distribution, which is a fully translated Joomla installation, not justan add on language.

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

Step 5: Create a category structure for languages

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 ALLContents ALL

Category root Lang1Contents Lang1

Category root Lang2Contents Lang2

Building Multi-lingual Joomla 2.5 Sites - OSTraining http://www.ostraining.com/blog/joomla/joomla-multi-lingual/

4 / 10 2012.12.01. 11:55

Page 5: Building Multi-Lingual Joomla 2.5 Sites - OSTraining

Once you've created at least the root categories, you can then create menus and menu items for eachlanguage.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

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 eachlanguage

Building Multi-lingual Joomla 2.5 Sites - OSTraining http://www.ostraining.com/blog/joomla/joomla-multi-lingual/

5 / 10 2012.12.01. 11:55

Page 6: Building Multi-Lingual Joomla 2.5 Sites - OSTraining

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. Createone 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 ownmenu and a home page set with the language set to "All".

Step 7: Create individual home menu items on each menu

After you've created menus (In this case one was renamed, and I created an English and Frenchmenu).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 forthe menu item should also be chosen as French.

Building Multi-lingual Joomla 2.5 Sites - OSTraining http://www.ostraining.com/blog/joomla/joomla-multi-lingual/

6 / 10 2012.12.01. 11:55

Page 7: Building Multi-Lingual Joomla 2.5 Sites - OSTraining

When you return to the menu item manager the flag for the language will show this as the designatedhome page. If you see a star here, click the star and it will change to a flag to show that this is thehome page for this language.Also make sure it is published. Look for the green check in the "Status" column (not shown in thepicture above). If it's a red circle click it to publish the menu item.

Step 8: Enable the Language Switcher Module

Go to Extensions > Module Manager.Click New.

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.

You have the options of using a drop down menu for the display or the flag icons. Choose how youwant the switcher to look on the site.Assign the Language Switcher module to each Specific Default Language Content Home page andassociated menu items pages and choose the display it to use flags or text..

Building Multi-lingual Joomla 2.5 Sites - OSTraining http://www.ostraining.com/blog/joomla/joomla-multi-lingual/

7 / 10 2012.12.01. 11:55

Page 8: Building Multi-Lingual Joomla 2.5 Sites - OSTraining

Assign the Language Switcher module to each Specific Default Language Content Home page andassociated menu items pages.

Example

At this point, the language switcher should show the various flags or dropdown for the language. Thestandard language strings should be translated into a new language. Clicking the flags will switchbetween translations.

Step 9: Creating articles

If you want to create an article in two languages, you need to create two articles. For example: one inFrench and one in English.

Building Multi-lingual Joomla 2.5 Sites - OSTraining http://www.ostraining.com/blog/joomla/joomla-multi-lingual/

8 / 10 2012.12.01. 11:55

Page 9: Building Multi-Lingual Joomla 2.5 Sites - OSTraining

This process can be greatly simplified by using Falang, Joomfish or one of the other extensions fromthe JED. You'll be able to see both translations on the same page which makes creation and changesmuch 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.

Notice what is translated and what is not. If you want the words "Language Switcher" and "MainMenu" to be translated, You will need to create duplicate modules with translated titles and assignthem to the correct pages.

8

Comments

#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 thestep-by-step Joomla multilanguage tutorial from cooltricks. I used this myself for a client and got itworking from the first attempt :)

#10 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 othertutorials before. Thank you!

#11 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!

#12 M. Gabar 2012-11-25 01:30

Many thanks. This is a wonderful tutorial. It helped me a lot!

0

5

0

StumbleUpon

0

1

Reddit

21

Building Multi-lingual Joomla 2.5 Sites - OSTraining http://www.ostraining.com/blog/joomla/joomla-multi-lingual/

9 / 10 2012.12.01. 11:55

Page 10: Building Multi-Lingual Joomla 2.5 Sites - OSTraining

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 2012 Open Source Training, LLC. All rights reserved.

1000 symbols left

Send

#13 sohrab 2012-11-27 08:30

excellent!!!

#14 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 inSerbian 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

Add comment

Name (required)

E-mail (required, but will not display)

Notify me of follow-up comments

Site Navigation

Blog & News About Us Contact Us Affiliate Program

Downloads Privacy Policy Refund Policy Terms & Conditions

Tutorials and News RSS Feeds

All Tutorials Joomla WordPress Drupal

Contact Us

Phone: (+1) 678-830-2168

Email: [email protected]

Address: PO Box 907895, Gainesville, GA 30501, U.S.A.

Keep In Touch With Us

Building Multi-lingual Joomla 2.5 Sites - OSTraining http://www.ostraining.com/blog/joomla/joomla-multi-lingual/

10 / 10 2012.12.01. 11:55