Problem/Motivation
There are a number of pieces of any entity formatter display that are UI text and Config text. In a View, we can have different rows displayed in different languages. However the UI text and Config text for each row is generally displayed in the page negotiated/selected UI language, not the language of this row. This could lead to a situation where you have Views output like this:
When page is viewed in English:
Title in English
Tags: Cat, Dog
Published: True
Language: EnglishTitulo en Espanol
Tags: Gato, Perro
Published: True
Language: SpanishWhen page is viewed in Spanish:
Title in English
Etiquetas: Cat, Dog
Publicado: Cierto
Idioma: InglesTitulo en Espanol
Etiquetas: Gato, Perro
Publicado: Cierto
Idioma: Espanol(sorry, I lack accents on my keyboard)
In other words, the way things are currently is that the UI and Config text, like "Tags", "Published", "True", "Language", "English" is currently displayed in the page language, while the entity information (node title and tag names) is displayed in the entity language of each views row.
This could be a bit jarring for users.
Proposed resolution
Consider whether it is desirable and feasible to make all the entity information in the views row displayed in the entity language.
Conclusion: probably not.
Remaining tasks
Depends on the decision.
User interface changes
If we decided to do this, and it was possible to accomplish, entity displays would be consistent in language in each views row.
API changes
None.
Comments
Comment #1
berdirMakes sense I guess.
There's also the field definition label, which I guess has the same issue, or not? And we have no API to get that in the content language...
Comment #2
dawehnerEhem right, its a general problem what is content and what is interface basically.
Comment #3
jhodgdonThis problem came up because I was testing #2342045: Standard views base fields need to use same rendering as Field UI fields, for formatting, access checking, and translation consistency, which is changing some Views Booleans to use Field formatters.
The Views display has a setting for the "Display language" for the entity within the row. The question is what that should do.
I guess my expectation is that all the stuff in that row of the view would be displayed in whatever the language is that is determined for that row. But maybe that expectation is flawed...
The information displayed would include:
- Which data is loaded (which translation is used to decide if a Boolean field's value is a 0 or 1, or a text field's value is "Test" in English or "Prueba" in Spanish, etc.).
- The field labels specified in the View. [But maybe these should be displayed in the UI language for the page?]
- For Boolean fields, once you've found the value, there's a formatter setting that says "1 is yes, 0 is no", or whatever. My expectation would be that these would be displayed as Si/No if the row is displaying in Spanish.
[But maybe these should be displayed in the UI language of the page? Presumably they're either config (if custom) or UI text (if a built-in alternative is chosen).]
Hm... I'm not sure really what should happen. So let's say you have a node with English and Spanish versions. The English one is Published and the Spanish one isn't. And for whatever reason, you have a view that displays the node title and the Published field (in Yes/No format).
So the question is, should it look like:
a)
My title
Published: Yes [if viewing the page in English]
Publicado: Si [if viewing the page in Spanish]
Mi titulo
Publicado: No
b)
My Title
Published: Yes
Mi Titulo
Published: No [if viewing the page in English]
Publicado: No [if viewing the page in Spanish]
And here I mean by "viewing the page in X" that you go to example.com/es/[URL] vs. just example.com/[URL] to switch the UI language.
I think that outside of Views, on most sites, this isn't a problem, because normally the Content language is the same as the UI language on a given page (same negotiated/selected language criteria), so normally the content and the field titles and the formatter config is all being displayed in the same language. But in the case of Views, you can have multiple translations being displayed in the same view, so we have to think about what should happen in this case.
I'm not sure what the right answer is... and probably didn't need to add this overly verbose comment to describe what you undoubtedly had already thought through. ;)
Comment #4
dawehnerJust to be clear, this is not an issue which just exists on the boolean formatters.
We have places like the "created by" information on nodes, date formats when rendered all falls into the same behaviour.
Comment #5
yched commentedYeah, formatters that transform field values based on some properties held in config are problematic.
The underlying field values (0/1 for a boolean, a timestamp for a date) are the correct values for the "content language", but they are then transformed (to "Yes/no" strings, to date formats) using configuration that is the one for the "interface language". Depending on what the transformation does, this ends up looking slightly off or frankly broken.
Same issue for the field labels that get prepended to the displayed values.
No real suggestion atm, just trying to get a clear view of the issue. We're at the problematic intersection of content and config :-/
Comment #6
berdirSlight correction...
And no, that doesn't make it easier ;)
Comment #7
jhodgdonYes, that is true. Adjusting title, and rewriting summary.
So I am becoming less sure whether (a) changing how this works would be a good idea and (b) if it is even practical if we decide it's a good idea. I guess it seems like kind of an edge case, but at best it would be a very complicated rewrite of the Interface, Config, and Content translation system to say "Well, in spite of the overall page language, this bit of config and this bit of UI text is part of an entity display on this page that's in a different language, so translate it to something different after all".
I think we should just close this as a Works as Designed and decide that I was being silly to bring it up on the other issue that dawehner spun this off from.
Comment #8
jhodgdonComment #9
jhodgdonSo... should we just close this?
Comment #20
catchGoing to close this as works as designed, seven years after that was proposed as the solution.