Update
This commit is contained in:
@@ -93,7 +93,7 @@ async function handleGenerate({ text, lang, tone, angle }, tabId) {
|
||||
}
|
||||
|
||||
// ===== GỌI API DỊCH =====
|
||||
async function handleTranslate({ text, target_lang }, tabId) {
|
||||
async function handleTranslate({ text, target_lang, target_model }, tabId) {
|
||||
const cfg = await chrome.storage.local.get(['apiUrl','apiKey','translateUrl','translateKey']);
|
||||
const url = cfg.translateUrl || cfg.apiUrl;
|
||||
const key = cfg.translateKey || cfg.apiKey;
|
||||
|
||||
@@ -320,11 +320,12 @@
|
||||
<label>Văn bản cần dịch</label>
|
||||
<textarea id="trans-input" style="font-size:18px" placeholder="Nhập hoặc bôi đen rồi chuột phải..."></textarea>
|
||||
|
||||
<label>Ngôn ngữ đích</label>
|
||||
<select id="trans-target">${LANGS.map(l => `<option value="${l.value}" ${l.value === 'ja' ?'selected': ''}>${l.label}</option>`).join('')}</select>
|
||||
<label>Model</label>
|
||||
<select id="trans-model">${ModelAI.map(l => `<option value="${l.value}" ${l.value === 'openai' ?'selected': ''}>${l.label}</option>`).join('')}</select>
|
||||
|
||||
<div>
|
||||
<label>Ngôn ngữ đích</label>
|
||||
<select id="trans-target">${LANGS.map(l => `<option value="${l.value}" ${l.value === 'ja' ?'selected': ''}>${l.label}</option>`).join('')}</select>
|
||||
<label>Model</label>
|
||||
<select id="trans-model">${ModelAI.map(l => `<option value="${l.value}" ${l.value === 'openai' ?'selected': ''}>${l.label}</option>`).join('')}</select>
|
||||
</div>
|
||||
|
||||
<button class="primary" id="trans-run">🌐 Dịch</button>
|
||||
<div class="status" id="trans-status"></div>
|
||||
|
||||
Reference in New Issue
Block a user