AI-powered external editor for MemoQ with Ghost Text autocompletion.
MemoQ (Preview SDK) --> Named Pipe --> Sidecar (WPF + WebView2) --> AI (Ollama)
|
v
WinAPI Injection --> MemoQ
- Path:
MemoQPlugin/ - Role: Listens to cursor movement events in MemoQ via Preview SDK
- Output:
MemoQAISidecarPlugin.dll - Installation: Copy to MemoQ plugin folder (usually
%APPDATA%\MemoQ\Addins)
- Path:
SidecarApp/ - Role: Hosts the WebView2 editor, manages Named Pipe communication, handles keyboard injection
- Output:
SidecarApp.exe - Features:
- Transparent/overlay window support
- WinAPI integration for focus switching
- Named Pipe server for receiving segment data
- Path:
Frontend/ - Role: Modern code editor with Ghost Text (inline AI suggestions)
- Technologies: CodeMirror 6, Vanilla JS (ES Modules)
- Features:
- Real-time AI suggestions (debounced)
- Tab to accept, Ctrl+Enter to confirm
- VS Code-inspired dark theme
- .NET 6 SDK (for Sidecar)
- .NET Framework 4.8 SDK (for MemoQ Plugin)
- Node.js 16+ (for Frontend build)
- MemoQ SDK (Download from MemoQ developer portal)
- Ollama (Install from https://ollama.ai)
.\build.ps1cd Frontend
npm install
npm run buildcd SidecarApp
dotnet build -c Release- Copy MemoQ SDK DLLs to
MemoQPlugin/lib/:MemoQ.PreviewInterfaces.dllMemoQ.Addins.Common.dll
- Build:
cd MemoQPlugin
dotnet build -c Release- Locate the built DLL:
MemoQPlugin/bin/Release/net48/MemoQAISidecarPlugin.dll - Copy to:
%APPDATA%\MemoQ\Addins\ - Restart MemoQ
- Enable in: Tools > Options > Preview > AI Sidecar Assistant
# Install Ollama (Windows)
winget install Ollama.Ollama
# Start Ollama server
ollama serve
# Pull a model (in another terminal)
ollama pull llama2cd SidecarApp/bin/Release/net6.0-windows
./SidecarApp.exe- Start Ollama:
ollama serve - Launch Sidecar: Run
SidecarApp.exe - Open MemoQ: Load a translation project
- Activate Preview: Enable "AI Sidecar Assistant" in MemoQ preview settings
- Navigate Segments: Move to a segment in MemoQ
- Edit in Sidecar: Type in the external editor
- Accept AI Suggestions: Press
Tabto accept Ghost Text - Confirm Translation: Press
Ctrl+Enterto inject back to MemoQ
Edit SidecarApp/OllamaClient.cs:
public OllamaClient(string baseUrl = "http://localhost:11434", string model = "llama2")Replace "llama2" with your preferred model (e.g., "mistral", "codellama").
Edit Frontend/style.css to change colors, fonts, or layout.
- Ensure
SidecarApp.exeis running before opening MemoQ - Check Windows Firewall settings for Named Pipe access
- Run
npm run buildin theFrontendfolder - Verify
Frontend/editor.bundle.jsexists - Check
SidecarApp/bin/.../Frontend/contains HTML/CSS/JS files
- Verify Ollama is running:
curl http://localhost:11434/api/tags - Check Sidecar console for
[Ollama] Connection failedmessages - Ensure you've pulled a model:
ollama list
- Verify MemoQ process name is "MemoQ" (case-sensitive)
- Check if MemoQ segment editor allows clipboard paste (Ctrl+V)
- Try running Sidecar as Administrator
- Pipe Name:
MemoQ_Sidecar_Pipe - Direction: Plugin (Client) → Sidecar (Server)
- Format: JSON
Example message:
{
"Type": "SegmentUpdate",
"Source": "Hello world",
"Target": "안녕하세요",
"SourceLang": "en-US",
"TargetLang": "ko-KR"
}SetForegroundWindow(MemoQ)- Focus MemoQSendKeys("^a")- Select all text in segmentSendKeys("{DEL}")- Delete existing textSendKeys("^v")- Paste from clipboardSendKeys("^{ENTER}")- Confirm and move to next segment
- Uses CodeMirror 6's
StateField+Decoration.widget - Rendered as inline, non-editable text
- Cleared on any user input
- Accepted via
Tabkey
- Modify
MainWindow.xaml.csto enable DevTools:
await MainWebView.EnsureCoreWebView2Async(null);
MainWebView.CoreWebView2.OpenDevToolsWindow();- Use browser console:
window.debugEditor.setSource("Test source text");
window.debugEditor.setContent("Test translation");
window.debugEditor.injectGhost(" suggested continuation");Use PowerShell to send test data to Named Pipe:
$pipe = New-Object System.IO.Pipes.NamedPipeClientStream(".", "MemoQ_Sidecar_Pipe", "Out")
$pipe.Connect(1000)
$writer = New-Object System.IO.StreamWriter($pipe)
$json = '{"Type":"SegmentUpdate","Source":"Hello","Target":"","SourceLang":"en","TargetLang":"ko"}'
$writer.WriteLine($json)
$writer.Flush()
$pipe.Close()MIT License - See LICENSE file for details
- MemoQ SDK: Kilgray Translation Technologies
- CodeMirror 6: Marijn Haverbeke
- WebView2: Microsoft
- Ollama: Ollama Team
For issues and feature requests, please create an issue on the GitHub repository.