Version
3.71.2
Steps to Reproduce
We have an iOS and Android app that integrates the respective PostHog SDK.
Our app is available in English and German. In our Mobile Analytics dashboard on PostHog (created using the PostHog template) I see a breakdown of the languages. This breakdown contains many more languages (including country specifier such as ru-RU) than just the two the app runs in.
Digging deeper, I realized that the additional languages only come from Android. On iOS it indeed only reports just the language the app runs in, as can be seen in its source:
if #available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) {
if let languageCode = Locale.current.language.languageCode {
properties["$locale"] = languageCode.identifier
}
} else {
if Locale.current.languageCode != nil {
properties["$locale"] = Locale.current.languageCode
}
}
On Android on the other hand you collect the language the device is set to:
|
dynamicContext["\$locale"] = "${Locale.getDefault().language}-${Locale.getDefault().country}" |
Expected Result
On Android it should collect just the language that is also used for resource lookup. If my phone is set to de-CH and the app only supports English, I want to see en as the value for the $locale property.
This is how the chart looks filtered by iOS:
Actual Result
This is the same chart filtered by Android:

Version
3.71.2
Steps to Reproduce
We have an iOS and Android app that integrates the respective PostHog SDK.
Our app is available in English and German. In our Mobile Analytics dashboard on PostHog (created using the PostHog template) I see a breakdown of the languages. This breakdown contains many more languages (including country specifier such as
ru-RU) than just the two the app runs in.Digging deeper, I realized that the additional languages only come from Android. On iOS it indeed only reports just the language the app runs in, as can be seen in its source:
On Android on the other hand you collect the language the device is set to:
posthog-android/posthog-android/src/main/java/com/posthog/android/internal/PostHogAndroidContext.kt
Line 70 in ba36fc5
Expected Result
On Android it should collect just the language that is also used for resource lookup. If my phone is set to de-CH and the app only supports English, I want to see
enas the value for the$localeproperty.This is how the chart looks filtered by iOS:
Actual Result
This is the same chart filtered by Android: