OS Locale sent in telemetry pings instead of UI locale

NEW
Unassigned

Status

()

Firefox for Android
Metrics
a year ago
3 months ago

People

(Reporter: flod, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

a year ago
I was trying to find out the usage of localized builds for Fennec in India, and noticed strange locale codes in the results: most of the reported locales are not supported in the UI (en-IN, en-AU, etc.)
https://sql.telemetry.mozilla.org/queries/2006/source#table

Telemetry Documentation
https://gecko.readthedocs.io/en/latest/toolkit/components/telemetry/telemetry/data/core-ping.html

"locale": <string>, // application locale, e.g. "en-US"

Relevant code path seems to be
https://dxr.mozilla.org/mozilla-central/rev/143bb4b9249e528e658f6ccc449991794b8675f8/mobile/android/base/java/org/mozilla/gecko/telemetry/pingbuilders/TelemetryCorePingBuilder.java#88

I assume we're sending the OS locale instead of the UI locale with
Locales.getLanguageTag(Locale.getDefault())
Component: General → Metrics
Locale.getDefault is correct, but it must be called in a process in which the switched locale has been loaded. If the telemetry uploader is doing locale capture, then it has to jump through the same hoops as each of Fennec's activities. The FHR code did so, if you want to dig that up for reference.

Comment 2

3 months ago
Hi Francesco
Do you need the locale to be UI locale?
Flags: needinfo?(francesco.lodolo)
(Reporter)

Comment 3

3 months ago
(In reply to Nevin Chen [:nechen] from comment #2)
> Hi Francesco
> Do you need the locale to be UI locale?

Yes, we need the UI locale, not funky Android ones.

> I assume we're sending the OS locale instead of the UI locale with
Flags: needinfo?(francesco.lodolo)
You need to log in before you can comment on or make changes to this bug.