Translates to user's local language

I am currently using a translation plugin that translates any language to English. Our business requirement is that if a user’s locale is Japanese, clicking a translate button should instantly load the entire page in Japanese. Any guidance or suggestions on how to achieve this efficiently would be greatly appreciated.

Are you using the official Discourse Translator? I’m pretty sure you’re describing exactly what it does.

If you are using that plugin, then you should say so (rather than “a plugin”) and describe what is wrong with how it is working right now.

3 Likes

The Discourse Translator plugin currently translates any content to English by default. For example, if there’s a topic written in Japanese, it automatically converts it to English. However, we want to allow users to choose their preferred language, such as Spanish, and have the entire page translated to that language instead.

Example:

  1. A user visits a discussion thread on Discourse.
  2. The original post is in English, and there are comments in various languages, including Japanese and French.
  3. The user prefers to read in Spanish. They select Spanish from a language preference dropdown.
  4. The entire page, including the original post and all comments, is translated into Spanish.

any suggestion would be appreciated thank you

I set up the Discourse Translator plugin a few years ago and I’m fairly sure that it translates each topic/post to the user’s locale set in their profile settings.

Each user’s interface language is able to be set at /my/preferences/interface

e.g. https://meta.discourse.org/my/preferences/interface

So you can test with a few different locales to make sure.

On the description for that plugin, it mentions that it saves the translation for each locale for each post, which is handy when you have multiple users that have the same locale.

About translating the whole page: users can translate one post at a time by clicking on the translate button for each post.

The plugin won’t translate the whole page and all comments at once—since depending on the service that you set up for translation, it could cost you a lot especially if they don’t end up reading the whole page.

Hello, i saw your reply in email - just wanted to add that you need to enable this setting “allow user locale”

I am getting this error while translating one of the post
An error occurred: Bad language pair: en|en

Can anyone pls let me know what can be the reason