Simple idea for translator-assisted bilingual forum

English is an international language.
Everyone who is willing to participating an international discource should speak English at least little.

In the same time, a community launched in a non-English speaking country, has a different language, local to the territory.

This makes me think that bilingual forums are a special case and deserve special attention when compared to multilingual forums (3 and more languages).

… this also fits perfectly my case

We have recently discovered that English-speaking goat farmers have great interest in how Ukrainian goat farmers make cheeses. In the same time, our farmers are interested in professional breeding that English-speaking farmers are good at.

We are now faced with a challenge: keep our forum comfortable for Ukrainian goat farmers (as it always has been), and in the same time make it easy for English people to participate in some bilingual topics for knowledge and experience exchange.


So let me share my thoughts on a possible implementation.

An important note is that this is a professional community, so Google / Bing translations will not work. I experimented auto-translating some topics and it was a disaster. Not only some slang was an issue, but also grammatical errors in key words. This lead us to the idea that we would rather spend some resources on manual translation on the topics of interest only, and keep other topics Ukrainian/Russian only.

We’ve launched an experimental Q/A Session where both sides can ask questions and give answers.

People can write using their own language, while we translate their messages, so every message in this topic is bilingual:

These translations are curated / assisted, give it any name, but the point is that we do not translate automatically. There are some delays, but the quality goes up and the topic promises to be quite interesting. I invited some other users from English-speaking communities to participate, and some of them already expressed real interest in some topics in PMs and wish to participate.

This seems to be an interesting attempt, to start with. But now we need the UI to be improved just a little!

1. Collapsable sections per language

Discourse does already have a plugin to hide/show sections in posts. It would be great if there was a way to optionally assign some locale per section (an attribute in Markdown markup).

  • If no locale assigned, it is always collapsed (the current default behaviour).
  • If locale is assigned but is the only one section with locale in the message, it is expanded by default.
  • If a few sections with locale are present, than only one is expanded by default - the one with the current user locale.
  • In anonymous mode, all sections with locale are expanded by default.
  • If no one section has the same locale as the current user’s one, the one with default website’s locale is expanded only by default.
  • If no user locale matches, nor global setting locale matches, all sections with locales are expanded by default.

2. Add locale class to collapsable sections

.section-locale-ru {...}
.section-locale-en {...}

While on this, add locale class to the body element as well

<body class="user-locale-ru">...</body>

This will allow to apply styles to sections that match current user locale only:

body.user-locale-ru .section-locale-ru {...}

3. Add language switcher in the header

This language switcher would allow to switch to English quickly before even trying to find Signup button. It would also assign the selected default language to user profile. As a workaround, we created a how-to topic to which we link from the original Q/A session topic. However, upon signup, new users receive Ukrainian welcome message, which is not good experience.

4. Make categories and topic names translatable by mods

This is more advanced feature.
As a workaround, we just named the topic in both languages:

(en) Q/A with Ukrainian goat farmers. (рус) Вопрос-ответ с англоязычными козоводами

Result

As a result:

  • users can switch languages easily before registering
  • users will see only sections in their languages expanded, while others collapsed
  • if no translation available, the original section is expanded

The only thing I’m not sure about is how it will affect SEO.


Anyone keen on implementing such a functionality?
I would make it with pleasure on my own, but I’m nowhere near being a ruby programmer.

6 Likes

You have a collection of ideas bundled together here. Separately they may be simple, but together they make for quite the extensive project!

(1) and (2) are definitely plugin territory.

(3) might also be plugin territory, but imo it would be beneficial to figure this one out for core, as I fully agree that it ought to be easier to discover and use our language switcher. @simon will soon be working on some localisation improvements for us. Maybe we can look into this then.

(4) Proper multi-lingual category names & descriptions ought to be in core at some point imo.

Translateable topic names on the other hand is very niche. This is plugin territory.

6 Likes

I’ve been thinking about this use case as well for my community and am keen to do it - in my mind @tgxworld’s in line translation can work for this, if the ability for aithorized users to improve translations were added to the plugin. This way the basic translation is there for languages supported by bing but can be improved if it’s wrong or added in the first place if the language is not supported.

I’m working on a feature that will set the locale for new users based off the accept-language header that is sent by their browser. It should do some of what you are looking for here. It will hopefully make sure that new users on multilingual forums get signed up with the correct locale. Users on multilingual forums will get their emails (including the activation email) in the correct language. This should be ready right away.

I would like to add a locale-switcher to the header for the case of a non-logged-in user whose locale is different than the site’s default locale. This is to deal with the possibility that their locale has been set incorrectly. If this gets the go ahead, it would be easy to add the locale-switcher to the header under other conditions, either through a site setting or a plugin.

4 Likes

Hi Simon! Where are you at with this locale switcher in the header feature? It seems a good idea to me! Esp the bit about anonymous users.

We do registration via wordpress, so perhaps I need to look at prefilling the locale field (which is described as the “preferred interface language”) using the web browser locale. Currently people do not tend to change it because they don’t realize what the benefits are of changing it to their preferred language.

I haven’t made it yet, but I’d like to. What’s been holding me back is that there’s a problem that if the locale is changed for an anonymous user on a forum that is using a CDN, the wrong locale may be served to the next anonymous user on their first request to the forum.

See:

It’s a solvable problem, possibly doing something like this: Swedish? meta just showed me the UI in Swedish - #10 by simon

For sites that aren’t using a CDN, this would be a fairly simple plugin. I think something like this could work as the UI:

Clicking on the ‘globe’ icon would open up a menu-panel that contains a locale switcher similar to the one in the admin section and a button that says something like ‘Reload Locale.’

2 Likes

I think the degree of the problem is being radically undersold here; dealing with language headers for anons makes caching an absolute nightmare. We weren’t able to even brainstorm a way of doing it at all that wasn’t extremely difficult and complex.

1 Like

Hi, did you ever make any progress on this? I want to do something similar, but with machine translation. I’m wondering if there’s a feature/plugin we can enable for our forum and merge our two forums that are using different languages on the same topics.

Hi, I’m quite late to the game but I’m also interested in the (1) idea: collapsable sections per language.

My community background: users mostly live in Norway and some of them are more comfortable reading Norwegian (not that they cannot read English, they just prefer their mother tongue). The collapsable Norwegian section, thus, will work best for long topics such as in the Documentation category.
But I’ve browsed this topic and seems like we have not got a way to realize this (1) dream?

1 Like

We have a bunch of solution on the table since this was first posted:

Which allows you to quickly translate.

Additionally discourse-ai does have some support for translation, which we will be building upon.

The UX of the forum supports multiple languages and users can select what locale they want, I have seen many cases where forum owners set up categories dedicated to particular languages.

3 Likes

Thanks for the info!

I’ll start researching the category setup and discourse-ai. Will come back if I have any input :blush:

1 Like

This issue has been resolved. I’m assuming it was fixed by adding the locale to the anonymous cache key.

The set locale from accept language header setting can safely be enabled on both private and public sites. This doesn’t meet the OP’s request for a language switcher, but it should solve this problem for most new users on the site:

If the allow user locale and set locale from accept language header site settings are enabled, anonymous users will have the site served to them in the locale they have set for their browser. New users also have their locale set to their browser’s language when they sign up on the site.

I wonder how much this has changed since 2016. My sense is that machine translations have improved a lot since then.

1 Like