The main forum table shows only the original language even though there are translations

Created on 24 January 2021, over 4 years ago
Updated 7 February 2023, over 2 years ago

Problem/Motivation

The table on the forums main page for the second language (e.g. mysite.com/es/forum) shows the forum titles in English.

Steps to reproduce

  1. Install the forum module on a website that has multiple languages. In my case, I have English and Spanish.
  2. Enable translation for "Content:Forum" under /admin/config/regional/content-language.
  3. Also, enable translation for "Taxonomy term:Forums topic" under /admin/config/regional/content-language.
  4. Add a few new forums in English language at /admin/structure/forum
  5. Go to /admin/structure/taxonomy/manage/forums/overview and add translations to the forum terms
  6. Visit /es/forum and you will see that the forums listed are still in English; even though the interface is in Spanish (/es/).

Proposed resolution

The expected behavior would be for the forums to be listed in Spanish language when they have a translation or when the language of the term is originally in Spanish language.

I understand that forums are generarly user generated content; however, I would like to have the same categories (or forums) in both languages. As a workaround, I tried to create the forums independently in both languages (not as a translations) but the page /es/forum continued to show the English forums in addition to the Spanish forums.

When working with multilingual views, there is a way of telling the view to use the translation that matches the language of the interface; however, the page /es/forum doesn't appear to have a corresponding view that can be used for tweaking.

πŸ› Bug report
Status

Postponed

Version

9.5

Component

forum.module

Created by

πŸ‡ΊπŸ‡ΈUnited States jcmartinez Raleigh, NC, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡³πŸ‡ΏNew Zealand quietone

    Forum is approved for removal. See #1898812: [policy] Deprecate forum module for removal in Drupal 11 β†’

    This is now Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project β†’ and the Extensions approved for removal β†’ policies.

    It will be moved to the contributed extension β†’ once the Drupal 11 branch is open.

  • πŸ‡§πŸ‡ͺBelgium ludo.r Brussels

    This patch should solve the problem.
    There might be more underlying issues to solve but it will get the translated titles to be displayed.

  • Status changed to Active about 1 year ago
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Moved to Forum project, as the issue still exists!

  • Open on Drupal.org β†’
    Core: 10.2.x + Environment: PHP 8.0 & MySQL 5.7
    last update about 1 year ago
    Waiting for branch to pass
  • Status changed to Needs review about 1 year ago
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Created a MR based on #10 for the forum module. Please review.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Patch #10 btw. doesn't apply any more against 10.3.x / 11.x - so here's a rerolled patch against 10.3.x

  • Open on Drupal.org β†’
    Core: 10.2.x + Environment: PHP 8.0 & MySQL 5.7
    last update about 1 year ago
    Waiting for branch to pass
  • Patch #15 aka MR works fine and fixes the forum translation as expected

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Just tried the patch #15 (Reroll of #10) with 10.3.x and 10.2.5 and it works as expected! Forum is now shown translated! :)

  • Status changed to Needs work about 1 year ago
  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    Code looks good, would be good to add tests for this as it feels like important functionality

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Forum breadcrumbs still contain untranslated text (from Taxonomy terms).

    I didn't find any other issues yet.

  • πŸ‡«πŸ‡·France erwangel

    MR!3 worked for me on Drupal 10.4.7 + forum 1.0.2 and forum names (Taxonomy terms) appear in the right language.

    However topic titles still appear in the original/posted language. This has for effect to user to loose his interface language. My use case is to have forum/taxonomy terms translated; forum nodes are not translated but author can chose the content language.

    Let's say we have lang1 as default language and lang2 as second language code.

    Whatever the interface language is, topics are listed as follows:

    Forum title is displayed in the interface language (after applying the patch, now it works as expected)
    Topic 1 published in default language has aliased url1: forum/the_topic_1_title
    Topic 2 published in lang2 has aliased url2: lang2/forum/the_topic2_title

    If a user navigates the site with the default language and clicks on topic 2 title (url2) all his interface language will switch to the lang2.
    Same if he uses lang 2 interface and he clicks on url1, his interface will switch to lang1.
    This is because interface detection is done from url's lang_code which I think is the most used case.

    I think the correct display of topics listing should be:

    If interface language is default (lang1)
    Topic 1 published in default language has aliased url1: forum/the_topic_1_title
    Topic 2 published in lang2 has unaliased url2: /node/nid2

    If interface language is lang2
    Topic 1 published in default language has unaliased url1: /lang2/node/nid1
    Topic 2 published in lang2 has aliased url2: /lang2 /forum/the_topic_2_title

Production build 0.71.5 2024