Discourse Translator

Summary: Translate posts on Discourse using Microsoft, Google, or Yandex translation APIs.

:link: GitHub: https://github.com/discourse/discourse-translator
:arrow_right: Install: Follow the plugin installation guide.

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 (Could be made configurable)

Translation Services Supported

Configuration

Microsoft

Instructions
  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. Under Admin > Settings > Plugins, enter the subscription key that you’ve obtained from the steps above.

  1. Under Admin > Settings > Basic Setup, enable allow user locale.

Google Translator

Instructions
  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.

Known Issues

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

CHANGELOG

TODO

  • Allow admin to set quota and disable translation once quota has been exceeded.
  • Disable translation for private messages???
70 Likes

Just to complete the topic. We run the estimate with the help of this topic:

It looks like we’re in the scary teritory.

See below for some feature requests:

  • it would be nice to be able to control the initial language detection
    (either limit it to specific categories, define how many characters to consider per post, etc)
  • it would be nice if you could enable the feature to specific categories

I also have some small follow-up questions:

  1. This here: image
    Does it currently consider private messages (i.e. will it translate Discobot tutorials)?
  2. Does it cache the identical translations (I suppose it would mitigate the Discobot issue a little bit)?
6 Likes

I believe this is because we renamed a couple locales in core lately. I think this commit should fix it once you’ve updated:

7 Likes

Yes, it has. Thank you!

5 Likes