Category description truncates to first paragraph for primary/base language, but not for Localizations panel languages

AI-generated summary

osan reported a bug where category description banners in the primary language correctly truncate to the first paragraph, while descriptions added via the Localizations panel display the full text. This inconsistency creates a poor user experience, as switching interface languages changes the banner length despite the content structure being identical. The reporter outlined steps to reproduce the issue on a self-hosted instance with German as the default locale and English/French localizations, noting that only the base language honored the guideline of showing a brief summary. The expected behavior is for all languages to either truncate to the first paragraph or show the full text consistently. awesomerobot confirmed the bug, acknowledging that translated descriptions were being handled differently across the platform. They proposed a fix in pull request #41511 to ensure translated category descriptions follow the same first-paragraph truncation rule as the original. meta-bot later announced that the issue was resolved, with the corrected behavior available in the next update.

When a category’s “Category language” is set to a non-default locale (e.g. German, on a site whose default locale is also German), the category banner correctly truncates the description to the first paragraph only — matching the documented guidance that the first paragraph is a brief summary and subsequent paragraphs are for detail/rules.

However, descriptions entered for other languages via the category’s Localizations panel do not truncate the same way — they display the full multi-paragraph text in the banner, including content clearly intended as “longer description” per Discourse’s own category-editing guidance.

This produces visibly inconsistent banner length depending on which language a viewer has selected, even though the underlying saved content is structurally identical (same paragraph breaks, same intent) across all languages.

Expected behavior

Either:

  • All languages truncate to the first paragraph in the banner, with the rest visible only on the full category/About page, or
  • All languages show the full description in the banner.

Whichever is intended, behavior should be consistent across the primary/base language and Localizations-panel languages for the same category.

Actual behavior

  • Base language (German, category language explicitly set to German): banner shows first paragraph only.
  • Localizations panel (English, French): banner shows the entire saved description, all paragraphs, unt truncated.

Steps to reproduce

  1. Create a category. Set “Category language” (General tab, or Localizations tab depending on version) to a language other than the site’s original working language — in our case, German, matching the site’s default_locale.
  2. Write a two-paragraph description directly in that base field: a short first paragraph, and a longer second paragraph with additional detail.
  3. Go to the category’s Localizations tab, add English and French entries, and paste in equivalent two-paragraph descriptions for each.
  4. View the category page/banner in German — only the first paragraph displays.
  5. Switch interface language to English or French — the full two-paragraph description displays in the banner.

Reproduced identically on two separate categories on our instance (screenshots attached for both).

Environment

  • Self-hosted Discourse, [version — pull from Admin → About your site before posting; I don’t have this confirmed]
  • Content Localization enabled
  • Content localization supported locales: English, French
  • Site default locale: German
  • Category language for both test categories: German

Attachments:

2 Likes

Thanks for taking the time to make this report! I can confirm that you’re right, we’re treating the translated description differently and this applies everywhere, not just in the category banner theme component.

All languages should follow the default behavior and only show the first paragraph, I’m making that adjustment to the translated descriptions here:

Once this is merged you’ll get the corrected behavior the next time you update Discourse.

2 Likes

Fixed in #41511. Translated category descriptions now follow the same first-paragraph rule as the original.