ISO639.to_iso639_1

You're seeing just the function to_iso639_1, go back to ISO639 module for more information.

Specs

to_iso639_1(language_code :: String.t()) :: String.t() | nil

expects as input downcased ISO 639-2 or ISO 639-2/B language code and returns ISO 639-1 code if it exists in standard and nil if not. If function receives as input ISO 639-1 language code, it's returned unchanged.

Examples

iex> ISO639.to_iso639_1("sag")
"sg"

iex> ISO639.to_iso639_1("en")
"en"

iex> ISO639.to_iso639_1("ace")
nil