> ## Documentation Index
> Fetch the complete documentation index at: https://hyperlocalise.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Translate Liquid template files with Hyperlocalise

> Translate hardcoded Liquid template text while preserving dynamic expressions.

Liquid templates combine visible text with expressions and control-flow tags. Hyperlocalise translates hardcoded text while protecting supported template syntax. Translate locale files separately for messages referenced by translation keys.

Supported extensions: `.liquid`.

## Source file

Save this example as `locales/en-US/messages.liquid`.

```liquid theme={null}
<h1>Welcome, {{ customer.first_name }}!</h1>
<p>Open your account to view your orders.</p>
{{ 'header.title' | t }}
```

## Configure your files

Use this `i18n.yml` for the example, or add its file mapping to your existing bucket.
See [path templates](/cli/configuration/path-templates) for other layouts.

```yaml theme={null}
locales:
    source: en-US
    targets:
        - es-ES

buckets:
    messages:
        files:
            - from: locales/en-US/messages.liquid
              to: locales/{{target}}/messages.liquid

llm:
    profiles:
        default:
            provider: openai
            model: gpt-5.2
```

## Translate

[Install the CLI](/cli/getting-started/install) and set `OPENAI_API_KEY` in your
project's `.env.local` or shell. You can also configure another
[AI provider](/cli/providers/overview).

```bash theme={null}
hyperlocalise run --dry-run
hyperlocalise run
```

The dry run previews the work. The second command writes translations to the
configured target path and updates the lockfile.

## Behavior and limitations

* Translates hardcoded visible template text and protects Liquid output expressions.

* Locale-key calls such as the `t` filter remain template structure. Translate their backing locale files separately.

* `raw`, `comment`, `schema`, `javascript`, and `stylesheet` blocks are preserved verbatim.

* Standalone Liquid tags form segment boundaries. Template syntax is restored after translation.

## Next steps

* [Check translations](/cli/commands/check) before committing generated files.
* [Local translation workflow](/cli/workflows/local-generation) explains repeat runs.
* [Browse all file formats](/cli/reference/formats/overview).

## Related formats

* [HTML](/cli/reference/formats/html)
* [JSON localization](/cli/reference/formats/json)
