|
148 | 148 | // @description:zu Yengeza izimpendulo ze-AI ku-DuckDuckGo (inikwa amandla yi-GPT-4o!) |
149 | 149 | // @author KudoAI |
150 | 150 | // @namespace https://kudoai.com |
151 | | -// @version 2025.9.14 |
| 151 | +// @version 2025.9.15 |
152 | 152 | // @license MIT |
153 | 153 | // @icon https://assets.ddgpt.com/images/icons/app/icon48.png?v=533ce0f |
154 | 154 | // @icon64 https://assets.ddgpt.com/images/icons/app/icon64.png?v=533ce0f |
|
2239 | 2239 | }, |
2240 | 2240 |
|
2241 | 2241 | replyLang() { // requires <app|config|env|log|modals|settings> |
2242 | | - while (true) { |
2243 | | - let replyLang = prompt(`${app.msgs.prompt_updateReplyLang}:`, config.replyLang) |
2244 | | - if (replyLang == null) break // user cancelled so do nothing |
2245 | | - else if (!/\d/.test(replyLang)) { |
2246 | | - replyLang = ( // auto-case for menu/alert aesthetics |
2247 | | - replyLang.length < 4 || replyLang.includes('-') ? replyLang.toUpperCase() |
2248 | | - : log.toTitleCase(replyLang) ) |
2249 | | - settings.save('replyLang', replyLang || env.browser.language) |
2250 | | - modals.alert(`${app.msgs.alert_langUpdated}!`, // title |
2251 | | - `${app.name} ${ // msg |
2252 | | - app.msgs.alert_willReplyIn} ${ replyLang || app.msgs.alert_yourSysLang }.`, |
2253 | | - '', '', 330) // modal width |
2254 | | - if (modals.settings.get()) // update settings menu status label |
2255 | | - document.querySelector('#replyLang-settings-entry span').textContent = replyLang |
2256 | | - break |
2257 | | - } |
| 2242 | + let replyLang = prompt(`${app.msgs.prompt_updateReplyLang}:`, config.replyLang) |
| 2243 | + if (replyLang == null) return // user cancelled so do nothing |
| 2244 | + else if (!/\d/.test(replyLang)) { |
| 2245 | + replyLang = ( // auto-case for menu/alert aesthetics |
| 2246 | + replyLang.length < 4 || replyLang.includes('-') ? replyLang.toUpperCase() |
| 2247 | + : log.toTitleCase(replyLang) ) |
| 2248 | + settings.save('replyLang', replyLang || env.browser.language) |
| 2249 | + modals.alert(`${app.msgs.alert_langUpdated}!`, // title |
| 2250 | + `${app.name} ${ // msg |
| 2251 | + app.msgs.alert_willReplyIn} ${ replyLang || app.msgs.alert_yourSysLang }.`, |
| 2252 | + '', '', 330) // modal width |
| 2253 | + if (modals.settings.get()) // update settings menu status label |
| 2254 | + document.querySelector('#replyLang-settings-entry span').textContent = replyLang |
2258 | 2255 | } |
2259 | 2256 | }, |
2260 | 2257 |
|
|
0 commit comments