# `Localize.Collation.Tailoring.LocaleDefaults`
[🔗](https://github.com/elixir-localize/localize/blob/v0.39.0/lib/localize/collation/tailoring/locale_defaults.ex#L1)

Preset collation option defaults for common locales.

Maps BCP47 language tags to their standard collation option overrides
as defined by CLDR. These defaults are applied before any explicit
BCP47 `-u-` extension keys.

# `default_type`

```elixir
@spec default_type(String.t()) :: atom()
```

Get the default collation type for a locale.

### Arguments

* `locale` - a BCP47 locale string.

### Returns

The default collation type atom for the locale, or `:standard`.

### Examples

    iex> Localize.Collation.Tailoring.LocaleDefaults.default_type("de")
    :standard

    iex> Localize.Collation.Tailoring.LocaleDefaults.default_type("es")
    :standard

# `extract_language`

```elixir
@spec extract_language(String.t()) :: String.t()
```

Extract the language subtag from a BCP47 locale string.

### Arguments

* `locale` - a BCP47 locale string.

### Returns

The lowercase language subtag string.

### Examples

    iex> Localize.Collation.Tailoring.LocaleDefaults.extract_language("de-AT-u-co-phonebk")
    "de"

    iex> Localize.Collation.Tailoring.LocaleDefaults.extract_language("sv")
    "sv"

# `options_for`

```elixir
@spec options_for(String.t()) :: keyword()
```

Get option overrides for a locale.

### Arguments

* `locale` - a BCP47 locale string (e.g., `"da"`, `"de-AT"`, `"sv-SE"`).

### Returns

A keyword list of option overrides, or an empty list if no defaults exist.

### Examples

    iex> Localize.Collation.Tailoring.LocaleDefaults.options_for("da")
    [case_first: :upper]

    iex> Localize.Collation.Tailoring.LocaleDefaults.options_for("en")
    []

---

*Consult [api-reference.md](api-reference.md) for complete listing*
