ゼロから動作するモジュールまで3ステップ。
node packages/create-qt-module/index.js
対話型プロンプト:
🧩 QuickTranslate Module Scaffold
Select module type:
1. Translation Engine
2. Interaction Mode
...
Number (1-6): 1
Module name: Echo Translator
Author: myname
Short description: Demo module for testing
出力: translator-echo-translator.qt-module
Open the generated .qt-module file, find translate() and implement your logic:
// Before
async translate(text, from, to) {
throw new Error('translate() not implemented')
}
// After — DeepL API example
async translate(text, from, to) {
const resp = await fetch('https://api.deepl.com/v2/translate', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'DeepL-Auth-Key ' + apiKey
},
body: JSON.stringify({
text: [text],
source_lang: from.toUpperCase(),
target_lang: to.toUpperCase()
})
})
const data = await resp.json()
return data.translations[0].text
}
1. Open QuickTranslate → click 🧩 Modules
2. Click 📥 Import Module
3. Select your .qt-module file
4. Confirm → Module appears in the list, toggle ON
既存のデモモジュールを使用:
echo-translator.qt-module
インポート後、翻訳テキストにプレフィックスを追加します。 ⚙️ 設定でプレフィックスを変更できます。
確認 manifest is complete:
| Field | Type | Description |
id | string | Lowercase alphanumeric with hyphens: engine-mymod |
name | string | Use English name |
version | string | x.y.z format |
type | string | translator / mode / renderer / processor / service / theme |
onActivate subscribes to translate:texttarget filter: if (req.target && req.target !== 'engine-xxx') returnoptions field key must match the key used in translate()moduleSettings.{moduleId}echo-translator.qt-module — Minimal translator with optionsmodules/translator-google.js — Built-in Google Translate modulemodules/translator-custom.js — Custom LLM modulemodules/mode-quick-panel.js — Interaction mode example参照 STORE_GUIDE.md to submit your module to the QuickTranslate Module Store.