Joomla! 1.5 Top Extensions for Using Languages

Packt Publishing

Basic Joomla! is great, but there's so much more to it once you know how to use extensions. From video players to shopping carts, these 80 hands-on recipes give you the lowdown on the latest and greatest customizations.

Introduction

One of the greatest features of Joomla! is that you can build a multilingual website. The Joomla! interface can be displayed in many languages. You can simply download the translation pack for the required language and install that to Joomla!. If you don't have a translation pack for your desired language, you can translate it by editing language files directly or by using the translation manager component. The translation manager component allows you to visually translate your site's interface into any language, right from the Joomla! administration area. After completing the translation, you can pack the translation and share it with others, so that they can install the translation in other Joomla! sites.

Besides translating the Joomla! interface, you can translate a site's contents into your desired language. The GTranslate component allows you to translate your site's content into 55 languages using Google's translation service.

Adding a language to your site

Joomla! can build a multilingual site. A site interface can be in multiple languages, using different locales. In this recipe, you will learn how to add an additional language to a Joomla! site.

How to do it...

From the Joomla! administration panel, click on Extensions | Language Manager. This will show the Language Manager screen, listing the installed languages for the site:

Note that the default language for the site is marked with a yellow star in the Default column. To make the newly-installed language, French (Fr), the default language for your site, select the language and click on the Default button in the toolbar.

Preview the site's frontend and you will find the site's interface (not content) in French. For example, the Login Form module will look like the following screenshot:

For changing the language of the administration panel, in the Language Manager screen click on Administrator, select a language from the list, and set that as the default language for the administrator backend.

See also...

Adding a translation will only show the Joomla! interfaces in that language. The content of the site is not translated or displayed in the selected language. Also note that we still don't have a mechanism to select our desired language. All of these things can be done using the Joom!Fish extension, which is discussed in the recipe Manually Translating Your Joomla! Site's Content into Your Desired Language.

Translating language files for your site

Joomla!'s translations are available in most major languages. However, you may like to change the translations and have your own translation in your desired language. In that case, Joomla! provides a mechanism to translate the Joomla! interface language. In this recipe, you will learn how to translate language files for your site from the administration backend.

Getting ready...

Translation Manager is a popular extension that can help you translate the site's language files right from the administration backend, without opening a text editor. Download this extension from http://joomlacode.org/gf/project/joomla_1_5_tr1/frs/ and install it from the Extensions | Install/Uninstall screen.

How to do it...

After installation, follow the steps as shown:

From the Joomla! administration panel, click on Components | Translation Manager. This will show the Translation Manager screen, listing all of the installed languages for the site and the administration backend.

<

For changing any language translation, select that language, for example Site [en-GB] English(United Kingdom), and click on the View Files button. This will show the language files for that language.

Now select a file, such as, com_banners, and click on the Edit button. This shows the string editing screen for the com_banners.ini file.

Change the strings accordingly, and click on the Save button in the toolbar.

For adding a new language, click on New in the Translation Manager screen. This will show the Create New Language screen:

In the Language Details section, configure the following:

Client: Select who will be the client for this translation—Administrator, Installation, or Site. If you want to translate for the administrator interface, select Administrator. We want to translate the site's frontend, therefore we select Site.

Language ISO tag: Type the ISO tag for the language. For example, if we want to translate it into Bengali, type ISO code bn-BD.

Name: Type language name, that is Bangla.

Description: Type a short description for the translation.

Legacy Name: Type the traditional name of the language, for example, bn for bn-BD.

Language Locales: Type the locale code for the language.

Windows Code page: Specify the code page for the language. The default is iso-8859-1. For the Bangla language it will be utf-8.

PDF Font: Specify the font family to be used for displaying the PDF in that language.

Right-to-Left: Specify Yes if the language is to be read from right to left (for example, Arabic).

In the Author Details section, provide the translator's name (probably your name), e-mail address, website URL, version number for the translation, creation date, the copyright holder's name, and URL to the license document. When done, click on the Save button in the toolbar. This saves the language definition and you will see the language name on the Translation Manager screen:

