# `GettextTranslator.Dashboard.PromptTemplates`
[🔗](https://github.com/marmend-company/gettext_translator/blob/main/lib/gettext_translator/dashboard/prompt_templates.ex#L1)

Locale-aware prompt templates for quick LLM translation actions.

Each action (regenerate, short_version, rephrase, synonyms) has a prompt
written in the target language to help the LLM produce more natural output.
Falls back to English for unsupported locales.

# `action`

```elixir
@type action() :: :regenerate | :short_version | :rephrase | :synonyms
```

# `action_label`

```elixir
@spec action_label(action()) :: String.t()
```

Returns a human-readable label for a quick action.

## Examples

    iex> PromptTemplates.action_label(:short_version)
    "Short Version"

# `actions`

```elixir
@spec actions() :: [action()]
```

Returns the list of available quick actions.

## Examples

    iex> PromptTemplates.actions()
    [:regenerate, :short_version, :rephrase, :synonyms]

# `get_prompt`

```elixir
@spec get_prompt(action(), String.t()) :: String.t()
```

Returns the prompt for a given action and language code.

The language code is a POSIX locale (e.g., "uk", "es", "pt_BR").
Falls back to English if the locale is not supported.

## Examples

    iex> PromptTemplates.get_prompt(:rephrase, "uk")
    "Перефразуй переклад іншими словами, збережи той самий зміст але використай інші конструкції"

    iex> PromptTemplates.get_prompt(:regenerate, "pt_BR")
    "Traduza este texto novamente, ofereça uma nova alternativa de tradução"

    iex> PromptTemplates.get_prompt(:short_version, "ja")
    "Make the translation as short as possible while keeping the core meaning"

---

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