Download & Extend

When viewing a node in another language as interface language, comment form should have correct language

Project:Drupal core
Version:8.x-dev
Component:locale.module
Category:bug report
Priority:normal
Assigned:Unassigned
Status:postponed (maintainer needs more info)
Issue tags:accessibility, D8MI, language-content

Issue Summary

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?

Comments

#1

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?

#2

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.

AttachmentSizeStatusTest resultOperations
english_in_arabic.png175.97 KBIgnored: Check issue status.NoneNone
arabic_in_english.png188.51 KBIgnored: Check issue status.NoneNone

#3

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.

#4

Issue tags:+language-content

Tagging for the content handling leg of D8MI.

nobody click here