File overview
i18n.yml controls locales, file mapping, model profiles, and optional advanced routing. i18n.jsonc is still supported for compatibility.
CLI version pin
Pin the Hyperlocalise CLI version at the top ofi18n.yml, similar to packageManager in package.json:
run, check, status, pack, sync, and others) fail if the running CLI version does not match the pinned value. The hl alias is also accepted (hl@1.12.0).
In GitHub Actions, set hyperlocalise-version: config to install the version declared in your i18n config file.
Starter config
hyperlocalise init.
When groups is omitted, Hyperlocalise automatically uses one implicit default group with:
- all locales from
locales.targets - all bucket names from
buckets
Locales
locales.source: source locale.locales.targets: list of target locales.- optional
locales.fallbacks: fallback order per locale.
Buckets
buckets map source files to target output templates.
Each file mapping uses:
from: source path templateto: target path template- optional
srx: built-in sentence-break template (default,html,markdown) or a project-relative SRX 2.0 file. When set,runsplits string values into sentence spans before translation and joins them back to the original keys on write. JSON and YAML stay unsplit unlesssrxis set. Already-segmented formats (XLIFF, PO, SRT, VTT, xcstrings, stringsdict) and FormatJS/ARB parser modes ignoresrx. ICU, printf, and Fluent{ $var }values stay one unit.hl run --srxoverrides this field for the whole invocation.
{{source}}, {{target}}, and {{localeDir}} in templates. {{localeDir}} resolves to an empty segment when target equals source, and to the target locale otherwise.
PHP array locale mapping patterns
Laravel-style locale arrays can be mapped directly when each file returns one static PHP array.<?php and return a static [...] or array(...) literal. Hyperlocalise translates string leaves, flattens nested keys with dotted paths, and preserves comments, ordering, and array syntax when writing. Dynamic PHP such as variables, function calls, constants, declare(...), or interpolated double-quoted strings is intentionally rejected.
Supported locale file extensions include .json, .jsonc, .yaml, .yml, .php, .xml, .resx, .arb, .xlf, .xlif, .xliff, .po, .html, .liquid, .md, .mdx, .strings, .stringsdict, .csv, .srt, and .vtt.
YAML/YML locale files should be mapping-shaped files with string leaves. Nested mappings become dotted keys, sequences become [index] keys, and writeback rewrites existing string leaves while preserving key order/comments where possible. Mapping keys cannot contain ., [, or ] because those characters are reserved for flattened paths. Non-string scalar leaves such as numbers, booleans, nulls, timestamps, anchors, and aliases are rejected to avoid silently corrupting metadata.
key, id, or name, or nested path-shaped leaves. Android <resources> files, mixed-content XML, and CDATA-preserving writeback are not handled by the generic XML parser.
CSV file mapping patterns
Use bucket file mappings to model CSV workflows. Per-locale files:run can update consistently.
Fluent file mapping patterns
Use.ftl mappings for Mozilla Fluent locale files:
brand.title. Fluent terms are not supported and fail during parsing.
Subtitle file mapping patterns
Use.srt or .vtt mappings for SubRip and WebVTT caption files:
NOTE / STYLE / REGION blocks. Cues use sequential keys such as srt.0001.
JS/TS locale module patterns
Use JavaScript or TypeScript locale module mappings when your app imports locale objects directly:Apple string catalog mapping patterns
Use.xcstrings mappings for Xcode string catalogs:
localizations[targetLocale] and preserves catalog metadata. status and check read the requested target locale from the catalog. Variant and substitution source entries must include a source-language localization so Hyperlocalise can extract the source forms safely.
Android XML string resource mappings
Android XML support is intentionally scoped to string resource files namedstrings.xml under res/values* directories. Use Android locale qualifier names in your target paths:
<string name="..."> and <plurals name="..."><item quantity="...">. Resources marked translatable="false" are preserved and skipped. Unsupported translatable resource shapes such as <string-array> fail closed so they are not silently dropped.
Java properties file mapping patterns
Use.properties mappings for Java resource bundles with one file per locale:
.properties values.
Groups
groups.<name> defines what to process together.
targets: subset oflocales.targetsbuckets: list of bucket names
groups is optional for beginner configs. Add it when you want to split execution by locale or file set.
LLM profiles
llm.profiles.<name> fields:
provider:openai,azure_openai,anthropic,gemini,bedrock,lmstudio,groq,mistral,ollama,openrouter, orai_gatewaymodel: provider model idsystem_prompt(optional): explicit system-message templateuser_prompt(optional): explicit user-message templateprompt(deprecated, optional): legacy prompt template used as system fallback
{{source}}{{target}}{{input}}
Rules
llm.rules choose profile per group.
priority: higher winsgroup: group nameprofile: profile name
llm.rules is optional. When no rule matches a group, Hyperlocalise falls back to llm.profiles.default.
Hyperlocalise
hyperlocalise configures the public Hyperlocalise web API for sync push and sync pull when that block is present.
project_id(required unlessproject_id_envis set): Hyperlocalise project ID.project_id_env(optional): environment variable that contains the project ID.api_base_url(optional): API base URL. Defaults tohttps://hyperlocalise.com/api.api_key_env(optional): environment variable that contains the API key. Defaults toHYPERLOCALISE_API_KEY.timeout_seconds(optional): HTTP timeout for sync API calls. Defaults to1200.
hyperlocalise is set, sync push uploads source files and sync pull downloads translated files reconstructed by the API. Translation jobs are created by Hyperlocalise automation or in the web app, not by the CLI. A hyperlocalise block wins over storage.adapter when both are set.
When hyperlocalise is absent, set storage.adapter so sync push and sync pull use TMS entry sync. That path uses the first bucket files[].to mapping and currently requires one concrete flat JSON locale file. Keep storage for provider-specific file commands as well.
For API keys, sample config, and CI, see Connect the CLI.
Cache
cache configures the remote caching client.
enabled(optional): enable remote caching forrun.endpoint(optional unlessenabled=true): remote cache service endpoint.project_key_env(optional unlessenabled=true): environment variable that contains the project cache key.timeout_seconds(optional): remote cache request timeout in seconds.
Advanced example
Generate a starter
i18n.yml for your project.
Validation tips
- If you omit
groups, every bucket runs for every target locale. - Keep group targets inside
locales.targets. - Keep group buckets aligned with
bucketskeys. - Keep profile names consistent between
profilesandrules. - Use
hyperlocalisewhensync pushandsync pullshould talk to the Hyperlocalise API. That block wins ifstorage.adapteris also set. - Use
storage.adapterwithouthyperlocalisewhensync pushandsync pullshould run TMS entry sync. Keepstoragefor provider-specific file commands as well.

