# `PhoenixKitCatalogue.Catalogue.Translations`
[🔗](https://github.com/BeamLabEU/phoenix_kit_catalogue/blob/0.1.14/lib/phoenix_kit_catalogue/catalogue/translations.ex#L1)

Multilang `data` JSONB helpers — read merged language data from a
record and write language-specific overrides through the entity's own
update function.

Public surface is re-exported from `PhoenixKitCatalogue.Catalogue`.

# `get_translation`

```elixir
@spec get_translation(map(), String.t()) :: map()
```

Gets translated field data for a record in a specific language.
Returns merged data (primary language as base + overrides for the
requested language).

# `set_translation`

```elixir
@spec set_translation(map(), String.t(), map(), function(), keyword()) ::
  {:ok, term()} | {:error, term()}
```

Updates the multilang `data` field for a record with language-specific
field data. For primary language: stores ALL fields. For secondary
languages: stores only overrides (differences from primary).

`update_fn` is the entity's update function. It receives `(record, attrs)`
for 2-arity or `(record, attrs, opts)` for 3-arity when activity-logging
opts are provided.

---

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