|
225 | 225 | // @description:zu Dlala izimpendulo ze-ChatGPT ngokuzenzakalela |
226 | 226 | // @author Adam Lui |
227 | 227 | // @namespace https://github.com/adamlui |
228 | | -// @version 2025.5.14.2 |
| 228 | +// @version 2025.5.14.3 |
229 | 229 | // @license MIT |
230 | 230 | // @icon https://assets.chatgptautotalk.com/images/icons/openai/black/icon48.png?v=9f1ed3c |
231 | 231 | // @icon64 https://assets.chatgptautotalk.com/images/icons/openai/black/icon64.png?v=9f1ed3c |
|
287 | 287 | latestResourceCommitHash: 'f825434' // for cached <app|messages>.json |
288 | 288 | } |
289 | 289 | app.urls = { resourceHost: `https://cdn.jsdelivr.net/gh/adamlui/chatgpt-auto-talk@${app.latestResourceCommitHash}` } |
290 | | - const remoteAppData = await new Promise(resolve => xhr({ |
291 | | - method: 'GET', url: `${app.urls.resourceHost}/assets/data/app.json`, |
292 | | - onload: resp => resolve(JSON.parse(resp.responseText)) |
293 | | - })) |
294 | | - Object.assign(app, { ...remoteAppData, urls: { ...app.urls, ...remoteAppData.urls }}) |
295 | | - app.msgs = { |
296 | | - appName: app.name, |
297 | | - appAuthor: app.author.name, |
298 | | - appDesc: 'Automatically play ChatGPT responses', |
299 | | - menuLabel_toggleVis: 'Toggle Visibility', |
300 | | - menuLabel_about: 'About', |
301 | | - menuLabel_donate: 'Please send a donation', |
302 | | - about_author: 'Author', |
303 | | - about_and: '&', |
304 | | - about_contributors: 'contributors', |
305 | | - about_version: 'Version', |
306 | | - about_poweredBy: 'Powered by', |
307 | | - about_openSourceCode: 'Open source code', |
308 | | - about_latestChanges: 'Latest changes', |
309 | | - mode_autoTalk: 'Auto-Talk', |
310 | | - helptip_toggleVis: 'Show Auto-Talk toggle in sidebar', |
311 | | - alert_updateAvail: 'Update available', |
312 | | - alert_newerVer: 'An update to', |
313 | | - alert_isAvail: 'is available', |
314 | | - alert_upToDate: 'Up-to-date', |
315 | | - alert_showYourSupport: 'Show your support', |
316 | | - alert_isOSS: 'is open-source software built & maintained for free through 100% volunteer efforts', |
317 | | - alert_despiteAffliction: 'Despite being severely afflicted by', |
318 | | - alert_longCOVID: 'long COVID', |
319 | | - alert_since2020: 'since 2020', |
320 | | - alert_byDonatingResults: 'by donating, you help me to continue improving, fixing bugs, adding new features, and making the software even better', |
321 | | - alert_yourContrib: 'Your contribution', |
322 | | - alert_noMatterSize: 'no matter the size', |
323 | | - alert_directlySupports: 'directly supports my unpaid efforts to ensure this project remains free and open for all to use', |
324 | | - alert_tyForSupport: 'Thank you for your support', |
325 | | - alert_isUpToDate: 'is up-to-date', |
326 | | - btnLabel_moreAIextensions: 'More AI Extensions', |
327 | | - btnLabel_rateUs: 'Rate Us', |
328 | | - btnLabel_discuss: 'Discuss', |
329 | | - btnLabel_getSupport: 'Get Support', |
330 | | - btnLabel_checkForUpdates: 'Check for Updates', |
331 | | - btnLabel_update: 'Update', |
332 | | - btnLabel_dismiss: 'Dismiss', |
333 | | - link_viewChanges: 'View changes', |
334 | | - state_enabled: 'enabled', |
335 | | - state_disabled: 'disabled', |
336 | | - state_on: 'on', |
337 | | - state_off: 'off' |
338 | | - } |
339 | | - |
340 | | - // LOCALIZE app.msgs for non-English users |
341 | | - if (!env.browser.language.startsWith('en')) { |
342 | | - const localizedMsgs = await new Promise(resolve => { |
| 290 | + const remoteData = { |
| 291 | + app: await new Promise(resolve => xhr({ |
| 292 | + method: 'GET', url: `${app.urls.resourceHost}/assets/data/app.json`, |
| 293 | + onload: resp => resolve(JSON.parse(resp.responseText)) |
| 294 | + })), |
| 295 | + msgs: await new Promise(resolve => { |
343 | 296 | const msgHostDir = app.urls.resourceHost + '/greasemonkey/_locales/', |
344 | 297 | msgLocaleDir = ( env.browser.language ? env.browser.language.replace('-', '_') : 'en' ) + '/' |
345 | 298 | let msgHref = msgHostDir + msgLocaleDir + 'messages.json', msgXHRtries = 0 |
|
361 | 314 | } |
362 | 315 | fetchMsgs() |
363 | 316 | }) |
364 | | - Object.assign(app.msgs, localizedMsgs) |
365 | 317 | } |
| 318 | + Object.assign(app, { ...remoteData.app, urls: { ...app.urls, ...remoteData.app.urls }, msgs: remoteData.msgs }) |
366 | 319 |
|
367 | 320 | // Init SETTINGS |
368 | 321 | window.config = {} |
|
0 commit comments