toLocale

fun toLocale(language6391: String): String

Builds a locale identifier (e.g. en_US) from an ISO 639-1 language code and this country's ISO 3166-1 alpha-2 code.

Return

The locale string in language_REGION format.

Parameters

language6391

ISO 639-1 two-letter language code (e.g. "en").

Throws

IllegalArgumentException

if language6391 is not exactly 2 characters long.