Translations for Terms of Service, Privacy

סיכום מבוסס בינה מלאכותית

In a discussion about translation issues in Discourse’s Terms of Service, Privacy, and FAQ/Guidelines pages, Lure reported that while the default About page translates correctly, other tabs revert to English headers — suspecting it might stem from English bootstrap settings. After enabling verbose localization, Lure confirmed that the English text in those tabs wasn’t using translation keys, suggesting hardcoding. However, gerhard clarified that the issue wasn’t hardcoding but inconsistent locale key usage depending on page access, and noted a fix was pending for version 2.2. Lure later confirmed the issue appeared resolved in 2.3.0.beta2, though gerhard playfully denied making changes — suggesting Lure might have inadvertently fixed it via app.yml locale settings (e.g., LANG: sl_SI.UTF-8, DISCOURSE_DEFAULT_LOCALE: sl). Ultimately, gerhard confirmed the fix is now implemented: server and client now share consistent translations, and unused TOS translation keys were cleaned up in two commits: 58f72cd and 98a17ed.

Default about page is properly translated:

However, when I switch to FAQ/Guidelines, TOS or Privacy tabs, header get back to English:

I suspect, that this is potentially caused by bootstrap that was done in English - I only found out later, that you can change locale for bootstrap. Is there a way to change this after bootstrap?

Have now tested with I18n.enableVerboseLocalizationSession():
it confirms that first screenshot from above is filled from translation keys (therefore translated), while the second screenshot have hardcoded English value and no keys are added by verbose translations… :face_with_raised_eyebrow:

No, it’s not hardcoded. It uses different locale keys depending on how you access the page. I already have a fix for it, but didn’t want to commit it before the release of 2.2.

4 לייקים

I can confirm this is now fixed in 2.3.0.beta2. Thanks a lot!

Are you sure? I didn’t change anything yet. :wink:
Maybe you only noticed a missing translation, but there’s still something I need to fix. :slight_smile:

Sure. Then it may be due to app.yml change I did last time (but did not rebuild app since then):

LANG: sl_SI.UTF-8
DISCOURSE_DEFAULT_LOCALE: sl

If I understand your previous post, it gets default from here, right?

This is done. From now on server and client will use the same translations.

And I did some house cleaning because I noticed we had some unused translations for “Terms of Service”.

https://github.com/discourse/discourse/commit/98a17edc90114f6a7c5134d8f7313619093eb869

5 לייקים