@goodandready/dsh-subscriptions 0.2.9 → 0.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/client.js +19 -1
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -420,7 +420,25 @@ const cssId = 'dsh-subscriptions/settings.module.css'
420
420
  }
421
421
 
422
422
  function registerSettings(ctx) {
423
- ctx.effect(() => ctx.locale.register(NS, { en, ru }), 'dsh-subscriptions: словари')
423
+ // Язык может принести не только плагин: словарные пакеты объявляют
424
+ // русский для чужих пространств. Ядро на повторное объявление той же
425
+ // пары «пространство + язык» бросает исключение, и незащищённый вызов
426
+ // уносил с собой весь плагин — в интерфейсе это выглядело как «Failed to
427
+ // load plugins» с перечнем ни в чём не повинных соседей.
428
+ //
429
+ // Поэтому каждый язык объявляется отдельно и по-хорошему: заняли до нас —
430
+ // уступаем, свой английский при этом всё равно встаёт на место.
431
+ const addLocale = (locale, dictionary) => {
432
+ try {
433
+ return ctx.locale.register(NS, locale, dictionary)
434
+ } catch (alreadyTaken) {
435
+ return () => {}
436
+ }
437
+ }
438
+ ctx.effect(() => {
439
+ const undo = [addLocale('en', en), addLocale('ru', ru)]
440
+ return () => { for (const off of undo) off() }
441
+ }, 'dsh-subscriptions: словари')
424
442
  // Подписи вне компонента берут переводчик, привязанный к namespace.
425
443
  const t = ctx.locale.bind(NS)
426
444
  // Штатное место — вкладка «Плагины»: карточка со своим заголовком и
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodandready/dsh-subscriptions",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "description": "Use ChatGPT Codex, Claude, Grok, and Antigravity subscriptions as DeepSeek Harness LLM providers via OAuth.",
5
5
  "license": "MIT",
6
6
  "type": "module",