Mentioned in #1801304-316: Add Entity reference field Task B.

Problem/Motivation

Cannot figure out how to add a context that will get default argument of nid's translation's language (from the url) and use that to filter a list of users by those users who have the same langcode in their account language setting.

Proposed resolution

?

Remaining tasks

It may not be possible. See what Tim or Daniel says.

User interface changes

N/A

API changes

N/A

Comments

Here are notes from a poor first attempt:

  1. add view. name: language user list
  2. show: users (meh, cannot pick default sort by name.)
  3. Save and edit
  4. add entity reference display
  5. notice error and click the format settings link.
  6. check user name and click apply.
  7. preview lists all users.
  8. add filter criteria: User: language. click apply (all displays)
  9. operator: is one of
  10. language checkboxes.. want to pick, get default from url or something. dont see that. click more collapsed field set, but that's just administrative title
  11. try not picking any checkbox.
  12. click apply.
  13. get error: No valid values found on filter: User: Language.
  14. add sort criteria: user: name
  15. click apply
  16. click rearrange in sort criteria drop button. put user: name (asc) first.
  17. click advanced
  18. click add next to contextual filters. try global null.
  19. pick provide default value
  20. try type: content id from url
  21. (advanced column keeps staying collapsed)
  22. go back to filter criteria user: language

maybe I dont want to list users. Maybe I want to list content, and then the language and then a relationship to users with that language?

Assigned:Unassigned» dawehner
Category:support» task
Issue tags:+VDC

So there is for sure a limit what views can do out of the box.

The approach with using somehow a listing of users and try to use default argument is the right approach, though we need a new default plugin which could be called "node language from url". I'm happy to write one of those plugins.

@dawehner if you write in words how to write a plugin like that, me or someone else can try and do the task. Maybe there is some documentation to point us to?

Just a general question: Do you want to list all users, which have configured a certain langcode, which is the same as the langcode from the current node?

Yep.

Thinking back, I was testing the entity reference addition and wanted to see if with worked with multilingual.
I think I was imagining that I wanted to fill in some (reference) to a user, and wanted to use language to limit all the users on a site, to just those users with the same language (default language setting) in their account as the language of the node being edited.

But I imagine, that something similar would be involved in making a block of 5 users for display with a piece of content, if we wanted to limit the list of users to those that had selected the same language as the content was.

Actually, thinking more.. are users... do they have a "language" associated with the actual user, not their setting of what they want the default language of content to be is... but the language of the user thingy itself... like the language of the profile.

Say a user has a job title field. That user can write the name of their job title there, and translate it. So the 'user' itself might exist in one language and their might be translations of that user too.

We can probably come up with a reason to want to filter users by that kind of language also.