[android-components](../../index.md) / [mozilla.components.support.locale](../index.md) / [kotlin.String](index.md) / [toLocale](./to-locale.md)

# toLocale

`fun `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`.toLocale(): `[`Locale`](https://developer.android.com/reference/java/util/Locale.html) [(source)](https://github.com/mozilla-mobile/android-components/blob/master/components/support/locale/src/main/java/mozilla/components/support/locale/Extensions.kt#L9)