I am using Views to generate listings of users in a multilingual site, but I can't seem to get the language as a field/filter.

I can see field handlers for almost every column in the users table, but not language.
A filter on language would sound handy as well, fe a list of recent users in the current language.

Is this intentionally not implemented (or in another module) or am I missing something here? :)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nikitas’s picture

have u tried adding an argument with the node translation option and then add a filter with the node translation option?
but i dont know if this will help you.
p.s:This works for creating a view with nodes but i believe that there will be something similar for the users.

dawehner’s picture

Status: Active » Needs review
FileSize
2.82 KB

he wants to have a field for the user language, on listings of users

dawehner’s picture

there has to be a check_plain

merlinofchaos’s picture

Status: Needs review » Fixed

Looks nice! Committed.

ayalon’s picture

Version: 6.x-2.5 » 6.x-2.6
Priority: Minor » Normal
Status: Fixed » Needs review
FileSize
6 KB
381 bytes

I tested this and its working.

But I have one improvement:

Currently the user language can be filtered by a string filter. This doesn't make sense because normally one filters content by the user-language and the current website language.

Because of this I slightly improved the filter to "views_handler_filter_node_language". With this filter you may choose any of the existing language and also the current language.

I tested this on my page and its working correctly.

Can this change be committed too?

dawehner’s picture

Status: Needs review » Needs work

you didn't attached the handler in the patch :)

ayalon’s picture

Status: Needs work » Needs review

The patch has already been commited. The patch is made for the latest version of views. Its a patch for your patch :-)

dawehner’s picture

ups sry

merlinofchaos’s picture

Status: Needs review » Fixed

Commited to 2.x and 3.x branches.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

tamerzg’s picture

Version: 6.x-2.6 » 6.x-2.12
Category: support » bug
Status: Closed (fixed) » Active

The patch in #5 makes handler broken (Broken/missing handler: users > language) if Locale module is not enabled and configured.

tamerzg’s picture

Actually Locale module doesn't matter. Couldn't get it to work. If I revert changes from #5 it works.

tamerzg’s picture

Status: Active » Needs review
FileSize
529 bytes

Here is the patch.

bojanz’s picture

Status: Needs review » Reviewed & tested by the community

Okay, what happened here?

The handlers that #5 made default don't exist. Not the files, or the entries in user_views_handlers().
Was there a wrong commit along the way?
#13 should fix it....

dawehner’s picture

Status: Reviewed & tested by the community » Needs review

find . -name "views_handler_filter_node_language*"
./modules/translation/views_handler_filter_node_language.inc

Are we really sure we want to remove a feature?

bojanz’s picture

Status: Needs review » Needs work

Knew it was a good idea to ping you :)

This rules out #13 as the right fix.

MustangGB’s picture

Issue summary: View changes
Status: Needs work » Closed (won't fix)