Skip to content

Commit

Permalink
using the current lang when translating if no lang is set. see #53. t…
Browse files Browse the repository at this point in the history
…o be improved in #6
  • Loading branch information
micz committed Jul 14, 2024
1 parent 81ae49b commit bca4640
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion js/mzta-menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,12 @@ export class mzta_Menus {

switch(curr_prompt.id){
case 'prompt_translate_this':
fullPrompt = curr_prompt.text + chatgpt_lang + ". \"" + body_text + "\" ";
let prefs2 = await browser.storage.sync.get({default_chatgpt_lang: getLanguageDisplayName(browser.i18n.getUILanguage())});
let chatgpt_lang2 = prefs2.default_chatgpt_lang;
if(chatgpt_lang2 === ''){
chatgpt_lang2 = getLanguageDisplayName(browser.i18n.getUILanguage());
}
fullPrompt = curr_prompt.text + chatgpt_lang2 + ". \"" + body_text + "\" ";
break;
case 'prompt_reply':
fullPrompt += "Do not add the subject line to the response."
Expand Down

0 comments on commit bca4640

Please sign in to comment.