title: Django-filter: How do I determine the current language inside an OrderingFilter?
body: <p>I have a django_filter <code>FilterSet</code> which contains an <code>OrderingFilter</code> as follows:</p>
  
  <pre><code>from django.utils.translation import get_language
  import django_filters
  
  class geographicEntityFilter(django_filters.FilterSet):
          ordering = django_filters.OrderingFilter(
                  fields = (
                          ('displayedNames__' + get_language()[0:2],'name'),
                  )
          )
  </code></pre>
  
  <p>I use that Filter with a class-based view:</p>
  
  <pre><code>class GeographicEntityListView(FilterView):
          def get_context_data(self, **kwargs):
                  context = super().get_context_data(**kwargs)
                  f = geographicEntityFilter(self.request.GET, queryset=self.get_queryset())
                  ...
  </code></pre>
  
  <p>What I want to do is to set the field name depending on the currently selected language by the user. The <code>get_language()</code> method always returns "en" no matter what language the site is on. I assume I need to access the language via the <code>request</code>, but I can't find any documentation on that.</p>
  
  <p>That works in other parts of my code with other <code>FilterSets</code> e.g. when I define a callable for the QuerySet of a <code>ModelChoiceFilter</code>, where the <code>request</code> is available.</p>
  
  <p>But according to the documentation, the <code>fields</code> argument "accepts the ‘list of two-tuples’ syntax ...fields may also just be an iterable of strings". No mention about a callable.</p>
  
  <p>So, any help is appreciated.</p>