File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 148148// @description :zu Yengeza izimpendulo ze-AI ku-DuckDuckGo (inikwa amandla yi-GPT-4o!)
149149// @author KudoAI
150150// @namespace https://kudoai.com
151- // @version 2026.1.27.3
151+ // @version 2026.2.5
152152// @license MIT
153153// @icon https://assets.ddgpt.com/images/icons/app/icon48.png?v=533ce0f
154154// @icon 64 https://assets.ddgpt.com/images/icons/app/icon64.png?v=533ce0f
292292 msgs : await new Promise ( resolve => {
293293 const msgHostDir = `${ app . urls . resourceHost } /greasemonkey/_locales/` ,
294294 msgLocaleDir = `${ env . browser . language ? env . browser . language . replace ( '-' , '_' ) : 'en' } /`
295- let msgHref = `${ msgHostDir + msgLocaleDir } messages.json` , msgXHRtries = 0
295+ let msgHref = `${ msgHostDir + msgLocaleDir } messages.json` , msgFetchesTried = 0
296296 function fetchMsgs ( ) { xhr ( { method : 'GET' , url : msgHref , onload : handleMsgs } ) }
297297 function handleMsgs ( resp ) {
298298 try { // to return localized messages.json
302302 flatMsgs [ key ] = msgs [ key ] . message
303303 resolve ( flatMsgs )
304304 } catch ( err ) { // if bad response
305- msgXHRtries ++ ; if ( msgXHRtries == 3 ) return resolve ( { } ) // try original/region-stripped/EN only
306- msgHref = env . browser . language . includes ( '-' ) && msgXHRtries == 1 ? // if regional lang on 1st try...
305+ msgFetchesTried ++ ; if ( msgFetchesTried == 3 ) return resolve ( { } ) // try original/region-stripped/EN only
306+ msgHref = env . browser . language . includes ( '-' ) && msgFetchesTried == 1 ? // if regional lang on 1st try...
307307 msgHref . replace ( / ( _ l o c a l e s \/ [ ^ _ ] + ) _ [ ^ _ ] + ( \/ ) / , '$1$2' ) // ...strip region before retrying
308308 : `${ msgHostDir } en/messages.json` // else use default English messages
309309 fetchMsgs ( )
You can’t perform that action at this time.
0 commit comments