Book Image

Joomla! 3 Beginner's Guide Second Edition

By : Eric Tiggeler
Book Image

Joomla! 3 Beginner's Guide Second Edition

By: Eric Tiggeler

Overview of this book

Table of Contents (22 chapters)
Joomla! 3 Beginner's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating a translated version of an existing site


In the previous section, you've seen how you can create a multilingual website in Joomla from scratch. However, in some cases, you may decide that you need a multilingual site at a later stage, after you've already made a site in just one language. This is possible too; however, you'll have to install Joomla's multilingual capabilities manually. In this section, you'll find a short walkthrough of the steps. If you're interested in finding out more about the subject, you'll find a referral to a full step-by-step tutorial on the subject on the website accompanying this book . This can be found at http://joomm.net/index.php/joomla-tips-and-tutorials/creating-a-multilingual-site-in-joomla-3.

Let's assume you've built a site in English and want to have a bilingual site. In this example, we'll use Dutch as the second site language.

Adding a new language

First, you need to install the language files for the second language on the site. By navigating to Extensions | Language Manager, install a site language for the Dutch language. This contains the translated versions of all texts that come with Joomla (such as the read more text).

Moreover, you need to add the appropriate details for this language. To do this, you need to add what Joomla calls a Content Language, which is a language profile that contains the details needed for Joomla to be able to use the English or the Dutch language as switchable content languages. In the Language Manager window, click on the Content menu link to add a new content language.

Enabling Joomla! to switch between languages

The next step is to enable Joomla's Language Filter plugin, which enables CMS to recognize the different installed languages and display only the content relevant to the current language. This plugin will try to detect the language settings of the site accessed by the visitor's browser and display the site in this language (if it is present). Find the Language Filter plugin in the Plugin Manager window and enable it.

Adding multilingual content

To organize the actual content on your site, you need to create top-level categories holding (in this example) English and Dutch content. Moreover, you'll need to tell Joomla what language the content belongs to. Assign the appropriate language setting (English or Dutch) to both the categories and to the articles they contain.

Creating menus for multilingual content

Next, you need two menus: the existing main menu that points to the English articles and a new menu pointing to the Dutch articles. For all menu links, you need to tell Joomla what language the menu link belongs to (through the language setting in the menu details). Finally, select what menu link should be the default link; the home page to be displayed should be for either the English site or the Dutch site.

Connecting menu links to their translated counterparts

The next step is to draw lines between menu links in different languages. In other words, you need to tell Joomla what Dutch article should serve as the translated alternative of a particular English menu item. For each menu link, you can create an association with its English counterpart. This is done through the Associations tab of the menu item.

Finalizing the site menus

As is the case with every new menu created in Joomla, you have to add a menu module in order to be able to display the menu on the site. Again, you should assign these modules to the appropriate languages.

Apart from the new menus, Joomla will still need the default main menu (and the home link it contains) to function. However, as the main menu doesn't need to be displayed any more, you can remove the menu module associated with the main menu.

Enabling the visitor to select a language

The multilingual site is almost done. When the user visits the site using a browser that is set to use the English language, Joomla will display the site with the English content, that is, all articles and modules that have been assigned English as their content language. However, we also want the visitor to be able to switch to the translated content in another language. To add this functionality, install the language switcher module that comes with Joomla. Should visitors wish to see the Dutch version of the site contents, they can click on the Dutch flag icon in the language switcher. After the visitor has clicked on the Dutch flag, Joomla will serve the Dutch articles and the Dutch menu.

Reading the step-by-step tutorial on multilingual sites

The previous sections only give a general overview of the steps involved in creating a multilingual site when you've already got an existing site in just one language. Please refer to the website accompanying this book for a full step-by-step walkthrough. This can be found at http://joomm.net/index.php/joomla-tips-and-tutorials/creating-a-multilingual-site-in-joomla-3.