Global Configuration Settings for Joomla: Providing a Multilingual Facility to Visitors

You can translate the content of your web site into different languages to make it readable by people all around the globe. There are a number of freely available components on the Internet that can be downloaded and installed on your Joomla web site to translate web contents to different languages. This section will discuss such a component for language translations for your web site: JA Multilingual, which supports translations into41 languages.

Download the component from www.joomlart.com/forums/downloads.php. The downloaded archive file will be com_jalang.v1.0.6.zip. To install the downloaded component, open the Extension Manager by selecting Extensions ➤ Extension Manager. In the Install tab that is opened by default, click the Browse button to locate the JA Multilingual archive file and click the Upload File & Install button to install the component in your web site, as shown in Figure 10-43.

Note      Remember that third-party extensions are compressed files that you download from a developer’s site directly to your computer. In most cases, you don’t need to unzip the compressed files and can directly upload to Joomla.

If the component is successfully installed, you see the Installing Component Was Successful message shown in Figure 10-44.

Open the component by selecting Components ➤ JA Multilingual. The Translation Manager will open with its Translate tab selected by default, as shown in Figure 10-45. The Translate tab indicates the default language. Translate to Field shows all the installed languages on the site and enables you to select the one in which you want to translate your site content. Because only French is installed, the field indicates that the site content can be translated only into French. The Component field shows the list of site components that can be translated to French.

The JA Multilingual component supports two popular translation services: BING and Google. So before you click the Translate All button, you have to specify either of the following:

  • Bing API Client ID and secret key
  • Google API key

Here are the steps to get the Bing API and secret key:

  1. Create a Microsoft account by visiting https://signup.live.com/ and signing
  2. Login to Azure Marketplace by visiting https://datamarket.azure.com/ with the registered Microsoft
  3. Visit https://datamarket.azure.com/account/keys to get your account
  4. Register a new application with your key by accessing the link https://datamarket.azure.com/developer/applications.
  1. Click the Edit button to get your Client ID and Client
  2. Register the Bing translation service by visiting https://datamarket.azure.com/dataset/bing/microsofttranslator and registering a Bing translation service It provides a free package that allows you to translate two million characters per month. If your site database is too large, you can select a premium package.

Here are the steps to get the Google API key:

  1. Visit https://cloud.google.com/console#/project, login with your Google account, and create a new project in Google Cloud Console.
  2. Verify by phone to create a new project.
  3. Open the project, select the APIs & auth ➤ APIs ➤ Translate API option, and then enable Translate API.
  4. In the project, select APIs & auth ➤ Credentials, click the New Client ID option to create a new Client ID, and select Web Application platform.
  5. Create a new API key by clicking the Create New Key Add the URL and then click Create. Copy the created API key.
  6. Before you can start using the service, Google Translate API v2 requires billing information for all Go through the instructions and enable the billing that suits your needs.
  7. To enable billing for your project, open your project, select Settings ➤ Enable Billing ➤. Fill in the info option and complete your transaction.

Now that you have created a Bing API Client ID and its secret key, click the Option icon from the toolbar at the top, select the Bing option from the Translation Service combo box, and enter the Bing API Client ID and its secret key in the fields that are displayed in Figure 10-46. Click the Save & Close button to save the information and go back to the Translation Manager page.

You are now all set to translate your web site content, so select the Components ➤ JA Multilingual option to open the Translation Manager page. From the Translation Manager page, click the Translate All button to translate the site content into French. You can see the progress of the translation in the Translation Result column, as shown in Figure 10-47. You can also see which elements of the site were successfully translated and which could not be translated. You will get a success message for the elements that were successfully translated and a failed message for the elements that could not be translated.

Now the entire web site exists in two languages: English and French. The Module Manager shown in Figure 10-48 shows the modules in English and their translated versions in French.

The next step is to enable a plug-in called System – Language Filter. Open the Plugin Manager by clicking Extensions ➤ Plugin Manager. Search for the plug-in named System – Language Filter and ensure that it is enabled.

To enable visitors of your site to switch between different languages, you have to create a module that does this language-switching task. Open the Module Manager page and click the New button to create a new module. In the pop-up that prompts for the module type, select Language Switcher. In the Title field of the new module, enter any text; use Translator (see Figure 10-49).

In the Position combo box, you select the position for the new module. Chooseposition-7 (the right top side of the site). In the Language combo box, select All so that when you switch to any language, the module is enabled. Keeping the values of the rest of the fields to their defaults, click the Save & Close button to save the new module.

The front side of your site will now show a module called Translator with a combo box in it. Because only two languages, English and French, are installed on your site, the combo box will show only these two options. By default, the site content will appear in the default language (English), as shown in Figure 10-50.

After the French option is clicked, the site content will be translated into French, as shown in Figure 10-51.

On the administrative interface and below the Translate tab that is opened by default are two more tabs: Association Manager and Remove Translation. The Association Manager tab is used to update translation manually. That is, you select the content type, and all content in your site that matches the selected content type will be listed (see Figure 10-52). Click the title of the desired content or click the Edit link (shown in the French column or any language column) in the row of the desired content to edit it.

After you select the Edit link of the “Autotracking Cell Phones” article, the article will open in French, as shown in Figure 10-53. You can edit the content if you want. After you make the desired changes in the content, click the Save & Close button at the top to save the changes.

As its name suggests, the Remove Translations tab removes the implemented translations to start all over again. When you remove translations, you lose all the translated content, so you should make a backup before removing content. After doing so, click the Delete button in front of French in the Language box.

The French translation will be removed. The Result column shows the impact of removing the translation; it shows the list of affected items (see Figure 10-54). After deleting the translated content, you can even uninstall the French language or you can stop after deleting the translated content.

To uninstall the language, open the Extension Manager by selecting Extensions ➤ Extension Manager. In the Extension Manager page, select the Manage tab to display all the installed extensions. Search for the language package to uninstall. Select the check box of French_fr-FR and click the Uninstall button from the toolbar at the top. The French language pack will be uninstalled from your site.

Source: Harwani B M (2015), Foundations of Joomla!, Apress; 2nd ed edition

Leave a Reply

Your email address will not be published. Required fields are marked *