Now select the newly-created language that is, Site [bn-BD] Bangla, and click on the View Files button in the toolbar. This shows the Language Files: Site - Bangla screen, listing the language files to be translated.

From the list, select a file to translate, such as com_banners, and click on the Edit button in the toolbar. This shows the Edit Translation INI file screen.

In the Edit Translation INI File screen, you will see the English strings and textboxes, as well as the strings to type your translation. Type the translations for each phrase and click on the Save button in the toolbar when finished. This will show the Language Files: Site – Bangla screen.

Note that a green tick is displayed in the Status column when all the phrases in that file are translated. For using that translation file, click on the icon in the State column so that a green tick appears there. Follow these steps to translate all of the other language files.

When finished translating all of the language files, you can package that language for using it in other site. For packaging, select that language and click on the Package button in the toolbar. Soon, you will see a message informing you that the language package has been created.

Download the package by clicking on the link provided. Note that the package includes only completely translated files. You can install this package on other sites.

For viewing the result of your translation, select that language and click on the Default button in the toolbar. This sets the language as the default language for that site. Now preview the site's frontend and you should find some translations, as shown in the following screenshot:

You can create as many languages as you want using Translation Manager.

Translating your site's content using Google's translation service

Google provides translation services for many languages. In this recipe, you will learn how to translate your site's content using Google translation services.

Getting ready...

GTranslate is a popular module for Joomla! that can translate your site's content into many languages. Download this module from http://edo.webmaster.am/gtranslate, and install it from the Extensions | Install/Uninstall screen. Note that you need to register to download the free version of GTranslate. It has a paid Pro version too, which supports some extra features such as search engine indexing, META information translation, and caching.

How to do it...

After installation, carry out the following steps:

From the Joomla! administration panel, click on Extensions | Module Manager. This shows the Module Manager screen and lists the installed modules. From the list click on GTranslate. This shows the Module: [Edit] screen for the GTranslate module.

Type the title of the module, for example, Translate. Select Yes in the Show Title and Enabled fields. In the Position drop-down list, select a module position where the module will be displayed. From the Module Parameters section, select On Fly (jQuery) in the Translation method field. Accept the default settings for all other fields and click on the Save button in the toolbar.

Preview the site's frontend and you should see the module with flag icons and a drop-down list.

Click on a language icon or select a language name from the drop-down list. This shows the site or article translated into your selected language, as shown in the following screenshot:

As you can see, the text has been translated into Russian. You can select another language to translate it into.

If you select Redirect in the Translation method field while configuring the module, it will not translate non-public pages, such as, your site hosted on localhost. On Fly (jQuery) is the best option as it translates and shows the translated page, both on local and public websites.

Alerts & Offers

Series & Level

We understand your time is important. Uniquely amongst the major publishers, we seek to develop and publish the broadest range of learning and information products on each technology. Every Packt product delivers a specific learning pathway, broadly defined by the Series type. This structured approach enables you to select the pathway which best suits your knowledge level, learning style and task objectives.

Learning

As a new user, these step-by-step tutorial guides will give you all the practical skills necessary to become competent and efficient.

Beginner's Guide

Friendly, informal tutorials that provide a practical introduction using examples, activities, and challenges.

Essentials

Fast paced, concentrated introductions showing the quickest way to put the tool to work in the real world.

Cookbook

A collection of practical self-contained recipes that all users of the technology will find useful for building more powerful and reliable systems.

Blueprints

Guides you through the most common types of project you'll encounter, giving you end-to-end guidance on how to build your specific solution quickly and reliably.

Mastering

Take your skills to the next level with advanced tutorials that will give you confidence to master the tool's most powerful features.

Starting

Accessible to readers adopting the topic, these titles get you into the tool or technology so that you can become an effective user.

Progressing

Building on core skills you already have, these titles share solutions and expertise so you become a highly productive power user.