# LocaleManagerCompat

# LocaleManagerCompat

Artifact:[androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core)  
[View Source](https://cs.android.com/search?q=file:androidx/core/app/LocaleManagerCompat.java+class:androidx.core.app.LocaleManagerCompat)  
Added in[1.9.0](https://developer.android.com/jetpack/androidx/releases/core#1.9.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/core/app/LocaleManagerCompat "View this page in Java")

<br />

```
class LocaleManagerCompat
```

<br />

*** ** * ** ***

Helper for accessing features in[android.app.LocaleManager](https://developer.android.com/reference/android/app/LocaleManager.html)in a backwards compatible fashion.

## Summary

|                                                ### Public functions                                                |
|--------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `java-static `[LocaleListCompat](https://developer.android.com/reference/kotlin/androidx/core/os/LocaleListCompat) | `@`[AnyThread](https://developer.android.com/reference/kotlin/androidx/annotation/AnyThread) [getApplicationLocales](https://developer.android.com/reference/kotlin/androidx/core/app/LocaleManagerCompat#getApplicationLocales(android.content.Context))`(context: `[Context](https://developer.android.com/reference/android/content/Context.html)`)` Returns application locales for the calling app as a[LocaleListCompat](https://developer.android.com/reference/kotlin/androidx/core/os/LocaleListCompat). |
| `java-static `[LocaleListCompat](https://developer.android.com/reference/kotlin/androidx/core/os/LocaleListCompat) | `@`[AnyThread](https://developer.android.com/reference/kotlin/androidx/annotation/AnyThread) [getSystemLocales](https://developer.android.com/reference/kotlin/androidx/core/app/LocaleManagerCompat#getSystemLocales(android.content.Context))`(context: `[Context](https://developer.android.com/reference/android/content/Context.html)`)` Returns the current system locales, ignoring app-specific overrides.                                                                                                |

## Public functions

### getApplicationLocales

Added in[1.11.0](https://developer.android.com/jetpack/androidx/releases/core#1.11.0)  

```
@AnyThread
java-static fun getApplicationLocales(context: Context): LocaleListCompat
```

Returns application locales for the calling app as a[LocaleListCompat](https://developer.android.com/reference/kotlin/androidx/core/os/LocaleListCompat). This API for non-[androidx.appcompat.app.AppCompatDelegate](https://developer.android.com/reference/kotlin/androidx/appcompat/app/AppCompatDelegate)context to easily get the per-app locale on the prior API 33 devices.

Returns a[getEmptyLocaleList](https://developer.android.com/reference/kotlin/androidx/core/os/LocaleListCompat#getEmptyLocaleList())if no app-specific locales are set.  

### getSystemLocales

Added in[1.9.0](https://developer.android.com/jetpack/androidx/releases/core#1.9.0)  

```
@AnyThread
java-static fun getSystemLocales(context: Context): LocaleListCompat
```

Returns the current system locales, ignoring app-specific overrides.

**Note:** Apps should generally access the user's locale preferences as indicated in their in-process[android.os.LocaleList](https://developer.android.com/reference/android/os/LocaleList.html)s. However, in case an app-specific locale is set, this method helps cater to rare use-cases which might require specifically knowing the system locale.