@c960657 opened this Pull Request on May 13th 2018 Contributor

The timezone selector in the sites manager is not localised but shows all city names in English.

When using Matomo in Italian, a user would expect the list to contain “Roma”, not “Rome”. And a user using Matomo in Russian would look for “Москва́”, not “Moscow”. Even an English user would expect “Dumont d’Urville” instead of “DumontDUrville” (for Antarctica/DumontDUrville).

CLDR contains translations of all city names. However, the CLDR spec suggests that timezone selectors should allow users to select the country name, not the city name. City names should only be shown for countries spanning multiple timezones. Of course, this is just a UI recommendation, not a requirement of any sort, but I think it makes sense.

You quite often see this long list of cities in timezone selectors in various software, and for a developer who is familiar with the tz database it may seem natural. I suspect that this UI is popular, because it is easy to construct the list based on the timezone identifiers alone. From and end-user point of view I think that a list of countries is the natural choice. For some countries it is not obvious which city is the one used in the tz database (the capital may not be the largest city), and for some regions the tz identifier is not a city name but the name of an island. Countries are well-defined and used in many contexts.

This PR implements a UI as suggested in the CLDR spec. It looks like this (excerpt):

  • Europe
    • Poland
    • Portugal - Azores
    • Portugal - Lisbon
    • Portugal - Madeira
    • Romania

The timezones are now grouped by the same continent definition as used elsewhere in Matomo, instead of the definition used in the tz database. This is more consistent from an end-user point of view.

@c960657 commented on May 30th 2018 Contributor

Thanks for the review :)

@c960657 commented on May 31st 2018 Contributor

The translation for UTC is now fetched from plugins/SitesManager/lang/en.json instead.

This Pull Request was closed on June 7th 2018
Powered by GitHub Issue Mirror