Parse BCP 47 language tags.
This will attempt to parse the tag as a BCP47 tag. If it fails, it will construct a LanguageTag using custom, with no validation.
import LanguageTag
parseLanguageTag "en-US" |> LanguageTag.toSegments
--> [ "en", "US" ]
parseLanguageTag "completely-invalid-tag" |> LanguageTag.toSegments
--> [ "completely", "invalid", "tag" ]
Parse a BCP47 language tag. Returns
Nothingif the input is not valid.