Skip to content

Add MCP tool for pseudolocalizing assets via the pseudo endpoint - #1098

Open
ehoogerbeets wants to merge 1 commit into
mcp-10-asset-localizefrom
mcp-11-asset-pseudo
Open

ehoogerbeets wants to merge 1 commit into
mcp-10-asset-localizefrom
mcp-11-asset-pseudo

Conversation

@ehoogerbeets

Copy link
Copy Markdown
Contributor

Transferred from ehoogerbeets#21 onto box/mojito (rebased onto master).

Stack note: this PR targets mcp-10-asset-localize — merge bottom-up.

What pseudo is

In Mojito, pseudolocalizing an asset means taking one source resource file and generating an accented copy so missing translations and layout issues show up before real locales exist. The CLI writes that file under the synthetic tag en-x-pseudo. This is not applying TM translations (mojito_asset_localize / mojito pull).

What this adds

One MCP tool:

  • mojito_asset_pseudo — generate one pseudolocalized resource file for an existing assetId

Together with import and localize, an agent can replace mojito push, mojito pull, and mojito pseudo for the per-file generate steps (the agent still owns scanning and writing files).

What the underlying API does

POST /api/assets/{assetId}/pseudo is the synchronous call mojito pseudo uses (AssetClient.getPseudoLocalizedAssetForContent). The JSON body is a LocalizedAssetBody:

  • required assetId and source content
  • no localeId (synthetic locale, not a repository translation locale)
  • outputBcp47tag defaults to en-x-pseudo to match the Java client
  • optional filterConfigIdOverride / filterOptions
  • optional substituteType — RANDOM (server/CLI default) or CONSISTENT (CLI --substitute)

When writing the returned content, use path tag en-x-pseudo. The generate pipeline uses en-x-psaccent internally; that is not the filename tag.

Scope: this is not mojito pseudo

The CLI command scans a source directory and writes each generated file. This tool is only the per-asset generate underneath that.

Also not exposed: async/parallel localize, importing already-localized files, XLIFF export.

Test plan

  • cd mojito-mcp && yarn test
  • cd mojito-mcp && yarn build

Made with Cursor

Made with Cursor

This is the `mojito pseudo` generate call, so an agent can produce en-x-pseudo files without the CLI walking the tree.

Co-authored-by: Cursor <cursoragent@cursor.com>

This branch has not been deployed

No deployments
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