amplitude / Amplitude-Android

Native Android SDK for Amplitude
MIT License
164 stars 90 forks source link

fixed detecting device language #319

Closed AlexKorRnd closed 2 years ago

AlexKorRnd commented 2 years ago

In case of changing the app language programmatically it also needs to call Locale.setDefault() because Locale.getDefault() is used in many android SDK places. So it's better to use Resources.getSystem().getConfiguration().getLocales() to detect the device language.

ampl-jenkins commented 2 years ago

Can one of the admins verify this patch?

justin-fiedler commented 2 years ago

Hi @AlexKorRnd thank you for the PR. Changes look good but when running test locally I get an error in DeviceInfo.testGetCountry. Are you able to run the tests locally and address the issue?

image
AlexKorRnd commented 2 years ago

@justin-fiedler take a look the new commit 645c76d