View Source Cldr.LanguageTag.Sigil (Cldr v2.36.0)
Implements a sigil_l/2
macro to
constructing t:Cldr.LanguageTag
structs.
Link to this section Summary
Functions
Handles sigil ~l
for language tags.
Link to this section Functions
Handles sigil ~l
for language tags.
arguments
Arguments
locale_name
is either a BCP 47 locale name as a string orlocale_name
|backend
where backend is a backend module name
options
Options
u
Will parse the locale but will not add likely subtags and its not guaranteed that this language tag is known to the backend module.
returns
Returns
a
t:Cldr.LanguageTag
struct orraises an exception
examples
Examples
iex> import Cldr.LanguageTag.Sigil
iex> ~l(en-US-u-ca-gregory)
#Cldr.LanguageTag<en-US-u-ca-gregory [validated]>
iex> import Cldr.LanguageTag.Sigil
iex> ~l(en-US-u-ca-gregory|MyApp.Cldr)
#Cldr.LanguageTag<en-US-u-ca-gregory [validated]>