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-Brave Search (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.bravegpt.com/images/icons/app/icon48.png?v=e8ca7c2
154154// @icon 64 https://assets.bravegpt.com/images/icons/app/icon64.png?v=e8ca7c2
287287 msgs : await new Promise ( resolve => {
288288 const msgHostDir = `${ app . urls . resourceHost } /greasemonkey/_locales/` ,
289289 msgLocaleDir = `${ env . browser . language ? env . browser . language . replace ( '-' , '_' ) : 'en' } /`
290- let msgHref = `${ msgHostDir + msgLocaleDir } messages.json` , msgXHRtries = 0
290+ let msgHref = `${ msgHostDir + msgLocaleDir } messages.json` , msgFetchesTried = 0
291291 function fetchMsgs ( ) { xhr ( { method : 'GET' , url : msgHref , onload : handleMsgs } ) }
292292 function handleMsgs ( resp ) {
293293 try { // to return localized messages.json
297297 flatMsgs [ key ] = msgs [ key ] . message
298298 resolve ( flatMsgs )
299299 } catch ( err ) { // if bad response
300- msgXHRtries ++ ; if ( msgXHRtries == 3 ) return resolve ( { } ) // try original/region-stripped/EN only
301- msgHref = env . browser . language . includes ( '-' ) && msgXHRtries == 1 ? // if regional lang on 1st try...
300+ msgFetchesTried ++ ; if ( msgFetchesTried == 3 ) return resolve ( { } ) // try original/region-stripped/EN only
301+ msgHref = env . browser . language . includes ( '-' ) && msgFetchesTried == 1 ? // if regional lang on 1st try...
302302 msgHref . replace ( / ( _ l o c a l e s \/ [ ^ _ ] + ) _ [ ^ _ ] + ( \/ ) / , '$1$2' ) // ...strip region before retrying
303303 : `${ msgHostDir } en/messages.json` // else use default English messages
304304 fetchMsgs ( )
You can’t perform that action at this time.
0 commit comments