# `Flicker.Messages`
[🔗](https://github.com/team-alembic/flicker/blob/v0.1.0/lib/flicker/messages.ex#L1)

The behaviour every user-facing Flicker string routes through (ADR-009).

Every visible string and every screen-reader announcement the select
component renders comes from `message/2` — never an inline literal in a
template. `Flicker.Messages.English` is the complete default
implementation and doubles as the canonical list of every message key.

## Overriding

A host can override messages globally:

    config :flicker, messages: MyAppWeb.FlickerMessages

or per-component, via the `messages` attr on `Flicker.select/1`. An
override module needs only implement the keys it wants to change —
delegate the rest to `Flicker.Messages.English`:

    defmodule MyAppWeb.FlickerMessages do
      @behaviour Flicker.Messages

      @impl true
      def message(:search_placeholder, _bindings), do: "Rechercher..."
      def message(key, bindings), do: Flicker.Messages.English.message(key, bindings)
    end

Message keys are public API once shipped — renaming one is a breaking
change.

# `bindings`

```elixir
@type bindings() :: map()
```

Named values interpolated into a message (e.g. `%{count: 5}`).

# `key`

```elixir
@type key() :: atom()
```

A message key. See `Flicker.Messages.English` for the full list.

# `message`

```elixir
@callback message(key(), bindings()) :: String.t()
```

Returns the user-facing string for `key`, interpolating `bindings`.

# `get`

```elixir
@spec get(module() | nil, key(), bindings()) :: String.t()
```

Looks up `key` through the resolved messages module, falling back to
`Flicker.Messages.English` if the resolved module doesn't implement that
key — so a partial override module can never crash a render.

# `resolve`

```elixir
@spec resolve(module() | nil) :: module()
```

Resolves the effective messages module for a component instance.

Precedence: the per-component `messages` attr override, then
`config :flicker, :messages`, then `Flicker.Messages.English`.

---

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