Skip to content

v2.1.2 — Timestamp isolation + set-translation-group MCP tool

Choose a tag to compare

@BrunosCode BrunosCode released this 30 Apr 10:43
· 23 commits to main since this release

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 of subkey → {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 touches translation_keys.updated_at and translation_values.updated_at for rows whose value has not changed.

    Before this fix, writing a single translation through any MCP tool refreshed updated_at on every existing row in the table. Cause: TranslationHandlerService::set() reads the full existing collection, merges the input, then passes the entire merged collection to put() — and handleUpdate upserted every row in the input with updated_at = now(). The handler now:

    • skips translation_keys rows unless they are soft-deleted (and need reviving)
    • skips translation_values rows whose value and deleted_at are unchanged

Tests

  • SetTranslationDbTimestampTest — regression covering single-write timestamp isolation through set-translation-tool and set-all-locales-translation-tool against the DB format
  • SetTranslationGroupToolTest — 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)