Once we get at least the most important parts of the Views Multilingual meta issue done (#2313159: [meta] Make multilingual views work), we should update the hook_help for the Views module to make sure it explains multillingual views.

Here is the help we currently have for Views (links omitted):


The Views module provides a back end to fetch information from content, user accounts, taxonomy terms, and other entities from the database and present it to the user as a grid, HTML list, table, unformatted list, etc. The resulting displays are known generally as views.

For more information, see the online documentation for the Views module.

In order to create and modify your own views using the administration and configuration user interface, you will need to enable either the Views UI module in core or a contributed module that provides a user interface for Views. See the Views UI module help page for more information.


Adding functionality to administrative pages
The Views module adds functionality to some core administration pages. For example, admin/content uses Views to filter and sort content. With Views uninstalled, admin/content is more limited.
Expanding Views functionality
Contributed projects that support the Views module can be found in the online documentation for Views-related contributed modules.

I would propose something like this, as part of the Uses section:
Working with multilingual views

If your site has multiple languages and translated entities, each result row in a view will contain one translation of each involved entity (a view can involve multiple entities if it uses relationships). You can use a filter to restrict your view to one language: without filtering, if an entity has three translations it will add three rows to the results; if you filter by language, at most one result will appear (it could be zero if that particular entity does not have a translation matching your language filter choice). If a view uses relationships, each entity in the relationship needs to be filtered separately. You can filter a view to a fixed language choice, such as English or Spanish, or to the negotiated language of the page the view is displayed on (the language that is selected for the page by the language negotiation settings either for Content or User interface).

Independent of filtering, you can choose the display language (the language used to display the entities and their fields) via a setting on the display. Your language choices are the same as the filter language choices, with an additional choice of "Row language", which means to display each entity in the result row using the language that entity has in that particular result row. In theory, this would give you the flexibility to filter to French translations, for instance, and then display the results in Spanish. The more usual choices would be to use the same language choices for the display language and each entity filter in the view, or to use the Row language setting for the display.

Note: the UI text for "Row language" and other things mentioned here has not been finalized, and this display setting doesn't even exist yet (see #2217569: Fields row plugin: Translation is non-uniform for base fields, Field UI fields, links; no way to choose "this row's language"), nor do language filters exist yet for all entity types (see parent meta issue). We should not add this to the help until it's actually true, and when we do, we should make sure that the help here matches the UI we ended up with.


jhodgdon’s picture

One more thing to be sure to document is that since each row has a language, if you use field-based filters, they need to match those rows.

Here is some proposed text to explain this (paragraph to go between the two proposed above):

Because each result row contains a specific translation of each entity, field-level filters are also relative to these entity translations. For example, if your view has a filter that specifies that the entity title should contain a particular English word, you will presumably filter out all rows containing Chinese translations, since they will not contain the English word. If your view also has a second filter specifying that the title should contain a particular Chinese word, and if you are using "And" logic for filtering, you will presumably end up with no results in the view, because there are probably not any entity translations containing both the English and Chinese words in the title.

jhodgdon’s picture

Priority:Normal» Major

Instead of having one critical parent issue I have been asked to change the status of each child issue.

I think this is probably Major since there is some functionality that is kind of complicated that is not documented.

jhodgdon’s picture