๋ชจ๋“ˆ ์ƒ์„ฑ ํŠœํ† ๋ฆฌ์–ผ

3๋‹จ๊ณ„๋กœ ๋ชจ๋“ˆ ๊ฐœ๋ฐœํ•˜๊ธฐ


1๋‹จ๊ณ„: CLI๋กœ ์ƒ์„ฑ

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


2๋‹จ๊ณ„: ์ฝ”๋“œ ํŽธ์ง‘

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
}

3๋‹จ๊ณ„: QuickTranslate์— ๊ฐ€์ ธ์˜ค๊ธฐ

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:

FieldTypeDescription
idstringLowercase alphanumeric with hyphens: engine-mymod
namestringUse English name
versionstringx.y.z format
typestringtranslator / mode / renderer / processor / service / theme

๋ฒˆ์—ญ์ด ์ž‘๋™ํ•˜์ง€ ์•Š์Œ

  • Ensure module toggle is ON
  • Check onActivate subscribes to translate:text
  • Check target filter: if (req.target && req.target !== 'engine-xxx') return
  • Check API endpoint accessibility and API Key
  • ์„ค์ •์ด ์ €์žฅ๋˜์ง€ ์•Š์Œ

  • options field key must match the key used in translate()
  • Config is stored at moduleSettings.{moduleId}

  • ์ฐธ๊ณ  ์˜ˆ์ œ

  • echo-translator.qt-module โ€” Minimal translator with options
  • modules/translator-google.js โ€” Built-in Google Translate module
  • modules/translator-custom.js โ€” Custom LLM module
  • modules/mode-quick-panel.js โ€” Interaction mode example

  • ๊ฒŒ์‹œ

    Follow STORE_GUIDE.md to submit your module to the QuickTranslate Module Store.