Skip to content

Commit 017e9d7

Browse files
Patch76claude
andauthored
feat: add the Polish (pl) locale across all four translated surfaces (#2171)
* feat: add the Polish (pl) locale across all four translated surfaces Polish is the largest untranslated language by Home Assistant installation base after Dutch. HA collects no language statistic, so the ranking is derived from country installations in the public analytics snapshot; pl lands at roughly 16k estimated installations, ahead of sv at roughly 14k. The two authored catalogs carry the 15 keys the ungated checks demand and nothing else: the eleven Decision and PredicateOp words, the condition editor's UI-only `policies.operators.exists_long`, the `policies.pending.already_decided` host sentence those words interpolate into, `accessibility.storage_blocked` as the settings surface's reader-addressing anchor, and `common.oauth_not_serving` as the component surface's. Both add-on YAML flavors are generator output. The remaining 736 strings are the post-merge sync's work, which is why the gated completeness checks fail for pl exactly as they do for nl. The operator words avoid the backend literals rather than transliterating them, so `in` reads "jest jednym z" rather than "w" — a value that still spells the operator counts as untranslated. Register is measured rather than assumed. Counting second-person markers across every string in the Home Assistant frontend wheel 20260729.5 gives 219 informal hits and zero `Pan`/`Pani`/`Państwa` for Polish, against a German control that had to come out informal and did (1301 to 14). Polish Home Assistant addresses its reader with the ty-form, so the anchors do too, and the engine imitates that register for every string it fills. Because these anchors set the tone the engine copies into 736 further strings, the Polish was cross-read by two independent models before committing. Two findings were adopted, both terminology rather than grammar: `accessibility.storage_blocked` said "pamięć tej witryny", which names browser memory rather than site storage, and used "wybory", which reads as elections; it now says "przechowywanie danych witryny" and "wybrane opcje". `common.oauth_not_serving` translated the product name and now keeps "Legacy OAuth", matching de, nl and it. Findings against the capitalised negation in `neq` and `not_in`, and against the repetition in `already_decided`, were declined: de, es, fr, it and nl all capitalise the negation, and all four filled catalogs keep the decision participle on the same root as its `actions.approve` verb (Genehmigen/genehmigt, Aprobar/aprobada), which is what produces that repetition. Renaming the participle would have split the button and the status word onto different roots once the sync fills `actions.approve`. * fix: decline the product name in the Polish restart sentence Polish inflects the object of an imperative, and Home Assistant's own Polish inflects its product name where the case demands it. Both places its shipped Polish catalogue tells the reader to restart read the object in the accusative: `ui.panel.config.hardware.restart_homeassistant` is "Uruchom ponownie Home Assistanta" and the integrations restart dialog is "Zrestartuj Home Assistanta". There is no nominative counterpart in that position. Across the same catalogue bundle the declined form appears 45 times overall, so this is the house style rather than one translator's habit. The anchor said "uruchom ponownie Home Assistant", leaving the object in the nominative, which reads as untranslated boilerplate. Since this string is one of the register samples the sync shows the engine, the nominative would have propagated as a pattern rather than staying one string. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 22ede66 commit 017e9d7

5 files changed

Lines changed: 446 additions & 1 deletion

File tree

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ identity holds by construction.
755755

756756
A language ships on all four surfaces or not at all —
757757
`tests/src/unit/test_locale_parity.py` enforces it. One Home Assistant language
758-
code (`de`, `es`, `fr`, `it`, `nl`, `ru`, `zh-Hans`) names every file:
758+
code (`de`, `es`, `fr`, `it`, `nl`, `pl`, `ru`, `zh-Hans`) names every file:
759759
`src/ha_mcp/settings_ui/locales/<code>.json`,
760760
`custom_components/ha_mcp_tools/translations/<code>.json`, and
761761
`homeassistant-addon{,-dev}/translations/<code>.yaml`.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"common": {
3+
"oauth_not_serving": "Legacy OAuth jeszcze ich nie udostępnia — uruchom ponownie Home Assistanta, gdy pojawi się taka prośba, aby je aktywować."
4+
}
5+
}
Lines changed: 258 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,258 @@
1+
---
2+
# GENERATED FILE — do not edit. Translations live in
3+
# src/ha_mcp/settings_ui/locales/pl.json (keys addon.*, features.*,
4+
# addon_dev.*); regenerate with: python scripts/generate_locales.py
5+
configuration:
6+
backup_hint:
7+
name: Full-HA snapshot suggestion level (LLM-facing)
8+
description: 'Tunes the wording of the hint the LLM sees in the
9+
10+
`ha_manage_backup(scope=''snapshot'')` tool description for when to
11+
12+
suggest a full Home Assistant tarball backup before risky operations
13+
14+
(e.g. mass device deletes). Affects ONLY this one LLM-facing prompt
15+
16+
sentence.
17+
18+
19+
For per-edit automatic snapshots of automations / scripts / helpers /
20+
21+
etc., use the separate **Enable auto-backup of edits** toggle below.'
22+
secret_path:
23+
name: Secret path override
24+
description: 'Optional custom HTTP path for the MCP server. Leave empty to use
25+
the auto-generated secure path.
26+
27+
'
28+
enable_tool_search:
29+
name: Enable tool search
30+
description: 'Replace the full tool catalog with search-based discovery. Reduces
31+
idle context by roughly 90%, to about 5K tokens. ⚠️ Do NOT enable this in clients
32+
with their own built-in tool search / deferred tools (claude.ai, Claude Desktop,
33+
Claude Code) — the two search layers conflict, and the client''s built-in tool
34+
search is the better choice there; leave this off. Whether tools are deferred
35+
depends on your client and model combination: use this when your setup loads
36+
the full catalog up front — models without native deferred tools (e.g. Gemini,
37+
OpenAI-compatible local models, Claude Haiku), clients that inline all tool
38+
schemas regardless of model (e.g. GitHub Copilot CLI), or smaller context windows.
39+
Some Codex models and ChatGPT include deferred tools too — check your client/model
40+
directly to confirm its features so you don''t leave this enabled unnecessarily.
41+
Tools are found via ha_search_tools and executed via categorized proxies (read/write/delete).
42+
Requires restart to take effect.'
43+
enable_tool_security_policies:
44+
name: Enable Tool Security Policies (advanced)
45+
description: Gate high-stakes tool calls (lock/alarm control, automation writes,
46+
etc.) behind user approval. When a guarded tool is called, the agent tells the
47+
user to open the Tool Security Policies tab in the web UI and click Approve
48+
before the call proceeds. Per-tool rules with optional argument conditions are
49+
configured in the Tool Security Policies tab. Off by default. Requires restart
50+
to take effect.
51+
enable_security_policy_tool:
52+
name: Let AI agents edit tool security policies
53+
description: 'Registers the ha_manage_security_policy tool, which lets connected
54+
AI agents read and rewrite the tool security policies — including removing approval
55+
gates. Off by default. Independent of the Tool Security Policies option above:
56+
this controls who can edit the rules, not whether they are enforced. The tool
57+
cannot see or decide pending approvals. To keep a human in the loop, gate the
58+
tool before enabling it: switch on "security gated" for Manage Security Policy
59+
in the Tools tab of the web UI. Requires restart to take effect.'
60+
read_only_mode:
61+
name: Read Only Mode
62+
description: Toggles all write tools off, and removes ability for tools to make
63+
any write or destructive calls. Mixed read/write tools (backups, add-ons, energy
64+
preferences, voice pipelines, and code mode when enabled) stay available with
65+
their write operations blocked. Same toggle as the web UI Tools tab. Off by
66+
default. Requires restart to take effect.
67+
redact_secrets:
68+
name: Redact Secrets
69+
description: Redacts secrets from tool responses before they reach the AI assistant.
70+
Add-on options and integration fields marked as passwords are replaced with
71+
a set/empty marker (so "is this credential configured?" stays answerable), and
72+
other tool responses are scrubbed of secret values the server has already seen
73+
(values shorter than 6 characters are skipped, since replacing tiny fragments
74+
would corrupt unrelated output). Fields not marked as passwords by their schema
75+
cannot be detected. Off by default.
76+
enable_beta_features:
77+
name: Enable beta features (master)
78+
description: ⚠ DANGER — these tools can PERMANENTLY DAMAGE your Home Assistant
79+
installation. They write to your YAML config, your filesystem, install custom
80+
components, run arbitrary sandboxed Python, and edit tool docstrings the AI
81+
sees. There is no warranty and no support guarantee — you enable them at your
82+
OWN RISK. Take a Home Assistant backup before turning this on, and never enable
83+
in production without one. Master gate for the 5 experimental sub-flags below;
84+
sub-flags are ignored at runtime while this master is off, even when explicitly
85+
set to true. The same toggle is also surfaced in the web settings UI under "Beta
86+
features (dangerous)" — either surface reflects the other on restart.
87+
enable_yaml_config_editing:
88+
name: Enable YAML config editing (beta)
89+
description: Beta feature. Allows AI assistants to add, replace, or remove top-level
90+
keys in configuration.yaml and packages/*.yaml. Only whitelisted keys are allowed
91+
(e.g., template, sensor, command_line, mqtt, knx); core keys like homeassistant,
92+
http, and recorder are blocked. Each edit validates YAML syntax, runs a config
93+
check, and creates an automatic backup. Changes to most keys require a full
94+
HA restart to take effect. See docs/beta.md for known limitations. Dedicated
95+
tools (automations, scripts, scenes, helpers, template sensors) should be preferred
96+
when available. REQUIRES the master "Enable beta features" toggle above (and
97+
in the web UI) to be on — otherwise this sub-flag is ignored at runtime regardless
98+
of its value here.
99+
enable_yaml_packages_automation:
100+
name: Allow automation in packages/*.yaml
101+
description: Sub-toggle of YAML config editing. When on, ha_config_set_yaml accepts
102+
yaml_path='automation' inside packages/*.yaml. When off, the call is rejected
103+
both client-side and server-side. The storage-mode tool (ha_config_set_automation)
104+
is unaffected. Default OFF; only takes effect when "Enable YAML config editing"
105+
above is also on.
106+
enable_yaml_packages_script:
107+
name: Allow script in packages/*.yaml
108+
description: Sub-toggle of YAML config editing. When on, ha_config_set_yaml accepts
109+
yaml_path='script' inside packages/*.yaml. When off, the call is rejected both
110+
client-side and server-side. The storage-mode tool (ha_config_set_script) is
111+
unaffected. Default OFF; only takes effect when "Enable YAML config editing"
112+
above is also on.
113+
enable_yaml_packages_scene:
114+
name: Allow scene in packages/*.yaml
115+
description: Sub-toggle of YAML config editing. When on, ha_config_set_yaml accepts
116+
yaml_path='scene' inside packages/*.yaml. When off, the call is rejected both
117+
client-side and server-side. The storage-mode tool (ha_config_set_scene) is
118+
unaffected. Default OFF; only takes effect when "Enable YAML config editing"
119+
above is also on.
120+
enable_yaml_edit_confirm:
121+
name: Require confirmation for YAML edits (diff preview)
122+
description: 'Sub-toggle of YAML config editing, ON by default (recommended).
123+
The first ha_config_set_yaml call returns a unified diff of exactly what would
124+
change on disk plus a confirm token and writes nothing; the edit only lands
125+
when the call is repeated with that token. Exists so unintended changes outside
126+
the requested edit are caught before they reach disk (issue #1720). Turn off
127+
only to save one round-trip per edit.'
128+
enable_code_mode:
129+
name: Enable custom tool sandbox (beta)
130+
description: Beta feature. Enables the ha_manage_custom_tool tool, which lets
131+
AI assistants create, run, save, and delete custom Python code in a secure sandbox
132+
when no built-in tool can handle the request. Code runs in an isolated interpreter
133+
with no filesystem or arbitrary network access. Sandbox code can hit the HA
134+
REST API (api_get/api_post), send WebSocket commands (ws_send), call existing
135+
MCP tools (call_tool), or remove a saved tool (delete_saved_tool). Saved tools
136+
persist to /data/saved_tools.json by default so they survive add-on restarts,
137+
and are visible to any client that can connect. See docs/beta.md for known limitations.
138+
Requires restart to take effect. REQUIRES the master "Enable beta features"
139+
toggle above (and in the web UI) to be on — otherwise this sub-flag is ignored
140+
at runtime regardless of its value here.
141+
enable_lite_docstrings:
142+
name: Enable lite tool docstrings (beta)
143+
description: 'Beta feature. Replaces the docstrings on a handful of heavy ha-mcp
144+
tools (automations, scripts, scenes, helpers, dashboards, ha_call_service, ha_config_set_yaml)
145+
with shorter variants that defer schema and example detail to the ha_get_skill_guide
146+
tool (or its skill:// resource). WARNING: this reduces idle token usage, but
147+
may degrade LLM performance — the trimmed descriptions rely on the LLM actually
148+
calling the skill tool or reading the skill resource for detail, which is not
149+
guaranteed (some models will skip the extra tool call and end up with less guidance
150+
than they had before). Best paired with a client that supports MCP resources
151+
or with enable_tool_search. Requires restart to take effect. REQUIRES the master
152+
"Enable beta features" toggle above (and in the web UI) to be on — otherwise
153+
this sub-flag is ignored at runtime regardless of its value here.'
154+
enable_mandatory_bps:
155+
name: Attach best-practice skills on writes
156+
description: 'Master switch for the write-tool skill content delivery feature
157+
(issue #1182). When enabled (default), the six config write tools (automations,
158+
scripts, scenes, helpers, dashboards, raw YAML) attach the canonical Home Assistant
159+
best-practice reference files under `skill_content` on every successful write,
160+
plus auto-embed any reference sections cited by best-practice warnings. Each
161+
tool also exposes a per-call `MandatoryBPS` parameter the agent can set to false
162+
on subsequent calls once it has the content. When this master switch is off,
163+
NO skill_content goes out regardless of the per-call parameter or BP warnings.
164+
Recommended ON as the first choice; disable only for models with very small
165+
context windows. Turning this off may degrade write accuracy. Requires restart
166+
to take effect.'
167+
enable_strict_mandatory_bps:
168+
name: Strict best-practices mode
169+
description: 'Strict mode: prevents the client from using the tool until it can
170+
prove that it read the best practices. While on, the six best-practice write
171+
tools (automations, scripts, scenes, helpers, dashboards, raw YAML) are blocked
172+
and return an error directing the client to read the best-practices skill via
173+
ha_get_skill_guide and pass back the acknowledgment key it obtains there. While
174+
on, the ha_get_skill_guide tool is locked enabled — it is the only publisher
175+
of the acknowledgment key. Child of the "Attach best-practice skills on writes"
176+
option above and inert while that parent is off. Requires restart to take effect.'
177+
enable_filesystem_tools:
178+
name: Enable filesystem tools (beta)
179+
description: 'Sets HAMCP_ENABLE_FILESYSTEM_TOOLS=true. Enables direct file read/write
180+
access to your Home Assistant filesystem. WARNING: This gives the MCP server
181+
sensitive direct file access to your system. Only enable if you trust the AI
182+
assistant with file operations. Requires restart to take effect. REQUIRES the
183+
master "Enable beta features" toggle above (and in the web UI) to be on — otherwise
184+
this sub-flag is ignored at runtime regardless of its value here.'
185+
enable_dashboard_screenshot:
186+
name: Enable dashboard screenshot mode (beta)
187+
description: Beta feature — disabled by default. Adds the ha_get_dashboard_screenshot
188+
tool plus include_screenshot / return_screenshot options on the dashboard get/set
189+
tools, so AI assistants can inspect one or more responsive Lovelace images (e.g.
190+
to verify a dashboard they just created). Supports stable named views, mobile/tablet/desktop
191+
batches, and PNG/JPEG/WebP/BMP output. Rendering runs in a separate, opt-in
192+
engine — balloob's "Puppet" add-on (headless Chromium) — which you install once
193+
(add balloob's add-on repository, then install "Puppet") and give a long-lived
194+
access token; on Docker/Container deployments you run that engine as a sidecar
195+
and set HAMCP_DASHBOARD_SCREENSHOT_ENGINE_URL. Nothing heavy is installed unless
196+
you both enable this and install the engine. Requires restart to take effect.
197+
REQUIRES the master "Enable beta features" toggle above (and in the web UI)
198+
to be on — otherwise this sub-flag is ignored at runtime regardless of its value
199+
here.
200+
enable_auto_backup:
201+
name: Enable auto-backup of edits
202+
description: Captures a per-entity snapshot before every wrapped write/destructive
203+
MCP tool call (automation, script, scene, helper, dashboard, label, category,
204+
group, zone, area, calendar, todo, entity, integration, and sibling remove/delete
205+
tools). Snapshots are saved as YAML files under /data/ha_mcp_backups/ (override
206+
via HAMCP_BACKUP_DIR) and listed, restored, or deleted via the Backups tab in
207+
the web settings UI or via ha_manage_backup(scope='edits', ...). Best-effort
208+
— failures log a WARNING but never block the underlying write. On by default;
209+
uncheck to opt out. Requires restart to take effect.
210+
auto_backup_throttle_minutes:
211+
name: Auto-backup throttle (minutes)
212+
description: Per-entity throttle window. 0 (default) captures a snapshot on every
213+
wrapped write. N>0 captures at most one snapshot per N minutes per entity. Range
214+
0–1440.
215+
auto_backup_retain_per_entity:
216+
name: Auto-backup retention (per entity)
217+
description: Maximum number of snapshots kept per entity. Older snapshots beyond
218+
this cap are rotated out on each successful capture. Default 100, range 1–10000.
219+
enable_snapshot_delete:
220+
name: Allow snapshot deletion
221+
description: Lets ha_manage_backup delete full HA snapshot tarballs (scope='snapshot',
222+
action='delete'). Off by default — a snapshot may be the last recovery point
223+
after a mistaken change, so a human must opt in here. Even when on, scheduled
224+
backups, the newest remaining snapshot, and anything younger than the age floor
225+
below stay protected.
226+
snapshot_delete_min_age_days:
227+
name: Minimum snapshot age to delete (days)
228+
description: A snapshot must be at least this old before it can be deleted. Range
229+
0–365; 0 disables the floor (the newest-snapshot and scheduled-backup protections
230+
still apply). Default 7.
231+
tool_search_max_results:
232+
name: Tool search max results
233+
description: 'Maximum number of tools returned by ha_search_tools when tool search
234+
is enabled. Lower values (2-3) save context tokens but may miss relevant tools.
235+
Range: 2-10. Requires restart.'
236+
disabled_tools:
237+
name: Disabled tools (comma-separated)
238+
description: Tools listed here are forced off and locked in the web Settings UI
239+
(Tools tab) — they cannot be re-enabled there without unsetting this option
240+
first. A small set of mandatory tools (ha_search, ha_get_overview, ha_get_state,
241+
ha_report_issue, ha_manage_backup) cannot be disabled and keep running even
242+
if listed here. ha_get_skill_guide can be disabled only while strict best-practices
243+
mode (enable_strict_mandatory_bps) is off. Comma-separated tool names (e.g.
244+
ha_call_event,ha_eval_template).
245+
pinned_tools:
246+
name: Pinned tools (comma-separated)
247+
description: Tools listed here are locked pinned — they appear at the top of the
248+
Tools tab and cannot be unpinned from the web Settings UI without unsetting
249+
this option first. Useful in combination with Tool Search. Comma-separated tool
250+
names.
251+
verify_ssl:
252+
name: Verify TLS certificate
253+
description: Verify the Home Assistant server's TLS certificate. The add-on connects
254+
via the Supervisor proxy, so this normally has no effect and should stay enabled.
255+
Disable only if you've reconfigured the add-on to talk to HA over a public HTTPS
256+
hostname with a self-signed certificate or hostname mismatch. Disabling weakens
257+
transport security — leave on unless you know you need it. Requires restart
258+
to take effect.

0 commit comments

Comments
 (0)