Skip to contents

Parsing

Decompose a BCP 47 language tag into its constituent subtags.

bcp_parse()
Parse a BCP 47 language tag

Validation & Normalization

Check and canonicalize language tags against the IANA Language Subtag Registry.

bcp_validate()
Validate a BCP 47 language tag
bcp_normalize()
Normalize a BCP 47 language tag

Language Matching

Find the best available language for a set of user preferences (RFC 4647 Lookup).

bcp_match_language()
Match a BCP 47 language preference to available languages

Registry

Download and parse the IANA Language Subtag Registry.

bcp_process_registry()
Process the IANA BCP 47 subtag registry

Cache Management

Manage the local copy of the IANA registry to avoid repeated downloads.