> ## 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 Java .properties files with Hyperlocalise

> Translate Java resource bundles with escaped values and comment context.

Java .properties files store keyed resource strings for Java applications. Use this guide to translate resource values and understand escaping and writeback behavior.

Supported extensions: `.properties`.

## Source file

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

```properties theme={null}
# Home screen
home.title=Welcome
home.greeting=Hello, {name}!
```

## 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.properties
              to: locales/{{target}}/messages.properties

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

* Supports `=`, `:`, or unescaped whitespace separators, escaped characters, Unicode escapes, and continued lines.

* Leading comments provide context. Writeback preserves keys, ordering, comments, separators, and spacing.

* Translated values become single-line escaped strings. New keys are appended in sorted order.

* Duplicate keys, malformed Unicode escapes, invalid UTF-8, and dangling continuations are rejected.

## 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

* [YAML localization](/cli/reference/formats/yaml)
* [gettext PO](/cli/reference/formats/gettext)
* [.NET RESX resource](/cli/reference/formats/resx)
