@goodandready/dsh-subscriptions 0.4.3 → 0.4.4
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.
- package/lib/client.js +6 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -5,6 +5,10 @@ window.__ModuleLoader__.load({
|
|
|
5
5
|
var exports = module.exports
|
|
6
6
|
const React = require('react')
|
|
7
7
|
|
|
8
|
+
// Модульный переводчик: доступен всем подпискам компонентов и хелперам.
|
|
9
|
+
let t = (key) => key
|
|
10
|
+
const setT = (fn) => { t = fn }
|
|
11
|
+
|
|
8
12
|
const CSS =
|
|
9
13
|
// card — same structure as core PluginCard (bash, agent-loop, web-search)
|
|
10
14
|
'.dsub-card{list-style:none;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;transition:border-color .16s,background .16s}' +
|
|
@@ -538,7 +542,7 @@ function PluginCard(props) {
|
|
|
538
542
|
return () => { for (const off of undo) off() }
|
|
539
543
|
}, 'dsh-subscriptions: словари')
|
|
540
544
|
// Подписи вне компонента берут переводчик, привязанный к namespace.
|
|
541
|
-
|
|
545
|
+
setT(ctx.locale.bind(NS))
|
|
542
546
|
// Штатное место — вкладка «Плагины»: карточка со своим заголовком и
|
|
543
547
|
// сворачиванием вместо строки в боковом списке. Ключ регистрации обязан
|
|
544
548
|
// равняться пространству настроек, иначе вкладка молча не покажет слот.
|
|
@@ -734,6 +738,7 @@ function PluginCard(props) {
|
|
|
734
738
|
|
|
735
739
|
exports.inject = ['slots', 'locale', 'sessions']
|
|
736
740
|
exports.apply = function apply(ctx) {
|
|
741
|
+
setT(ctx.locale.bind(NS))
|
|
737
742
|
registerSettings(ctx)
|
|
738
743
|
registerHeaderChip(ctx)
|
|
739
744
|
registerComposerSwitch(ctx)
|
package/package.json
CHANGED