Joomla! 1.5 Top Extensions for Using Languages

Exclusive offer: get 50% off this eBook here
Joomla! 1.5 Top Extensions Cookbook

Joomla! 1.5 Top Extensions Cookbook — Save 50%

Over 80 great recipes for taking control of Joomla! Extensions

£18.99    £9.50
by Suhreed Sarkar | October 2010 | Cookbooks Joomla! Content Management Open Source Web Development

This article focuses on using multiple languages on a Joomla!-based site. It shows you how to add a language, translate language files, translate a site's content on the fly using Google's translation service.

In this article by Suhreed Sarkar, author of Joomla! 1.5 Top Extensions Cookbook, we will cover:

  • Adding a language to your site
  • Translating language files for your site
  • Translating your site's content using Google's translation service

 

Joomla! 1.5 Top Extensions Cookbook

Joomla! 1.5 Top Extensions Cookbook

Over 80 great recipes for taking control of Joomla! Extensions

  • Set up and use the best extensions available for Joomla!
  • Covers extensions for just about every use of Joomla!
  • Packed with recipes to help you get the most of the Joomla! extensions
  • Part of Packt's Cookbook series: Each recipe is a carefully organized sequence of instructions to complete the task as efficiently as possible
        Read more about this book      

(For more resources on Joomla!, see here.)

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.

Getting ready...

Joomla! translations are available in major languages. First, decide which language you want to add to your site. For example, we want to add French to a Joomla! website. A French translation for Joomla! 1.5 is available to download at the Joomla! Extensions Directory, http://extensions.joomla.org/extensions/languages/translations-for-joomla. Download this extension from http://joomlacode.org/gf/project/french/frs/, and install it from the Extensions | Install/Uninstall screen.

How to do it...

After installation, follow the steps as shown:

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

  2. 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.
  3. 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:

  4. 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:

  1. 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.

  2. <

  3. 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.

  4. 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.

  5. Change the strings accordingly, and click on the Save button in the toolbar.
  6. For adding a new language, click on New in the Translation Manager screen. This will show the Create New Language screen:

  7. 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).
  8. 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:

Joomla! 1.5 Top Extensions Cookbook Over 80 great recipes for taking control of Joomla! Extensions
Published: October 2010
eBook Price: £18.99
Book Price: £30.99
See more
Select your format and quantity:
        Read more about this book      

(For more resources on Joomla!, see here.)

  1. 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.

  2. 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.

  3. 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.

  4. 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.
  5. 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.

  6. 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.
  7. 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:

  1. 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.

  2. 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.
  3. Preview the site's frontend and you should see the module with flag icons and a drop-down list.

  4. 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:

  5. 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.

Summary

This article covered:

  • Adding a language to your site
  • Translating language files for your site
  • Translating your site's content using Google's translation service

In the next article we will see how to manually translate your Joomla! site's content into your desired language.


Further resources on this subject:


Joomla! 1.5 Top Extensions Cookbook Over 80 great recipes for taking control of Joomla! Extensions
Published: October 2010
eBook Price: £18.99
Book Price: £30.99
See more
Select your format and quantity:

About the Author :


Suhreed Sarkar

Suhreed Sarkar is an IT consultant, trainer and technical writer. He studied Marine engineering, served on board the ship for two years, and then started journey in to IT world with MCSE in Windows NT 4.0 track. Later he studied business administration and earned MBA from University of Dhaka. He has a bunch of BrainBench certifications on various topics including PHP4, Project Management, RDBMS Concepts, E-commerce, Web Server Administration, Internet Security, Training Development, Training Delivery and Evaluation, and Technical Writing.

He taught courses on system administration, web development, e-commerce and MIS. He has consulted several national and international organizations including United Nations, and helped clients building and adopting their web portals, large scale databases and management information systems. At present he is working on building a framework for education sector MIS, and promoting use of ICTs in education.

Suhreed is renowned technical author in Bengali – having a dozen of books published on subjects covering web development, LAMP, networking, and system administration. He authored Zen Cart: E-commerce Application Development, Joomla! E-commerce with Virtuemart, and Joomla! with Flash, published by Packt Publishing.

While not busy with hacking some apps, blogging on his blog (http://www.suhreedsarkar.com), reading philosophy of Bertrand Russell or management thought of Peter F Drucker – he likes to spend some special moments with his family. Suhreed lives in Dhaka, Bangladesh

Contact Suhreed Sarkar

Books From Packt


Joomla! Social Networking with JomSocial
Joomla! Social Networking with JomSocial

Joomla! E-Commerce with VirtueMart
Joomla! E-Commerce with VirtueMart

ChronoForms 3.1 for Joomla! site Cookbook
ChronoForms 3.1 for Joomla! site Cookbook

Joomla! 1.5 Site Blueprints
Joomla! 1.5 Site Blueprints

Joomla! 1.5 SEO
Joomla! 1.5 SEO

Joomla! 1.5 JavaScript jQuery
Joomla! 1.5 JavaScript jQuery

Joomla! 1.5 Templates Cookbook
Joomla! 1.5 Templates Cookbook

Mastering Joomla! 1.5 Extension and Framework Development Second Edition
Mastering Joomla! 1.5 Extension and Framework Development Second Edition


Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software