Summary
QuickLauncher now supports text transforms — local find-and-replace operations that run directly on the active target segment without calling an AI provider. This opens the door to a lightweight scripting layer inside Supervertaler for Trados.
What's implemented (v4.18.27)
- New prompt type:
type: transform — set this in the YAML frontmatter to mark a prompt as a text transform instead of an AI prompt
- Find/replace rules in the content body — simple
find: / replace: pairs with \uXXXX Unicode escape support and # comments
- Built-in "Strip U+2028" transform — removes invisible Unicode LINE SEPARATOR (U+2028) and PARAGRAPH SEPARATOR (U+2029) characters from the target segment; seeded automatically in
QuickLauncher/Text operations/
- Executed via
ProcessSegmentPair — changes are committed through the Trados document model, preserving all formatting tags (bold, italic, etc.)
- Double-space collapsing — consecutive spaces left after replacements are collapsed to a single space
- Clipboard copy — the cleaned target text is automatically copied to the clipboard after a transform runs
- MessageBox feedback — shows how many replacements were applied (or "No matches found")
- Works with keyboard slots — transforms can be assigned to Ctrl+Alt+1–0 shortcuts like any other QuickLauncher prompt
Content body format
# Comments start with #
# Each rule is a find:/replace: pair. Use \uXXXX for Unicode escapes.
find: "\u2028"
replace: " "
find: "\u2029"
replace: " "
Future directions
Short term
Medium term
Long term
Architecture
Text transforms reuse the existing QuickLauncher infrastructure:
PromptTemplate.IsTransform — computed from type: transform in YAML frontmatter
PromptTemplate.Replacements — List<TextReplacement> parsed from the content body by PromptLibrary.ParseTransformContent()
QuickLauncherAction and QuickLauncherSlotRunner detect transforms and call AiAssistantViewPart.RunTextTransform() instead of sending to the AI
RunTextTransform() uses IStudioDocument.ProcessSegmentPair() to modify IText nodes in-place, preserving inline formatting tags
Related
- U+2028/U+2029 stripping in AI input (v4.18.26) — strips these characters before sending to AI providers
- Batch size spinner (v4.18.26) — exposed the BatchSize setting in AI Settings
Summary
QuickLauncher now supports text transforms — local find-and-replace operations that run directly on the active target segment without calling an AI provider. This opens the door to a lightweight scripting layer inside Supervertaler for Trados.
What's implemented (v4.18.27)
type: transform— set this in the YAML frontmatter to mark a prompt as a text transform instead of an AI promptfind:/replace:pairs with\uXXXXUnicode escape support and#commentsQuickLauncher/Text operations/ProcessSegmentPair— changes are committed through the Trados document model, preserving all formatting tags (bold, italic, etc.)Content body format
Future directions
Short term
regex:instead offind:)if:/else:)normalize_spaces: true,trim: true)Medium term
{{TARGET_SEGMENT}},{{SOURCE_SEGMENT}})Long term
Architecture
Text transforms reuse the existing QuickLauncher infrastructure:
PromptTemplate.IsTransform— computed fromtype: transformin YAML frontmatterPromptTemplate.Replacements—List<TextReplacement>parsed from the content body byPromptLibrary.ParseTransformContent()QuickLauncherActionandQuickLauncherSlotRunnerdetect transforms and callAiAssistantViewPart.RunTextTransform()instead of sending to the AIRunTextTransform()usesIStudioDocument.ProcessSegmentPair()to modify IText nodes in-place, preserving inline formatting tagsRelated