Skip to content

Commit 1024ea6

Browse files
committed
Replaced (await chrome.i18n.getAcceptLanguages())[0] w/ shorter chrome.i18n.getUILanguage()
1 parent 7664470 commit 1024ea6

File tree

8 files changed

+11
-11
lines changed

8 files changed

+11
-11
lines changed

chatgpt-auto-continue/chromium/extension/popup/controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
const env = {
99
site: /([^.]+)\.[^.]+$/.exec(new URL((await chrome.tabs.query(
1010
{ active: true, currentWindow: true }))[0].url).hostname)?.[1],
11-
browser: { displaysEnglish: (await chrome.i18n.getAcceptLanguages())[0].startsWith('en') }
11+
browser: { displaysEnglish: chrome.i18n.getUILanguage().startsWith('en') }
1212
}
1313

1414
// Import DATA

chatgpt-auto-continue/firefox/extension/popup/controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
const env = {
99
site: /([^.]+)\.[^.]+$/.exec(new URL((await chrome.tabs.query(
1010
{ active: true, currentWindow: true }))[0].url).hostname)?.[1],
11-
browser: { displaysEnglish: (await chrome.i18n.getAcceptLanguages())[0].startsWith('en') }
11+
browser: { displaysEnglish: chrome.i18n.getUILanguage().startsWith('en') }
1212
}
1313

1414
// Import DATA

chatgpt-infinity/chromium/extension/content.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
.filter(key => key != 'infinityMode')) // exclude infinityMode...
4141
settings.save('infinityMode', false) // ...to always init as false
4242
if (!config.replyLanguage) // init reply language if unset
43-
settings.save('replyLanguage', (await chrome.i18n.getAcceptLanguages())[0])
43+
settings.save('replyLanguage', chrome.i18n.getUILanguage())
4444
if (!config.replyTopic) // init reply topic if unset
4545
settings.save('replyTopic', getMsg('menuLabel_all'))
4646
if (!config.replyInterval) settings.save('replyInterval', 7) // init refresh interval to 7 secs if unset

chatgpt-infinity/chromium/extension/popup/controller.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
const env = {
99
site: /([^.]+)\.[^.]+$/.exec(new URL((await chrome.tabs.query(
1010
{ active: true, currentWindow: true }))[0].url).hostname)?.[1],
11-
browser: { displaysEnglish: (await chrome.i18n.getAcceptLanguages())[0].startsWith('en') }
11+
browser: { displaysEnglish: chrome.i18n.getUILanguage().startsWith('en') }
1212
}
1313

1414
// Import APP data
@@ -107,7 +107,7 @@
107107
}
108108

109109
// Add listener
110-
entry.div.onclick = async () => {
110+
entry.div.onclick = () => {
111111
if (controlType == 'toggle') {
112112
entry.leftElem.classList.toggle('on')
113113
settings.save(key, !config[key]) ; sync.configToUI({ updatedKey: key })
@@ -122,7 +122,7 @@
122122
replyLang = ( // auto-case for menu/alert aesthetics
123123
replyLang.length < 4 || replyLang.includes('-') ? replyLang.toUpperCase()
124124
: replyLang.charAt(0).toUpperCase() + replyLang.slice(1).toLowerCase() )
125-
settings.save('replyLanguage', replyLang || (await chrome.i18n.getAcceptLanguages())[0])
125+
settings.save('replyLanguage', replyLang || chrome.i18n.getUILanguage())
126126
siteAlert(getMsg('alert_replyLangUpdated') + '!',
127127
`${getMsg('appName')} ${getMsg('alert_willReplyIn')} `
128128
+ `${ replyLang || getMsg('alert_yourSysLang') }.`

chatgpt-infinity/firefox/extension/content.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
.filter(key => key != 'infinityMode')) // exclude infinityMode...
4444
settings.save('infinityMode', false) // ...to always init as false
4545
if (!config.replyLanguage) // init reply language if unset
46-
settings.save('replyLanguage', (await chrome.i18n.getAcceptLanguages())[0])
46+
settings.save('replyLanguage', chrome.i18n.getUILanguage())
4747
if (!config.replyTopic) // init reply topic if unset
4848
settings.save('replyTopic', getMsg('menuLabel_all'))
4949
if (!config.replyInterval) settings.save('replyInterval', 7) // init refresh interval to 7 secs if unset

chatgpt-infinity/firefox/extension/popup/controller.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
const env = {
99
site: /([^.]+)\.[^.]+$/.exec(new URL((await chrome.tabs.query(
1010
{ active: true, currentWindow: true }))[0].url).hostname)?.[1],
11-
browser: { displaysEnglish: (await chrome.i18n.getAcceptLanguages())[0].startsWith('en') }
11+
browser: { displaysEnglish: chrome.i18n.getUILanguage().startsWith('en') }
1212
}
1313

1414
// Import APP data
@@ -123,7 +123,7 @@
123123
replyLang = ( // auto-case for menu/alert aesthetics
124124
replyLang.length < 4 || replyLang.includes('-') ? replyLang.toUpperCase()
125125
: replyLang.charAt(0).toUpperCase() + replyLang.slice(1).toLowerCase() )
126-
settings.save('replyLanguage', replyLang || (await chrome.i18n.getAcceptLanguages())[0])
126+
settings.save('replyLanguage', replyLang || chrome.i18n.getUILanguage())
127127
siteAlert(getMsg('alert_replyLangUpdated') + '!',
128128
`${getMsg('appName')} ${getMsg('alert_willReplyIn')} `
129129
+ `${ replyLang || getMsg('alert_yourSysLang') }.`

chatgpt-widescreen/chromium/extension/popup/controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
site: /([^.]+)\.[^.]+$/.exec(new URL((await chrome.tabs.query(
1010
{ active: true, currentWindow: true }))[0].url).hostname)?.[1],
1111
browser: {
12-
displaysEnglish: (await chrome.i18n.getAcceptLanguages())[0].startsWith('en'),
12+
displaysEnglish: chrome.i18n.getUILanguage().startsWith('en'),
1313
isFF: navigator.userAgent.includes('Firefox')
1414
}
1515
}

chatgpt-widescreen/firefox/extension/popup/controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
site: /([^.]+)\.[^.]+$/.exec(new URL((await chrome.tabs.query(
1010
{ active: true, currentWindow: true }))[0].url).hostname)?.[1],
1111
browser: {
12-
displaysEnglish: (await chrome.i18n.getAcceptLanguages())[0].startsWith('en'),
12+
displaysEnglish: chrome.i18n.getUILanguage().startsWith('en'),
1313
isFF: navigator.userAgent.includes('Firefox')
1414
}
1515
}

0 commit comments

Comments
 (0)