#3726 closed New feature (fixed)

Display browser language of the visitors

Reported by: SteveG Owned by: SteveG
Priority: major Milestone: 1.11 - Piwik 1.11
Component: Core Keywords:
Cc: Sensitive: no


Browser language setting is already tracked for every visitor.
That data should also be available within the frontend.

Change History (15)

comment:1 Changed 15 months ago by halfdan

I agree that this is interesting. Right now though, we don't even store the data in the 1st normal form (e.g. de-de,de,en-us,en).

Sometimes we have multiple occurences of the same language, e.g. de-de,de,en-us,en - which one is important here? de-de or de? Are they the same? What about en, en-gb and en-us?

What is important here? Should we just count the first language or all in the list? Should we build multiple statistics like "First Browser Language", "Second Browser Language"?


comment:2 Changed 15 months ago by SteveG (sgiehl)

  • Owner set to SteveG
  • Status changed from new to assigned

I guess the main language should be enough for most users.
Btw. I'm already on that. Guess I'll finish that by the end of the week...

comment:3 Changed 15 months ago by halfdan

Ah nice! Good to know, almost started with it myself :)

comment:4 Changed 15 months ago by matt (mattab)

Only first language of the list, to keep things simple I think.

We could alternatively look at secondary languages if the first one is en-us for example, because I know lots of browsers ship by default with en-us settings and users don't necessarily change it.

comment:5 Changed 14 months ago by SteveG (sgiehl)

In 3f490380e4b54048d525ca10df2d5bd1a11d147e:

refs #3726 adding reports for browser language of visitors

comment:6 Changed 14 months ago by SteveG (sgiehl)

In d1546c522c113634040c35cfddba9acb36477fcf:

refs #3726 small test for method to get language from browser setting

comment:8 Changed 14 months ago by SteveG (sgiehl)

In b2aeb6a276d2b641dc320488b0e0c7e83dbefef3:

refs #3726 added language names to translations

comment:9 Changed 14 months ago by SteveG (sgiehl)

In 74ff8ea4d5af124f1c9502756ddf57a665d11883:

refs #3726 small improvements to detection method

comment:10 Changed 14 months ago by SteveG (sgiehl)

In e29d059e63d2ee0882c9e75b338ffcdbd9db9ef4:

refs #3726 fixing some integration tests

comment:11 Changed 14 months ago by halfdan

Thanks! :-) I was scratching my head for the last 5 minutes and wondered why tests were suddenly failing on Travis..

comment:12 Changed 14 months ago by SteveG (sgiehl)

In 952dbcdfb40d45b901d22dc56b5242fa1dc6c3ec:

refs #3726 fixing integration test files

comment:13 Changed 14 months ago by matt (mattab)

  • Priority changed from normal to major

Very nice changes!

Code review:

  • Some of the new code in: Piwik_UserSettings::_getLanguageCodeFromBrowserSetting

is redundant with existing code in: Piwik_Common::extractCountryCodeFromBrowserLanguage
I think both should use same logic ?

comment:15 Changed 14 months ago by SteveG (sgiehl)

  • Resolution set to fixed
  • Status changed from assigned to closed

In 09bddedbe37c9d6bc01df960105852cf58d43777:

fixes #3726 use Piwik_Common::extractLanguageCodeFromBrowserLanguage instead of new method to get language code

Note: See TracTickets for help on using tickets.