Category: Components

Manually Translating Your Joomla! Site’s Content into Your Desired Language

In the previous article we saw how to translate a site’s content using Google’s translation service. The full process is automated and the machine does the translation. However, machine translation is not always good and can sometimes be misleading. To avoid your content getting lost in translation, or in the absence of a translation service for a specific language, like Bengali, you may like to manually translate the site’s content.

In this article by Suhreed Sarkar, author of Joomla! 1.5 Top Extensions Cookbook, you will learn how to translate your site’s content manually into your desired language using the Joom!Fish extension. It allows you to translate the articles, modules, banners, menus, sections, categories, and so on into your desired language. It also shows a language selection module for visitors to choose a language from the site’s frontend. Many other components and modules can be translated by installing their respective content elements.


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

    The reader would benefit from the previous article on

Joomla! 1.5 Top Extensions for Using Languages

    .

Getting ready…

Joom!Fish is the most popular extension for building multilingual Joomla! websites. Download the latest version of Joom!Fish from http://joomlacode.org/gf/download/frsrelease/11315/45280/JoomFish2.0.4.zip, and install it from the Extensions | Install/Uninstall screen. It installs one component, two modules, and several plugins.

How to do it…

After installation, carry out the following steps:

    1. From the Joomla! administration panel, click on Components | Joom!Fish | Control Panel. This shows the Joom!Fish :: The multilingual Content Manager for Joomla!screen.
    2. Click on Language Configuration. This shows the Joom!Fish Language Manager screen, and lists all the installed languages.

    3. In the Active column, enable the checkboxes to activate the required languages. If you don’t see an image for a language, type the image’s URL in the Image filename field. Then click the icon displayed in the Config column. This shows the Joom!Fish Language Manager – Translate Configurationscreen.

    4. In this screen, you can translate some common phrases, for example Offline Message, Site Name, Global Site Meta Description, Global Site Meta Keywords, a help site URL, mail settings, and so on. Type in the translations and click on the Save button in the toolbar.
    5. Now click on Translation, select Bengali in the Languages drop-down list, and select Categories in the Content elementsdrop-down list. This shows the translatable categories.

    6. Click on a category name and you should see the Translatescreen, with the original text and a textbox to insert your translation.

    7. Type your translation in the Translate fields, enable the Published checkbox and then click on the Save button in the toolbar. Follow the same process for translating other categories. When finished translating all categories, select Contents in the Content elements drop-down list on the Translatescreen. This shows the list of available articles for translation.

    8. Click an article title to translate. This shows the Translatescreen with the original text and textboxes for translation.

    9. Type the translations in the Translation fields, enable the Published checkbox, and click on the Save button in the toolbar.
    10. Similarly, change types in the Content elements drop-down box and translate other content including Modules, Menus, Contacts, Banners, and so on. When finished translating, click on Extensions | Module Manager. This shows the Module Manager screen, listing the installed modules. From the list, click on the Language Selection module. This shows the Module: [Edit]screen:

    11. Select Yes in the Published field and select a module position from the Position drop-down list. From the Module Parameters section, in the Appearance of language selector drop-down list select how you want to display the language selection box. You can choose from Drop down of names, Drop down of names with current language flag, ul-list of names, ul-list of names with flag, ul-list of images, and Raw display of images.
    12. Preview the site’s frontend and you should see the site in the default language, with the language selection box at the specified position.

    13. From the language selection module, click another case, in my case Bangla, to show the site content in that language.

    14. Visitors to your site can now switch to any active language through this language selection module. Note that the URL of the site now appends language code, for example, http://www.yourjoomlasite.com/index.php?lang=bn, where bn stands for the Bangla language.

There’s more…

Note that in Joom!Fish, you can translate almost anything—articles, modules, menus, sections, categories, and so on. These translations are done through content elements. You can see any component or module by clicking on Components | Joom!Fish | Content Elements.

You can download content elements for new extensions from http://extensions.joomla.org/extensions/extension-specific/joomfish-extensions and http://joomlacode.org/gf/project/joomfish/frs/. After downloading content elements, click on the Install button on Content Elements screen. This shows the Joom!Fish::Content Element Installer screen.

Click on the Browse button, select the content element file, and then click on the Upload File & Install button. This installs the content and you can translate the content for that particular component or module.

Summary

This article covered:

  • Manually translating your site’s content into your desired language

Further resources on this subject:

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!ba
  • 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

via packtpub.com

This article is an excerpt from my recently published book Joomla! Top Extensions Cookbook.

Joomla! 1.5 Top Extensions Cookbook

Joomla! 1.5 Top Extensions for Using Languages

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.

<

  • 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:

  • 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.)

    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

    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

     

    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

    Here is one article from my newly published book Joomla! Top Extensions Cookbook. This article shows how to use multiple languages on Joomla! 1.5 based sites. This article was originally published on www.packtpub.com.