ExLang.ISO639 (ExLang v2.0.0)

Convenience functions for matching ISO639 language codes. Based on the data found at https://datahub.io/core/language-codes#readme, retrieved on 27/2/2025.

Summary

Types

code_type()

@type code_type() :: :iso6393 | :iso6392B | :iso6392T | :iso6391

match()

@type match() :: %{
  code: String.t(),
  label: String.t(),
  type: code_type(),
  alts: %{required(code_type()) => String.t() | nil}
}

Functions

alignment(iso6391)

@spec alignment(String.t()) :: :ltr | :rtl | nil

label(code)

@spec label(String.t()) :: String.t() | nil

lookup(code)

@spec lookup(String.t()) :: match() | nil