Development documentation may include features that are not in the latest release. Read the Lawn 0.8.1 guide.
Localization
Localized strings
Lawn separates structure from presentation. The YAML template defines behavior — variable sources, input types, health check commands, notice element types. A companion JSON file provides all user-facing strings — display names, descriptions, option labels, and notice titles.
This separation keeps YAML diffs clean, makes translations straightforward, and lets the UI layer own how strings are displayed.
File Location
Each template includes a locales/en.json file:
my-app/
├── manifest.yaml
├── locales/
│ └── en.json
└── lawn-compose/
└── compose.yaml
JSON Structure
The JSON has two top-level keys: config for top-level config variables and services for per-service strings.
{
"config": {
"POSTGRES_PASSWORD": {
"displayName": "Database Password",
"description": "PostgreSQL password. Auto-generated during install."
},
"ADMIN_PASSWORD": {
"displayName": "Admin Password",
"description": "Password for the initial admin account."
}
},
"services": {
"app": {
"environment": {
"POSTGRES_HOST": {
"description": "Hostname of the PostgreSQL database server.",
"group": "Database"
},
"TZ": {
"description": "Timezone for the application (e.g. America/New_York)."
}
},
"healthChecks": {
"web-ui": {
"description": "Web UI is accessible and responding."
}
},
"notices": {
"login-credentials": {
"title": "Login Credentials",
"elements": {
"username": { "label": "Username" },
"password": { "label": "Password" },
"setup-note": { "content": "Change these in **Settings > Security** after your first login." }
}
}
}
}
}
}
Config variables
Each config variable key maps to an object with:
| Field | Description |
|---|---|
displayName | Human-readable name shown in the UI (e.g., "Database Password") |
description | Short explanation of what the variable controls |
options | Localized labels keyed by option value: { "label": "..." } |
Config option labels
Variables with selectable options need a label for each option value. The keys must match the option keys in the YAML:
{
"config": {
"DIFFICULTY": {
"displayName": "Difficulty",
"description": "Controls how challenging the game is.",
"options": {
"peaceful": { "label": "Peaceful" },
"easy": { "label": "Easy" },
"normal": { "label": "Normal" },
"hard": { "label": "Hard" }
}
}
}
}
Boolean config variables must have exactly two option labels, keyed "true" and "false":
{
"config": {
"PVP": {
"displayName": "PvP",
"description": "Allow players to deal damage to each other.",
"options": {
"true": { "label": "On" },
"false": { "label": "Off" }
}
}
}
}
Services
Each service key maps to an object with optional environment, healthChecks, and notices sections.
Environment variables:
| Field | Description |
|---|---|
description | Explanation of what the variable controls |
group | Display group for organizing variables into sections (e.g., "Database", "OCR") |
Health checks — keyed by the health check id from the YAML:
| Field | Description |
|---|---|
description | Explanation of what the health check verifies |
Notices — keyed by the notice id from the YAML:
| Field | Description |
|---|---|
title | Heading displayed in the notice banner |
elements | Strings keyed by element id |
Notice elements use label for field and variableAction types, and content (Markdown) for text types. Both static fields and fields with a source use type: field.
For a notice action, put the button label under its element ID:
{
"services": {
"app": {
"notices": {
"open-signups": {
"title": "Signups are open",
"elements": {
"disable-signups": { "label": "Disable signups" }
}
}
}
}
}
}
What Lives Where
| Data | YAML | JSON |
|---|---|---|
Config variable source, length, value, inputType, weight, options | yes | — |
Config variable displayName, description | — | yes |
Config option label | — | yes |
Env variable format | yes | — |
Env variable description, group | — | yes |
Health check id, type, path, timing | yes | — |
Health check description | — | yes |
Notice id, style, visibleWhen | yes | — |
Notice title | — | yes |
Notice element id, type, value, source, container, separator, position, variable | yes | — |
Notice element content (text), label (field/variableAction) | — | yes |
Validation
Review localization alongside the YAML. Each localizable structure needs a matching JSON entry, and JSON keys must refer to existing structures. Check for:
- Missing
displayNameordescriptionfor config variables - Missing
labelfor config options - Missing
descriptionfor environment variables and health checks - Missing
titlefor notices and missinglabel/contentfor notice elements - Dangling JSON keys that don't match any YAML structure
- Boolean config variables without exactly 2 option labels
Open the template in a local catalog test instance and inspect its settings, option labels, health check descriptions, and notices. Confirm that each string appears where expected.
lawn template validate is planned and is not available in the current release.