v2.1.2 — Timestamp isolation + set-translation-group MCP tool
Added
-
set-translation-group-tool— new MCP tool that translates an entire group in a single call. The AI provides a group prefix and an object ofsubkey → {locale: value}; the tool joins each subkey to the group with the configured key delimiter and writes all locale values for every subkey in one operation. Tolerates a trailing delimiter on the group (auth.≡auth) and supports nested subkeys (nested.deep). Brings the total MCP tool count to 8.Example request:
{ "format": "db", "group": "auth", "translations": { "welcome": {"en": "Welcome", "it": "Benvenuto"}, "logout": {"en": "Logout", "it": "Esci"} }, "force": true }
Fixed
-
DatabaseHandler::handleUpdate()no longer touchestranslation_keys.updated_atandtranslation_values.updated_atfor rows whose value has not changed.Before this fix, writing a single translation through any MCP tool refreshed
updated_aton every existing row in the table. Cause:TranslationHandlerService::set()reads the full existing collection, merges the input, then passes the entire merged collection toput()— andhandleUpdateupserted every row in the input withupdated_at = now(). The handler now:- skips
translation_keysrows unless they are soft-deleted (and need reviving) - skips
translation_valuesrows whosevalueanddeleted_atare unchanged
- skips
Tests
SetTranslationDbTimestampTest— regression covering single-write timestamp isolation throughset-translation-toolandset-all-locales-translation-toolagainst the DB formatSetTranslationGroupToolTest— 10 cases covering write semantics, force flag, trailing delimiter, nested subkeys, and error paths
Compatibility
- No breaking changes
- File-based handlers (PHP/JSON/CSV) are unaffected by the timestamp fix (they always rewrite the whole file)