I've been testing this module out, took these steps:

Enabled English, French and German as languages.
Enabled Canada and United Kingdom as countries.
Associated English and French with United Kingdom.
Posted various content in English and French - some translated, some not.
Set up a view, with node - country = current user's country as the only filter.

Regardless of whether nodes were translated or not, only nodes in English show up, and the views query in preview says WHERE node.language in ('en')

When you use 'United Kingdom' as the filter, then you see content in both English and French.

If I set French to be weighted first in /admin/settings/country-code-country/uk/languages, then I still only see content in English.

There seems to be a couple of possibilities here:
1. it seems like the current user country filter isn't returning the supported languages correctly - I'd expect it to do IN('en', 'fr') like the hard coded per-country filters.
2. We might want an additional filter which is "primary language in the user's country" - where we return only the first language in the array.

CommentFileSizeAuthor
#1 ip_address.patch1.3 KBdouggreen
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

douggreen’s picture

FileSize
1.3 KB

The only problem is that during testing, ip_address() returns a localhost ip address, and the http://api.hostip.info service can't figure this out. I also discovered that this service isn't perfect, it couldn't figure out the CivicActions servers country. So, I think that we're going to need to make a more extensive country code lookup system. For debugging in the interim, the attached simple patch, let's you set an ip_address in the settings.php.

nedjo’s picture

I committed a version of Doug's patch.

nedjo’s picture

I'm working on fixing up the views code in #309420: Expose views filters based on the current country code.

recidive’s picture

Status: Active » Fixed

This seems fixed. Please re-open otherwise.

Status: Fixed » Closed (fixed)

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