Automatic machine translation of Discourse topics / posts?


(Jeff Atwood) #1

Just throwing this out there as a think piece.

Is there any easy / hacky way to hook up an automatic machine translation to a Discourse? Such that clicking a button of some kind on a post (or maybe even a whole topic) triggers a translation of the (ostensibly) English content to, say, Spanish?

There’s certainly

https://translate.google.com/

And Chrome will offer to translate other languages for you as a browser function…

Twitter now does this too on a per-tweet basis

But I’m thinking of triggering a translation from English to any other language here.


Inline translation of posts into another language
(Tobias Eigen) #2

I’m fairly impressed with icanlocalize which has a drupal module and wordpress plugin for semi-automatic translation. It’s a commercial service but the drupal module can be operated without using their translators. Maybe they’d be interested in adding discourse support.


(Vikhyat Korrapati) #3

When would this option be exposed? When the user’s browser locale doesn’t match the site’s configured locale? Maybe it should always be visible for multilingual forums? Should we attempt to detect the language every post is written in and use that to decide whether to expose this?


(Jeff Atwood) #4

The specific case this customer is looking at is when the content is English, but the audience may extend outside English speaking locales… it would make sense to only show this post button when the browser locale does not match the current system-wide Discourse locale though, that’s a very good idea.


(Chris Gift) #5

In previous threads on this topic on Meta the consensus for supporting multilingual discussions was to have separate instances for each language. However, there are use cases where people don’t want to fragment the discussion, but rather participate in one discussion, which is predominantly in English. However, on occasion they want or need to use their native language to read or respond to posts.

For this use case, I believe the user experience should not be to translate all the page content into one language but rather to allow the user to select specific posts for translation. The reason is that users still don’t trust automated translations (they are problematic with technical discussions) and prefer to muddle through a post in the native language. However, it does sometimes get beyond them and they need to resort to a Google or Bing translation. By allowing someone to select which posts to translate gives them this freedom.

I have seen this implementation once (I’m tyring to find it again) where the developer enabled Google Translate on a post by post basis and it seemed practical.


(Tobias Eigen) #6

Maybe something like this example from Global Voices. The blog aggregates and translates into English news from citizen journalists all over the world. It has a method (that I don’t know - maybe a custom WordPress plugin?) that allows bloggers to quote text and provide a translation. At the top of the post you see the attribution of original author and translator, and other languages the post is available in including Spanish, Malagasy, Swahili and French. For each translation, all the quotes are appropriately provided in the original translation.


(Tobias Eigen) #7

This is provided by Facebook and works remarkably well and I use it all the time - see two screenshots below. It would be nice to see this sort of thing in discourse to keep the flow of discussion going and not hold up users because they don’t all speak the same language. :slight_smile:

###Before clicking on “See Translation” link:

###Ater clicking on “See Translation” link:


(Chris Gift) #8

I like this implementation (it’s clean and easy to navigate) and may use this for an unrelated translated problem. As for Discourse, I noticed that the Global Voices translation is automatically provided, whereas I prefer Facebook’s implementation where it’s a user action. Especially within machine translation where the translation can frequently be wrong you want to the user to explicitly seek the translation, knowing full well that there could be issues with the content.


(Vikhyat Korrapati) #9

Will give this a shot tomorrow, I think it should be pretty easy to implement as a plugin.


(Sam Saffron) #10

I would much prefer if you focus on more badges progress :slight_smile:


(Hugo Almeida) #11

I’ve implemented this in Discourse Meta

Looking for some feedback.


(Tobias Eigen) #12

I am getting requests in my community for inline translation. Is this something anyone has succeeded with already yet, or something a group of us could work together on? I’d be happy to contribute :heavy_dollar_sign: to help make it happen, and of course help with testing.

@radq is this something you are interested in developing? @sam @codinghorror could this be developed as an officially supported plugin?

@HugoAlmeida did create a plugin that looks to provide the functionality we are looking for, but the project is unfinished and doesn’t work. He has not worked on it for a long time and also has not been here in a while either.

https://meta.discourse.org/t/translator-automatic-post-translation/18756?u=tobiaseigen&source_topic_id=16246

(Jesse Perry) #13

Ditto on really wanting to see this and being able to contribute a little bit of $$ and testing. It appears that the plugin is breaking only because it calls HTTP from a HTTPS Discourse? I would imagine the Microsoft service would support HTTPS? Is it as simple as changing the requests in the plugin code to HTTPS? Probably not…


(James Kiesel) #14

The first feature I developed for Loomio was an inline translation feature using Bing Translator, the original source is available here: Inline translations for Discussion, Comment, Motion, Vote by gdpelican · Pull Request #1360 · loomio/loomio · GitHub

I’d be happy to look at a plugin implementation of it for Discourse, but I’m currently chugging away on another plugin, so it might have to be a little bit down the road.


(James Kiesel) #15

As a side note for potentially interested authors, I’m in the process of putting the finishing touches on an inline translation gem for rails which wraps the bing_translator gem and would serve as a really good starting point for this: GitHub - gdpelican/inline_translation: An easy way to provide inline translations in your Rails app

(Although, not sure if including gems into the plugin architecture is possible / practical or not)


(omfg) #16

Good decision on Bing. Works great on FB (and Twitter?)


(James Kiesel) #17

I’d use google translate as the default, but they start charging from 0 characters, whereas bing translator has a decent free tier up to 2M characters.


(Erlend Sogge Heggen) #18

You mean like this?