Tutorials for Magento and Joomla! - Yireo

Using Yireo GoogleTranslate for Magento

The Yireo GoogleTranslate module allows you to easily implement Google Translate into Magento, without coding and without core-hacks. Instead of adding the translation every time at the frontend, this module allows you to store the translation in your backend. This tutorial shows you what you should do to implement Yireo GoogleTranslate into your site.

Get a Google Translate API-key

Google Translate is an online service offered by Google, and it can be used on any site - with the requirement to apply for an API key. There are two different API versions that can be used:

  1. On the Google Translate website you can apply for an API version 1 key for a specific domain. 
  2. Within the Google APIs Console of your Google account you can activate an API version 2 key for multiple services, including Google Translate.

We recommend you to only apply for an API version 2 key. You don't need both. If you would use Google Translate on multiple domains (even within the same Magento application) you would still need to apply for multiple keys. Write down the generated API-key before continuing.

Get the Yireo GoogleTranslate module

The Yireo GoogleTranslate module is for sale on our site. Once purchased, you can download the latest version of this extension at any time by navigating to your Yireo Account. The extension is only available in the form of a ZIP-file, and is not available through MagentoConnect.

Installing the Yireo GoogleTranslate module

Download the ZIP-file to your computer, extract all files and upload those files to the Magento root-folder using FTP or SSH. The ZIP-file contains the following folders which correspond with existing folders in Magento:

  • app/etc/modules
  • app/code/community
  • app/design/adminhtml/base/default/layout
  • app/design/adminhtml/base/default/templates

This extension does not modify your Magento frontend.

Refresh Magento caching

After uploading these files and folders to Magento, refresh the Magento cache. You can either do this from the Magento backend (System > Cache Management). Or you could also remove the entire var/cache folder through FTP or SSH to remove the cache manually.

Configuring the GoogleTranslate settings

Next, login to the Magento Admin Panel and browse to System > Configuration. Select the right scope (Store or Store View) to configure. Then navigate to Catalog > Catalog > Google Translate. If this menu-option is not available, logout from the Magento Admin Panel and log back in again.

Within the configuration panel, you will need to configure the API Key as generated on the official Google Translate website. As soon as you have entered a correct API-key, Google Translate will be enabled in your backend.

Note with latest versions of our GoogleTranslate extension, you can configure 2 API-keys - either version 1 or version 2. You need to enter only one API key, not two.

googletranslate_04

Detecting the language

The Magento extension detects automatically the right languages: The language of the parent scope (the original text), and of the current scope (the translation). It also tries to detect whether the current text (in the current language) is already translated or not.

Original text (English)

googletranslate_02

Translated text (German)

googletranslate_03

Changing the button format

You can change the format of the button label, making it easier to understand what the module is doing. For instance, to see both the source language as well as the destination language, you can enter the following format:

Translate from $FROM to $TO

This will print for instance:

Translate from English to French

Why is the button greyed out?

A translation is always based on a source language and a destination language. The translate-button will be greyed out automatically when the locale / language of the current scope (either Global, Website or Store View) is matching the original scope.

  • When you enter the Products overview in the Magento backend, the scope is set to Global. The scope-selection is set to Default values. Because there is point in translating the default language to the default language, the buttons are greyed out.
  • When you change the scope to a Store View called English, which has the US/English locale configured for it, but when the US/English locale is also the default locale, again the same applies: It makes no sense to translate English to English.
  • When you change the scope to a Store View called French, which has the French locale configured for it, while the default locale is English, then a translation is possible: The button will be usable, because the text can be translated from English to French.
Created on Wednesday, 27 April 2011
Modified on Wednesday, 07 September 2011

About Yireo

Yireo tries to help webdevelopers build successful Joomla! and Magento sites.

More about Yireo