Discourse Translator

:discourse2: Summary Discourse Translator translates posts on Discourse using Microsoft, Google, or Yandex translation APIs.
:hammer_and_wrench: Repository Link https://github.com/discourse/discourse-translator
:open_book: Install Guide How to install plugins in Discourse

Features

  • Each post is only translated once per locale which saves you :moneybag:
    • Note that language detection is also run once for every post. Be careful when enabling this on old and large forums.
  • Access Token is cached server side for faster translations.
  • Translations are rate limited to 3 per minute by default (admins can configure this value)

Translation Services Supported

Configuration

Microsoft

  1. Follow the steps in Microsoft Translator API on Azure to obtain a subscription key. You may pick from any of the available subscription offers.

  2. In your Discourse, under Admin > Settings > Plugins, enter the subscription key that you’ve obtained from the steps above.

  3. In your Discourse, under Admin > Settings > Basic Setup, enable allow user locale.

Google Translator

  1. Go to https://console.developers.google.com

  2. Click on My Project

  3. Click on the :heavy_plus_sign: to create a new project

  4. Enter your project name and click create

  5. Select Enable API and search for Google Cloud Translator API. Look for the enable button and click it to enable the API. Note that there is no free tier for the Google Translator API so it may prompt you to enable billing.

  6. Once you’re done, click on credentials in the left menu

  7. Click create credentials and select API key. Copy the API Key and paste it into the translator google api key site setting in Discourse.

  8. In Discourse, under Admin > Settings > Basic Setup, enable allow user locale.

Known Issues

  • Does not translate text within polls generated by discourse-poll plugin.
  • Images are enlarged upon translating.
89 Likes

Can the users choose which target language to translate the content to? From the gif I’m guessing that it depends on the language that the admins have set under settings? Thanks

1 Like

I’m not familiar with this plugin, but I’ll see what I can find out. :slight_smile: :+1:

2 Likes

Thanks! I’ll also have it installed on our site to test it out

2 Likes

The translation icon is only visible on posts where the language is different from the one set to default locale.

For example if the default locale of the site is set to English, the translation icon will be visible in any post where the language is different from English.

If the default locale of the site is in English but a user changes the language on their profile to French, then that user will see the translation icon on any post written in a language other than French. So the translation icon will also appears on posts written in English.

4 Likes

Thanks for your reply.

It does sounds like it relies a lot on the User Preferences. Hopefully there will be a UX in the future that allows users to select which ever target language that they want to translate to, instead of having to fiddle with the settings :+1:

1 Like