Translation not displayed on locale change, but html language changes nonetheless

AI-generated summary

The discussion revolves around an issue with content localization in Discourse 3.5 where translated text is not displayed when changing the locale, despite the HTML language attribute updating correctly. monty25 reports that translations are set up (e.g., Dutch to English (UK)), but the content remains unchanged after locale selection, even with the tl=en parameter. While the hreflang links are absent (noted as a known gap), the HTML lang attribute does switch from nl to en-GB. nat suggests checking the post’s original language setting and mentions a new experimental feature, content_localization_crawler_param, which is not available on the stable branch. Moin confirms that this feature is too new for Discourse 3.5’s stable version. tobiaseigen asks if the issue was resolved, emphasizing that the translation features are still in development and require the latest version, not the stable release.

We have set up content localization on Discourse 3.5:

A topic has been translated from the default locale Dutch to English (UK) as visible at the red 3:

When using a private browser window, the locale chooser appears, but changing it makes no change to the actual text:

The same output occurs when the enable tl parameter is added with value en or en_gb.

Also, no hreflang links are present (but that seems to be a known feature gap).

However, the first line of the HTML changes on locale change for Dutch from:

<html lang="nl" class="desktop-view not-mobile-device text-size-normal anon">

to the following for English (UK):

<html lang="en-GB" class="desktop-view not-mobile-device text-size-normal anon">

What could be the reason that the translated text is not displayed?

Could you hit the normal edit button for the post, and check that the post’s original language is correct?


We have a new experimental feature that’s behind a hidden site setting – content_localization_crawler_param which can serve translated content to Google.

We’re still in testing phase, but I’ve seen some optimal results so far.

If you wish you could turn it on.

So you are on the stable branch? I’m afraid the new setting Nat mentioned in the end is too new, so it is not available there.

@monty25 were you able to resolve your issue? As Moin points out, the translation work is fairly bleeding edge and if you want to use it you will want to be on latest, not stable.