Filter comments taking into account the current content language

Created on 9 October 2012, about 12 years ago
Updated 7 April 2023, over 1 year ago

This is a follow-up in response to #1188388-98: Entity translation UI in core →

Problem

Comment language is by default set to the detected content languge when posting a comment for the first time. The assumption behind this behavior is that a user is likely to comment in the same language of the content she is commenting. Since the same content may be displayed in different languages when translated, we may end up with a list of comments in different languages. This may work in some scenarios but in others we may need to filter them out per language.

Proposed Solution

Introduce on option in the comment settings to display only comments whose language matches the detected content language.

Next Steps

📌 Task
Status

Needs work

Version

10.1 ✨

Component
Content translation  →

Last updated 1 day ago

No maintainer
Created by

🇺🇸United States yesct

Live updates comments and jobs are added and updated live.
  • D8MI

    (Drupal 8 Multilingual Initiative) is the tag used by the multilingual initiative to mark core issues (and some contributed module issues). For versions other than Drupal 8, use the i18n (Internationalization) tag on issues which involve or affect multilingual / multinational support. That is preferred over Translation.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

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

  • 🇪🇸Spain penyaskito Seville 💃, Spain 🇪🇸, UTC+2 🇪🇺

    WIP: This would filter comments per language.

    If we have a thread, and the root comment is not translated but the responses are, there are weird identations as the first won't be shown.
    It would be great checking how D7 worked in that scenario.

    Scenario: node translated in English and Spanish

    Add comment 1. in English
    Add comment 1.1 in Spanish
    Add comment 2 in English
    Translate comment 2 to Spanish
    Add comment 3 in Spanish

    In English I should see:

    1
    2

    In Spanish I should see:
    1.2? Not sure. Also not sure if it's good enough if it has the wrong identation as probably it's not a very common scenario.
    2
    3

  • 🇪🇸Spain penyaskito Seville 💃, Spain 🇪🇸, UTC+2 🇪🇺

    Accidentally uploaded empty patch.

  • Status changed to Needs work over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇮🇳India sahil.goyal

    Fixing a minor CCF error to make #29 pass the test.

  • Status changed to Needs review over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • Status changed to Needs work over 1 year ago
  • 🇺🇸United States smustgrave

    Since this is adding a new configuration option it will need an upgrade path for existing sites. With test coverage.

  • 🇪🇸Spain penyaskito Seville 💃, Spain 🇪🇸, UTC+2 🇪🇺

    Next step is not adding tests or upgrade path, but decide if this is something we want to do and if patch at #28 is good enough.

    A screenshot of how does it look in D7 when we have an scenario like the described in #28 would be helpful.

    I'll attach screenshots of how it looks like in D10.1 with that patch if noone beats me to do it.

  • 🇺🇸United States smustgrave

    Gotcha

    Never put thought into it but wonder how most sites (non Drupal) handle comments in different languages.

    If an article is posted wouldn’t someone like to see all comments vs maybe the comments just in my language.

    But can see the other side of if majority of comments are in another language may not be useful.

    Just thinking out loud

Production build 0.71.5 2024