Skip to content

Commit 01cdfc2

Browse files
committed
Fixed Reply Language setting stopped persisting (https://greasyfork.org/scripts/478597-googlegpt/discussions/273838)
1 parent 3a25755 commit 01cdfc2

File tree

4 files changed

+35
-35
lines changed

4 files changed

+35
-35
lines changed

amazongpt/greasemonkey/amazongpt.user.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// @description Adds the magic of AI to Amazon shopping
44
// @author KudoAI
55
// @namespace https://kudoai.com
6-
// @version 2025.1.12.1
6+
// @version 2025.1.12.2
77
// @license MIT
88
// @icon https://amazongpt.kudoai.com/assets/images/icons/amazongpt/black-gold-teal/icon48.png?v=0fddfc7
99
// @icon64 https://amazongpt.kudoai.com/assets/images/icons/amazongpt/black-gold-teal/icon64.png?v=0fddfc7
@@ -385,7 +385,7 @@
385385
}})
386386
Object.assign(config, { minFontSize: 11, maxFontSize: 24, lineHeightRatio: 1.28 })
387387
settings.load([...Object.keys(settings.controls), 'expanded', 'fontSize', 'minimized'])
388-
if (!config.replyLanguage) settings.save('replyLanguage', env.browser.language) // init reply language if unset
388+
if (!config.replyLang) settings.save('replyLang', env.browser.language) // init reply language if unset
389389
if (!config.fontSize) settings.save('fontSize', 14) // init reply font size if unset
390390
if (!env.streamingSupported.byBrowser || !env.streamingSupported.byScriptManager)
391391
settings.save('streamingDisabled', true) // disable Streaming in unspported env
@@ -1005,15 +1005,15 @@
10051005
log.caller = 'modals.replyLang()'
10061006
while (true) {
10071007
let replyLang = prompt(
1008-
( app.msgs.prompt_updateReplyLang ) + ':', config.replyLanguage)
1008+
( app.msgs.prompt_updateReplyLang ) + ':', config.replyLang)
10091009
if (replyLang == null) break // user cancelled so do nothing
10101010
else if (!/\d/.test(replyLang)) {
10111011
replyLang = ( // auto-case for menu/alert aesthetics
10121012
replyLang.length < 4 || replyLang.includes('-') ? replyLang.toUpperCase()
10131013
: replyLang.charAt(0).toUpperCase() + replyLang.slice(1).toLowerCase() )
10141014
log.debug('Saving reply language...')
1015-
settings.save('replyLanguage', replyLang || env.browser.language)
1016-
log.debug(`Success! config.replyLanguage = ${config.replyLanguage}`)
1015+
settings.save('replyLang', replyLang || env.browser.language)
1016+
log.debug(`Success! config.replyLang = ${config.replyLang}`)
10171017
modals.alert(`${app.msgs.alert_langUpdated}!`, // title
10181018
`${app.name} ${app.msgs.alert_willReplyIn} ` // msg
10191019
+ ( replyLang || app.msgs.alert_yourSysLang ) + '.',
@@ -1242,7 +1242,7 @@
12421242
configStatusSpan.style.cssText = 'float: right ; font-size: 11px ; margin-top: 3px ;'
12431243
+ ( !key.includes('about') ? 'text-transform: uppercase !important' : '' )
12441244
if (key.includes('replyLang')) {
1245-
configStatusSpan.textContent = config.replyLanguage
1245+
configStatusSpan.textContent = config.replyLang
12461246
settingItem.onclick = () => modals.open('replyLang')
12471247
} else if (key.includes('scheme')) {
12481248
modals.settings.updateSchemeStatus(configStatusSpan)
@@ -2038,7 +2038,7 @@
20382038
{ code: 'zh-CHS', regex: /^(chi(nese)?|zh|[])/i, rate: 2 }
20392039
]
20402040
const sgtReplyDialect = sgtDialectMap.find(entry =>
2041-
entry.regex.test(config.replyLanguage)) || sgtDialectMap[0]
2041+
entry.regex.test(config.replyLang)) || sgtDialectMap[0]
20422042
const payload = {
20432043
text: wholeAnswer, curTime: Date.now(), spokenDialect: sgtReplyDialect.code,
20442044
rate: sgtReplyDialect.rate.toString()
@@ -2589,7 +2589,7 @@
25892589

25902590
// Define QUERY AUGMENT functions
25912591

2592-
function augmentQuery(query) { return query + ` (reply in ${config.replyLanguage})` }
2592+
function augmentQuery(query) { return query + ` (reply in ${config.replyLang})` }
25932593

25942594
function stripQueryAugments(msgChain) {
25952595
const augmentCnt = augmentQuery.toString().match(/\+/g).length

bravegpt/greasemonkey/bravegpt.user.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
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 2025.1.12.1
151+
// @version 2025.1.12.2
152152
// @license MIT
153153
// @icon https://assets.bravegpt.com/images/icons/bravegpt/icon48.png?v=df624b0
154154
// @icon64 https://assets.bravegpt.com/images/icons/bravegpt/icon64.png?v=df624b0
@@ -562,7 +562,7 @@
562562
}})
563563
Object.assign(config, { minFontSize: 11, maxFontSize: 24, lineHeightRatio: 1.313 })
564564
settings.load([...Object.keys(settings.controls), 'expanded', 'fontSize', 'minimized'])
565-
if (!config.replyLanguage) settings.save('replyLanguage', env.browser.language) // init reply language if unset
565+
if (!config.replyLang) settings.save('replyLang', env.browser.language) // init reply language if unset
566566
if (!config.fontSize) settings.save('fontSize', 16) // init reply font size if unset
567567
if (!env.streamingSupported.byBrowser || !env.streamingSupported.byScriptManager)
568568
settings.save('streamingDisabled', true) // disable Streaming in unspported env
@@ -1179,15 +1179,15 @@
11791179
log.caller = 'modals.replyLang()'
11801180
while (true) {
11811181
let replyLang = prompt(
1182-
( app.msgs.prompt_updateReplyLang ) + ':', config.replyLanguage)
1182+
( app.msgs.prompt_updateReplyLang ) + ':', config.replyLang)
11831183
if (replyLang == null) break // user cancelled so do nothing
11841184
else if (!/\d/.test(replyLang)) {
11851185
replyLang = ( // auto-case for menu/alert aesthetics
11861186
replyLang.length < 4 || replyLang.includes('-') ? replyLang.toUpperCase()
11871187
: replyLang.charAt(0).toUpperCase() + replyLang.slice(1).toLowerCase() )
11881188
log.debug('Saving reply language...')
1189-
settings.save('replyLanguage', replyLang || env.browser.language)
1190-
log.debug(`Success! config.replyLanguage = ${config.replyLanguage}`)
1189+
settings.save('replyLang', replyLang || env.browser.language)
1190+
log.debug(`Success! config.replyLang = ${config.replyLang}`)
11911191
modals.alert(`${app.msgs.alert_langUpdated}!`, // title
11921192
`${app.name} ${app.msgs.alert_willReplyIn} ` // msg
11931193
+ ( replyLang || app.msgs.alert_yourSysLang ) + '.',
@@ -1428,7 +1428,7 @@
14281428
configStatusSpan.style.cssText = 'float: right ; font-size: 11px ; margin-top: 3px ;'
14291429
+ ( !key.includes('about') ? 'text-transform: uppercase !important' : '' )
14301430
if (key.includes('replyLang')) {
1431-
configStatusSpan.textContent = config.replyLanguage
1431+
configStatusSpan.textContent = config.replyLang
14321432
settingItem.onclick = () => modals.open('replyLang')
14331433
} else if (key.includes('scheme')) {
14341434
modals.settings.updateSchemeStatus(configStatusSpan)
@@ -2593,7 +2593,7 @@
25932593
{ code: 'zh-CHS', regex: /^(chi(nese)?|zh|[])/i, rate: 2 }
25942594
]
25952595
const sgtReplyDialect = sgtDialectMap.find(entry =>
2596-
entry.regex.test(config.replyLanguage)) || sgtDialectMap[0]
2596+
entry.regex.test(config.replyLang)) || sgtDialectMap[0]
25972597
const payload = {
25982598
text: wholeAnswer, curTime: Date.now(), spokenDialect: sgtReplyDialect.code,
25992599
rate: sgtReplyDialect.rate.toString()
@@ -3240,7 +3240,7 @@
32403240

32413241
// Define QUERY AUGMENT functions
32423242

3243-
function augmentQuery(query) { return query + ` (reply in ${config.replyLanguage})` }
3243+
function augmentQuery(query) { return query + ` (reply in ${config.replyLang})` }
32443244

32453245
function stripQueryAugments(msgChain) {
32463246
const augmentCnt = augmentQuery.toString().match(/\+/g).length
@@ -3355,7 +3355,7 @@
33553355
+ 'But the key is variety. Do not be repetitive. '
33563356
+ ' You must entice user to want to ask one of your related queries.' ))
33573357

3358-
+ ` Reply in ${config.replyLanguage}`
3358+
+ ` Reply in ${config.replyLang}`
33593359

33603360
// Try diff API after 7s of no response
33613361
const iniAPI = get.related.api

duckduckgpt/greasemonkey/duckduckgpt.user.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
// @description:zu Yengeza izimpendulo ze-AI ku-DuckDuckGo (inikwa amandla yi-GPT-4o!)
149149
// @author KudoAI
150150
// @namespace https://kudoai.com
151-
// @version 2025.1.12.1
151+
// @version 2025.1.12.2
152152
// @license MIT
153153
// @icon https://assets.ddgpt.com/images/icons/duckduckgpt/icon48.png?v=06af076
154154
// @icon64 https://assets.ddgpt.com/images/icons/duckduckgpt/icon64.png?v=06af076
@@ -562,7 +562,7 @@
562562
}})
563563
Object.assign(config, { minFontSize: 11, maxFontSize: 24, lineHeightRatio: 1.28 })
564564
settings.load([...Object.keys(settings.controls), 'expanded', 'fontSize', 'minimized', 'notFirstRun'])
565-
if (!config.replyLanguage) settings.save('replyLanguage', env.browser.language) // init reply language if unset
565+
if (!config.replyLang) settings.save('replyLang', env.browser.language) // init reply language if unset
566566
if (!config.fontSize) settings.save('fontSize', 14) // init reply font size if unset
567567
if (!env.streamingSupported.byBrowser || !env.streamingSupported.byScriptManager)
568568
settings.save('streamingDisabled', true) // disable Streaming in unspported env
@@ -1189,15 +1189,15 @@
11891189
log.caller = 'modals.replyLang()'
11901190
while (true) {
11911191
let replyLang = prompt(
1192-
( app.msgs.prompt_updateReplyLang ) + ':', config.replyLanguage)
1192+
( app.msgs.prompt_updateReplyLang ) + ':', config.replyLang)
11931193
if (replyLang == null) break // user cancelled so do nothing
11941194
else if (!/\d/.test(replyLang)) {
11951195
replyLang = ( // auto-case for menu/alert aesthetics
11961196
replyLang.length < 4 || replyLang.includes('-') ? replyLang.toUpperCase()
11971197
: replyLang.charAt(0).toUpperCase() + replyLang.slice(1).toLowerCase() )
11981198
log.debug('Saving reply language...')
1199-
settings.save('replyLanguage', replyLang || env.browser.language)
1200-
log.debug(`Success! config.replyLanguage = ${config.replyLanguage}`)
1199+
settings.save('replyLang', replyLang || env.browser.language)
1200+
log.debug(`Success! config.replyLang = ${config.replyLang}`)
12011201
modals.alert(`${app.msgs.alert_langUpdated}!`, // title
12021202
`${app.name} ${app.msgs.alert_willReplyIn} ` // msg
12031203
+ ( replyLang || app.msgs.alert_yourSysLang ) + '.',
@@ -1436,7 +1436,7 @@
14361436
configStatusSpan.style.cssText = 'float: right ; font-size: 11px ; margin-top: 3px ;'
14371437
+ ( !key.includes('about') ? 'text-transform: uppercase !important' : '' )
14381438
if (key.includes('replyLang')) {
1439-
configStatusSpan.textContent = config.replyLanguage
1439+
configStatusSpan.textContent = config.replyLang
14401440
settingItem.onclick = () => modals.open('replyLang')
14411441
} else if (key.includes('scheme')) {
14421442
modals.settings.updateSchemeStatus(configStatusSpan)
@@ -2478,7 +2478,7 @@
24782478
{ code: 'zh-CHS', regex: /^(chi(nese)?|zh|[])/i, rate: 2 }
24792479
]
24802480
const sgtReplyDialect = sgtDialectMap.find(entry =>
2481-
entry.regex.test(config.replyLanguage)) || sgtDialectMap[0]
2481+
entry.regex.test(config.replyLang)) || sgtDialectMap[0]
24822482
const payload = {
24832483
text: wholeAnswer, curTime: Date.now(), spokenDialect: sgtReplyDialect.code,
24842484
rate: sgtReplyDialect.rate.toString()
@@ -3126,7 +3126,7 @@
31263126

31273127
// Define QUERY AUGMENT functions
31283128

3129-
function augmentQuery(query) { return query + ` (reply in ${config.replyLanguage})` }
3129+
function augmentQuery(query) { return query + ` (reply in ${config.replyLang})` }
31303130

31313131
function stripQueryAugments(msgChain) {
31323132
const augmentCnt = augmentQuery.toString().match(/\+/g).length
@@ -3239,7 +3239,7 @@
32393239
+ 'But the key is variety. Do not be repetitive. '
32403240
+ ' You must entice user to want to ask one of your related queries.' ))
32413241

3242-
+ ` Reply in ${config.replyLanguage}`
3242+
+ ` Reply in ${config.replyLang}`
32433243

32443244
// Try diff API after 7s of no response
32453245
const iniAPI = get.related.api

googlegpt/greasemonkey/googlegpt.user.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
// @description:zu Yengeza izimpendulo ze-AI ku-Google Search (inikwa amandla yi-Google Gemma + GPT-4o!)
150150
// @author KudoAI
151151
// @namespace https://kudoai.com
152-
// @version 2025.1.12.1
152+
// @version 2025.1.12.2
153153
// @license MIT
154154
// @icon https://assets.googlegpt.io/images/icons/googlegpt/black/icon48.png?v=59409b2
155155
// @icon64 https://assets.googlegpt.io/images/icons/googlegpt/black/icon64.png?v=59409b2
@@ -750,7 +750,7 @@
750750
}})
751751
Object.assign(config, { minFontSize: 11, maxFontSize: 24, lineHeightRatio: env.browser.isMobile ? 1.357 : 1.375 })
752752
settings.load([...Object.keys(settings.controls), 'expanded', 'fontSize', 'minimized', 'notFirstRun'])
753-
if (!config.replyLanguage) settings.save('replyLanguage', env.browser.language) // init reply language if unset
753+
if (!config.replyLang) settings.save('replyLang', env.browser.language) // init reply language if unset
754754
if (!config.fontSize) settings.save('fontSize', env.browser.isMobile ? 14 : 16.55) // init reply font size if unset
755755
if (!env.streamingSupported.byBrowser || !env.streamingSupported.byScriptManager)
756756
settings.save('streamingDisabled', true) // disable Streaming in unspported env
@@ -1372,15 +1372,15 @@
13721372
log.caller = 'modals.replyLang()'
13731373
while (true) {
13741374
let replyLang = prompt(
1375-
( app.msgs.prompt_updateReplyLang ) + ':', config.replyLanguage)
1375+
( app.msgs.prompt_updateReplyLang ) + ':', config.replyLang)
13761376
if (replyLang == null) break // user cancelled so do nothing
13771377
else if (!/\d/.test(replyLang)) {
13781378
replyLang = ( // auto-case for menu/alert aesthetics
13791379
replyLang.length < 4 || replyLang.includes('-') ? replyLang.toUpperCase()
13801380
: replyLang.charAt(0).toUpperCase() + replyLang.slice(1).toLowerCase() )
13811381
log.debug('Saving reply language...')
1382-
settings.save('replyLanguage', replyLang || env.browser.language)
1383-
log.debug(`Success! config.replyLanguage = ${config.replyLanguage}`)
1382+
settings.save('replyLang', replyLang || env.browser.language)
1383+
log.debug(`Success! config.replyLang = ${config.replyLang}`)
13841384
modals.alert(`${app.msgs.alert_langUpdated}!`, // title
13851385
`${app.name} ${app.msgs.alert_willReplyIn} ` // msg
13861386
+ ( replyLang || app.msgs.alert_yourSysLang ) + '.',
@@ -1618,7 +1618,7 @@
16181618
configStatusSpan.style.cssText = 'float: right ; font-size: 11px ; margin-top: '
16191619
+ ( key.includes('about') ? '5px' : '3px ; text-transform: uppercase !important')
16201620
if (key.includes('replyLang')) {
1621-
configStatusSpan.textContent = config.replyLanguage
1621+
configStatusSpan.textContent = config.replyLang
16221622
settingItem.onclick = () => modals.open('replyLang')
16231623
} else if (key.includes('scheme')) {
16241624
modals.settings.updateSchemeStatus(configStatusSpan)
@@ -2804,7 +2804,7 @@
28042804
{ code: 'zh-CHS', regex: /^(chi(nese)?|zh|[])/i, rate: 2 }
28052805
]
28062806
const sgtReplyDialect = sgtDialectMap.find(entry =>
2807-
entry.regex.test(config.replyLanguage)) || sgtDialectMap[0]
2807+
entry.regex.test(config.replyLang)) || sgtDialectMap[0]
28082808
const payload = {
28092809
text: wholeAnswer, curTime: Date.now(), spokenDialect: sgtReplyDialect.code,
28102810
rate: sgtReplyDialect.rate.toString()
@@ -3461,7 +3461,7 @@
34613461

34623462
// Define QUERY AUGMENT functions
34633463

3464-
function augmentQuery(query) { return query + ` (reply in ${config.replyLanguage})` }
3464+
function augmentQuery(query) { return query + ` (reply in ${config.replyLang})` }
34653465

34663466
function stripQueryAugments(msgChain) {
34673467
const augmentCnt = augmentQuery.toString().match(/\+/g).length
@@ -3576,7 +3576,7 @@
35763576
+ 'But the key is variety. Do not be repetitive. '
35773577
+ ' You must entice user to want to ask one of your related queries.' ))
35783578

3579-
+ ` Reply in ${config.replyLanguage}`
3579+
+ ` Reply in ${config.replyLang}`
35803580

35813581
// Try diff API after 7s of no response
35823582
const iniAPI = get.related.api

0 commit comments

Comments
 (0)