When a node is in another language as the interface language, we have mixed languages on one page.
We already fixed to add the language and direction attribute in #1164926: Nodes need to have languages specified separately for accessibility, but the labels and comment sections are not aware of this. What we see now is the node language technically is also attached to the comment section and labels as well, while the visible language for these elements is now in fact the interface language. The technical language and the visual language should be the same for these elements.

Not sure what the correct language should be:

  • If a node is in another language as the interface language, should we print the labels in the node language as well?
  • Or should we print the labels in the interface language?
  • And do we expect comments in the node language or in the interface language?
CommentFileSizeAuthor
#2 english_in_arabic.png175.97 KBHanno
#2 arabic_in_english.png188.51 KBHanno
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Hanno’s picture

Issue summary: View changes

issue tagged

Gábor Hojtsy’s picture

Status: Active » Postponed (maintainer needs more info)

Field labels are not translatable in core, so we cannot really display them in any other language but what was entered. They should eventually become translatable with the introduction of CMI's backend/API and its application to field settings, if/when that API supports languages and translation. So I don't think we can do anything with labels at the moment.

For comments, I think that is an unrelated issue to labels, since comments are user input, they are usually not translated per say (at least I've never seen sites where comments were stored in multiple languages). So applying language there means filtering the list of comments displayed based on language, right? Not translating them to some language. Does core have that capability? (I have not looked). You seem to say it currently does filter comments and it does so based on the interface language(?). Or are you referring to the comment form and/or the comments header text?

Hanno’s picture

FileSize
188.51 KB
175.97 KB

Well it is a bit hard to explain and will only show in certain situations. Attached two screenshots: arabic text in English interface and a English text in an Arabic interface. According to the direction you can see that the language and direction doesn't correspond to the used language. 'Submitted by' and the comment form are in the wrong direction (and language attribute).

english in arabic

The surrounding interface is Arabic, so should the comment form in Arabic or in English? Should 'submitted by' be in arabic? It is now a mix: visible is arabic language, but it is in LTR and with the english language tag

arabic in english

Here an 'Arabic' text, correctly RTL. The surrounding interface is English, so should the comment form in English or in Arabic? Should 'submitted by' be in english? It is now a mix: visible is the English language, but it is in RTL and with the arabic language tag. Also note that 'Body' is in english, but in RTL. The title should be RTL and arabic, but is LTR and english, but that is hard to tackle as title is at the moment not part of node.tpl.php. When printing teasers it is correct.

Hanno’s picture

Title: When viewing a node in another language as interface language, labels and comment section should have correct language » When viewing a node in another language as interface language, comment form should have correct language

Altered title as labels aren't translatable at the moment. Has to wait to CMI. #1157426: Field system uses t() incorrectly and inconsistently.
First focus on the input form? Should the interface language of the comment form be in the node language, or the interface language?

Choosing the interface language is more consistent, but that introduces language complexity in nodes. For example, if there is a share button, that could be printed in the interface language as well, while a text field should be printed in the node language.

Gábor Hojtsy’s picture

Issue tags: +language-content

Tagging for the content handling leg of D8MI.

mgifford’s picture

We're going to need a patch to look at for this. I know there have been a lot of changes in i18n in D8, but not sure if this is one of them.

leenwebb’s picture

Issue tags: -Accessibility

(not an accessibility-specific issue, as far as Montreal Accessibility Sprint is concerned. Be sure to set the language attribute if you mix languages on a single page.)

Pancho’s picture

Status: Postponed (maintainer needs more info) » Postponed

Don't know what is correct. Think this should be postponed on #731724: Convert comment settings into a field to make them work with CMI and non-node entities as that will change about every line of comment module.
Also added this one to #1323338: [meta] Conform to WCAG Success Criterion 3.1.2: Language of Parts.

Pancho’s picture

Issue summary: View changes

.

mgifford’s picture

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

pameeela’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +Bug Smash Initiative, +Needs steps to reproduce

Marking this postponed until we have some steps to reproduce because these kinds of bugs are tricky enough with steps!

Any multilingual users know whether this is still valid and how to reproduce it?

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Status: Postponed (maintainer needs more info) » Active
Issue tags: +Needs issue summary update

I tested this on 9.5.x, standard install, with Italian as the second language and the article content type translatable. I tried without and then with comments translatable.

I was able to reproduce problems with the interface language when comments were not translatable. I added a comment on the Italian node and then the comment title was in Italian on both the English and the Italian versions of the node.

When comments were translatable things entering a comment on the Italian node always redirect to the English page on save. I think that is
#2751269: Submitting a comment in the non default language redirects you to the default language.

This also needs a new title.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Charles Belov’s picture

There is the separate issue now we have no control over what language the commenter uses when making their comment. I see comments in all sorts of languages on YouTube videos all on the same video and comments are not necessarily in the language of the video. In theory, all comment fields would correctly be accompanied by a way for the commenter to set the language of their comment; I realize this would be a feature request outside the scope of this issue. That said, it does point out the difficulty of solving this particular issue.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.