Control Panel

API Configuration

At this time, Rosie works with the Google Translate API and the Microsoft Translator API. As new translation services become available, we do intend to include them if there is enough interest from the community.

Google Translate API

To use the Google Translate API, you will need to sign up for an API key.

Microsoft Translator API

To use the Microsoft Translator API, you will need a Client ID and Client secret. This walkthrough on signing up for Microsoft Translator and getting your credentials is helpful when trying to get started.

One major benefit of using the Microsoft Translator API is that Microsoft offers a free plan with up to 2,000,000 characters translated per month.

API Limits

Currently, the Google Translate API has a limit of 5,000 characters per request, and the Microsoft Translator API has a limit of 2,000 characters per request. This means that the content of each of your {exp:rosie:translate} tags cannot exceed each API’s respective limit. This is something we are currently working on bypassing as a part of our roadmap.

Select Languages

After you have selected an API, visit the Select Language page where you can choose to include some (or all) of the languages available. There are a number or reasons this step is necessary, but the goal is to limit the number of calls to the API to keep your pages loading as quickly as possible.

The first thing Rosie does when loading a page is check whether or not the first URL segment is one of the language codes you have selected on this page. If the first segment is one of your selected language codes, Rosie then sets the {rosie_language} global variable to that language. You can then pass this variable to your {exp:rosie:translate} tag‘s to parameter like so:

{exp:rosie:translate from="en" to="{rosie_language}"}

If your URL was http://fromtheoutfit.com/es/stuff/things, Rosie would recognize the first variable as Spanish and treat your URL as if it were actually /stuff/things

Local Storage

Rosie can be configured to store your translations locally, rather than having to use your API of choice every time a page loads. Using this functionality will, at the very least, improve the performance of your page-loads by avoiding an unnecessary API call, but more importantly it will save you a lot of money in translation charges. For these reasons, we highly recommend always using local storage.

To learn how to configure local storage, go to the template tags page.

Overriding Local Translations

Additionally, local storage allows you to override any previous translations. Let’s be honest, we all get a good laugh out of watching machine translation turn something like:

I am your biggest fan!

Into:

I am your biggest air conditioner!

If and when someone reports an incorrect translation, you can find the offending item here and adjust it accordingly.

Deleting Local Translations

Rosie comes with a number of automatic local cache-breaking mechanisms. You can read about this functionality in the template tags section. You can also, however, manually delete local storage here.