Localize.LanguageTag.Sigil (Localize v0.38.0)

Copy Markdown View Source

Implements a sigil_l/2 macro for constructing t:Localize.LanguageTag structs.

Summary

Functions

Handles sigil ~l for language tags.

Functions

sigil_l(locale_id, arg2)

(macro)

Handles sigil ~l for language tags.

Arguments

  • locale_id is a BCP 47 locale identifier as a string.

Options

  • u Will parse the locale but will not add likely subtags or resolve the CLDR locale identifier.

Returns

Examples

iex> import Localize.LanguageTag.Sigil
iex> tag = ~l(en-US-u-ca-gregory)
iex> tag.language
:en

iex> import Localize.LanguageTag.Sigil
iex> tag = ~l(en)u
iex> tag.requested_locale_id
"en"