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
After importing, it prepends a prefix to translated text. You can change the prefix in โ๏ธ settings.
Check 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 exampleFollow STORE_GUIDE.md to submit your module to the QuickTranslate Module Store.