Skip to content

Commit

Permalink
Localized Reply Topic menu label if unset or set to 'ALL' ↞ [auto-syn…
Browse files Browse the repository at this point in the history
  • Loading branch information
kudo-sync-bot committed Nov 29, 2024
1 parent 5b8e1e3 commit ed8914b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
3 changes: 2 additions & 1 deletion chrome/extension/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
settings.save('infinityMode', false) // ...to always init as false
if (!config.replyLanguage) // init reply language if unset
settings.save('replyLanguage', (await chrome.i18n.getAcceptLanguages())[0])
if (!config.replyTopic) settings.save('replyTopic', 'ALL') // init reply topic if unset
if (!config.replyTopic) // init reply topic if unset
settings.save('replyTopic', chrome.i18n.getMessage('menuLabel_all'))
if (!config.replyInterval) settings.save('replyInterval', 7) // init refresh interval to 7 secs if unset

// Define FEEDBACK functions
Expand Down
4 changes: 3 additions & 1 deletion chrome/extension/popup/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@
+ ' (' + chrome.i18n.getMessage('prompt_orEnter') + ' \'ALL\'):', config.replyTopic)
if (replyTopic != null) { // user didn't cancel
const str_replyTopic = toTitleCase(replyTopic.toString())
settings.save('replyTopic', !replyTopic || re_all.test(str_replyTopic) ? 'ALL' : str_replyTopic)
settings.save('replyTopic',
!replyTopic || re_all.test(str_replyTopic) ? chrome.i18n.getMessage('menuLabel_all')
: str_replyTopic)
siteAlert(`${chrome.i18n.getMessage('alert_replyTopicUpdated')}!`,
`${chrome.i18n.getMessage('appName')} ${chrome.i18n.getMessage('alert_willAnswer')} `
+ ( !replyTopic || re_all.test(str_replyTopic) ?
Expand Down
3 changes: 2 additions & 1 deletion firefox/extension/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
settings.save('infinityMode', false) // ...to always init as false
if (!config.replyLanguage) // init reply language if unset
settings.save('replyLanguage', (await chrome.i18n.getAcceptLanguages())[0])
if (!config.replyTopic) settings.save('replyTopic', 'ALL') // init reply topic if unset
if (!config.replyTopic) // init reply topic if unset
settings.save('replyTopic', chrome.i18n.getMessage('menuLabel_all'))
if (!config.replyInterval) settings.save('replyInterval', 7) // init refresh interval to 7 secs if unset

// Define FEEDBACK functions
Expand Down
4 changes: 3 additions & 1 deletion firefox/extension/popup/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@
+ ' (' + chrome.i18n.getMessage('prompt_orEnter') + ' \'ALL\'):', config.replyTopic)).input
if (replyTopic != null) { // user didn't cancel
const str_replyTopic = replyTopic.toString()
settings.save('replyTopic', !replyTopic || re_all.test(str_replyTopic) ? 'ALL' : str_replyTopic)
settings.save('replyTopic',
!replyTopic || re_all.test(str_replyTopic) ? chrome.i18n.getMessage('menuLabel_all')
: str_replyTopic)
siteAlert(`${chrome.i18n.getMessage('alert_replyTopicUpdated')}!`,
`${chrome.i18n.getMessage('appName')} ${chrome.i18n.getMessage('alert_willAnswer')} `
+ ( !replyTopic || re_all.test(str_replyTopic) ?
Expand Down
11 changes: 6 additions & 5 deletions greasemonkey/chatgpt-infinity.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
// @description:zh-TW 從無所不知的 ChatGPT 生成無窮無盡的答案 (用任何語言!)
// @author Adam Lui
// @namespace https://github.com/adamlui
// @version 2024.11.29.5
// @version 2024.11.29.6
// @license MIT
// @match *://chatgpt.com/*
// @match *://chat.openai.com/*
Expand Down Expand Up @@ -365,7 +365,7 @@
.filter(key => key != 'infinityMode')) // exclude infinityMode...
settings.save('infinityMode', false) // ...to always init as false
if (!config.replyLanguage) settings.save('replyLanguage', env.browser.language) // init reply language if unset
if (!config.replyTopic) settings.save('replyTopic', 'ALL') // init reply topic if unset
if (!config.replyTopic) settings.save('replyTopic', app.msgs.menuLabel_all) // init reply topic if unset
if (!config.replyInterval) settings.save('replyInterval', 7) // init refresh interval to 7 secs if unset

// Define MENU functions
Expand Down Expand Up @@ -423,11 +423,12 @@
}
} else if (key == 'replyTopic') {
const replyTopic = prompt(( app.msgs.prompt_updateReplyTopic )
+ ' (' + ( app.msgs.prompt_orEnter ) + ' \'ALL\'):', config.replyTopic)
+ ' (' + ( app.msgs.prompt_orEnter ) + ' \'ALL\'):', config.replyTopic)
if (replyTopic != null) { // user didn't cancel
const str_replyTopic = toTitleCase(replyTopic.toString())
settings.save('replyTopic', !replyTopic || re_all.test(str_replyTopic) ? 'ALL'
: str_replyTopic)
settings.save('replyTopic',
!replyTopic || re_all.test(str_replyTopic) ? app.msgs.menuLabel_all
: str_replyTopic)
siteAlert(`${app.msgs.alert_replyTopicUpdated}!`,
`${app.msgs.appName} ${app.msgs.alert_willAnswer} `
+ ( !replyTopic || re_all.test(str_replyTopic) ? app.msgs.alert_onAllTopics
Expand Down

0 comments on commit ed8914b

Please sign in to comment.