Skip to content

Fix exact translation key lookups to prevent writes to the wrong unit - #17

Open
RDMurray wants to merge 2 commits into
mmntm:mainfrom
soundscape-community:fix/exact-translation-key
Open

RDMurray wants to merge 2 commits into
mmntm:mainfrom
soundscape-community:fix/exact-translation-key

Conversation

@RDMurray

@RDMurray RDMurray commented Oct 7, 2026

Copy link
Copy Markdown

Looking up voice.settings.enhanced_available could return voice.settings.enhanced_available.title first. Because writes used the first search result, updating the body could overwrite the title.

Use Weblate’s exact context operator and verify the returned key before selecting a unit. Ambiguous or incomplete single-unit lookups fail before writing. findTranslationsForKey also matches exactly, as its tool description promises; callers relying on its previous broad results will see fewer matches.

Includes a patch changeset and updated API documentation. All ten regression tests and the build pass; nine tests fail against the old implementation. A read-only Hosted Weblate check confirmed that the old query returns title, body, and button, while the exact query returns only the body.

@changeset-bot

changeset-bot Bot commented Oct 7, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4e4ed98

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@mmntm/weblate-mcp Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant