dsh-rewind-plugin 0.18.1 → 0.19.1
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/README.en.md +0 -8
- package/README.md +0 -5
- package/lib/client.js +459 -313
- package/lib/index.js +58 -5
- package/lib/types/client/candidates.d.ts +4 -6
- package/lib/types/client/hidden.d.ts +30 -36
- package/lib/types/client/index.d.ts +1 -7
- package/lib/types/client/locales.d.ts +58 -46
- package/lib/types/client/portals.d.ts +3 -65
- package/lib/types/client/visibility.d.ts +89 -0
- package/lib/types/locales.d.ts +80 -20
- package/locale/ja.json +6 -0
- package/package.json +1 -1
package/lib/types/locales.d.ts
CHANGED
|
@@ -23,26 +23,13 @@
|
|
|
23
23
|
* not in that channel (see docs/compat/audit.md, RU-I18N), and no host command
|
|
24
24
|
* OUTPUT is localized for anyone, so this dictionary is what carries it.
|
|
25
25
|
*
|
|
26
|
-
* English is the key
|
|
26
|
+
* English is the canonical key set: every other dictionary is typed complete
|
|
27
|
+
* against it, and the tests compare every dictionary's template placeholders
|
|
28
|
+
* with it. Adding a language is one dictionary plus one entry in `HOST_DICTS`.
|
|
27
29
|
*
|
|
28
30
|
* @module dsh-rewind/locales
|
|
29
31
|
*/
|
|
30
|
-
/**
|
|
31
|
-
export type HostLocaleId = 'zh' | 'en';
|
|
32
|
-
/**
|
|
33
|
-
* The locale a durable preference selects from this plugin's dictionaries.
|
|
34
|
-
*
|
|
35
|
-
* The harness accepts any BCP 47-style id while this plugin ships only `zh` and
|
|
36
|
-
* `en`, so the PRIMARY subtag decides (`zh-CN` → zh) and everything else — an
|
|
37
|
-
* unset preference, an unsupported language, a non-string value — is English.
|
|
38
|
-
* The client's own selection tries the full tag before the primary subtag; over
|
|
39
|
-
* these two dictionaries the outcome is the same.
|
|
40
|
-
*
|
|
41
|
-
* @param preference - the raw `locale.preference` value.
|
|
42
|
-
* @returns the dictionary this plugin renders its host copy in.
|
|
43
|
-
*/
|
|
44
|
-
export declare function preferredLocale(preference: unknown): HostLocaleId;
|
|
45
|
-
/** English dictionary — the key-set source of truth (neutral default). */
|
|
32
|
+
/** English dictionary — the canonical key set (neutral default). */
|
|
46
33
|
export declare const en: {
|
|
47
34
|
'plan.skip': string;
|
|
48
35
|
'skipReason.oversized': string;
|
|
@@ -93,13 +80,86 @@ export declare const en: {
|
|
|
93
80
|
export type HostKey = keyof typeof en;
|
|
94
81
|
/** Chinese dictionary, checked complete against the en key set. */
|
|
95
82
|
export declare const zh: Record<HostKey, string>;
|
|
96
|
-
/**
|
|
97
|
-
export declare const
|
|
83
|
+
/** Japanese dictionary, checked complete against the en key set. */
|
|
84
|
+
export declare const ja: Record<HostKey, string>;
|
|
85
|
+
/**
|
|
86
|
+
* Every language this plugin ships a host dictionary for. English is first as
|
|
87
|
+
* the canonical dictionary; the rest follow the harness's language order.
|
|
88
|
+
* Adding a language is one dictionary above plus one entry here — the locale-id
|
|
89
|
+
* type, the preference resolver, and the tests all derive from this map.
|
|
90
|
+
*/
|
|
91
|
+
export declare const HOST_DICTS: {
|
|
92
|
+
en: {
|
|
93
|
+
'plan.skip': string;
|
|
94
|
+
'skipReason.oversized': string;
|
|
95
|
+
'error.invalidTarget': string;
|
|
96
|
+
'sep.list': string;
|
|
97
|
+
'sep.clause': string;
|
|
98
|
+
'failures.suffix': string;
|
|
99
|
+
'failures.item': string;
|
|
100
|
+
inflight: string;
|
|
101
|
+
stopFailed: string;
|
|
102
|
+
cancelled: string;
|
|
103
|
+
failed: string;
|
|
104
|
+
'restore.count': string;
|
|
105
|
+
'delete.count': string;
|
|
106
|
+
'skip.count': string;
|
|
107
|
+
noRestorable: string;
|
|
108
|
+
backupOff: string;
|
|
109
|
+
storeUnsupported: string;
|
|
110
|
+
success: string;
|
|
111
|
+
noUserMessages: string;
|
|
112
|
+
'command.description': string;
|
|
113
|
+
'command.undoDescription': string;
|
|
114
|
+
'engine.description': string;
|
|
115
|
+
'engine.rejected': string;
|
|
116
|
+
'engine.inputHint': string;
|
|
117
|
+
'cleanup.description': string;
|
|
118
|
+
'cleanup.inputHint': string;
|
|
119
|
+
'cleanup.status': string;
|
|
120
|
+
'cleanup.enabled': string;
|
|
121
|
+
'cleanup.disabled': string;
|
|
122
|
+
'cleanup.onOk': string;
|
|
123
|
+
'cleanup.offOk': string;
|
|
124
|
+
'cleanup.maxAgeOk': string;
|
|
125
|
+
'cleanup.cfgInvalid': string;
|
|
126
|
+
'cleanup.saveFailed': string;
|
|
127
|
+
'cleanup.runDry': string;
|
|
128
|
+
'cleanup.runApply': string;
|
|
129
|
+
'cleanup.runFailed': string;
|
|
130
|
+
'cleanup.skipped': string;
|
|
131
|
+
'cleanup.clearDry': string;
|
|
132
|
+
'cleanup.clearApply': string;
|
|
133
|
+
'cleanup.clearActive': string;
|
|
134
|
+
'cleanup.clearCancelled': string;
|
|
135
|
+
'cleanup.clearFailed': string;
|
|
136
|
+
'cleanup.usage': string;
|
|
137
|
+
};
|
|
138
|
+
zh: Record<"backupOff" | "cancelled" | "cleanup.cfgInvalid" | "cleanup.clearActive" | "cleanup.clearApply" | "cleanup.clearCancelled" | "cleanup.clearDry" | "cleanup.clearFailed" | "cleanup.description" | "cleanup.disabled" | "cleanup.enabled" | "cleanup.inputHint" | "cleanup.maxAgeOk" | "cleanup.offOk" | "cleanup.onOk" | "cleanup.runApply" | "cleanup.runDry" | "cleanup.runFailed" | "cleanup.saveFailed" | "cleanup.skipped" | "cleanup.status" | "cleanup.usage" | "command.description" | "command.undoDescription" | "delete.count" | "engine.description" | "engine.inputHint" | "engine.rejected" | "error.invalidTarget" | "failed" | "failures.item" | "failures.suffix" | "inflight" | "noRestorable" | "noUserMessages" | "plan.skip" | "restore.count" | "sep.clause" | "sep.list" | "skip.count" | "skipReason.oversized" | "stopFailed" | "storeUnsupported" | "success", string>;
|
|
139
|
+
ja: Record<"backupOff" | "cancelled" | "cleanup.cfgInvalid" | "cleanup.clearActive" | "cleanup.clearApply" | "cleanup.clearCancelled" | "cleanup.clearDry" | "cleanup.clearFailed" | "cleanup.description" | "cleanup.disabled" | "cleanup.enabled" | "cleanup.inputHint" | "cleanup.maxAgeOk" | "cleanup.offOk" | "cleanup.onOk" | "cleanup.runApply" | "cleanup.runDry" | "cleanup.runFailed" | "cleanup.saveFailed" | "cleanup.skipped" | "cleanup.status" | "cleanup.usage" | "command.description" | "command.undoDescription" | "delete.count" | "engine.description" | "engine.inputHint" | "engine.rejected" | "error.invalidTarget" | "failed" | "failures.item" | "failures.suffix" | "inflight" | "noRestorable" | "noUserMessages" | "plan.skip" | "restore.count" | "sep.clause" | "sep.list" | "skip.count" | "skipReason.oversized" | "stopFailed" | "storeUnsupported" | "success", string>;
|
|
140
|
+
};
|
|
141
|
+
/** Host-side supported locale ids (the registry keys). */
|
|
142
|
+
export type HostLocaleId = keyof typeof HOST_DICTS;
|
|
143
|
+
/** Neutral default, matching the harness's `FALLBACK_LOCALE`. */
|
|
144
|
+
export declare const DEFAULT_HOST_LOCALE: "en";
|
|
145
|
+
/**
|
|
146
|
+
* The locale a durable preference selects from this plugin's dictionaries.
|
|
147
|
+
*
|
|
148
|
+
* The harness accepts any BCP 47-style id while this plugin ships a fixed set,
|
|
149
|
+
* so the preference is matched against the registry: the full tag first
|
|
150
|
+
* (case-insensitively), then its primary subtag (`xx-YY` → `xx`), mirroring the
|
|
151
|
+
* client runtime. Anything else — an unset preference, an unsupported language,
|
|
152
|
+
* a non-string value — is the neutral default.
|
|
153
|
+
*
|
|
154
|
+
* @param preference - the raw `locale.preference` value.
|
|
155
|
+
* @returns the dictionary this plugin renders its host copy in.
|
|
156
|
+
*/
|
|
157
|
+
export declare function preferredLocale(preference: unknown): HostLocaleId;
|
|
98
158
|
/**
|
|
99
159
|
* Render one dictionary key with `{name}` template interpolation. Unknown
|
|
100
160
|
* params are ignored; a missing key falls back to the raw key so a dictionary
|
|
101
161
|
* gap is visible instead of blank.
|
|
102
|
-
* @param lang - the active locale.
|
|
162
|
+
* @param lang - the active locale id.
|
|
103
163
|
* @param key - the dictionary key.
|
|
104
164
|
* @param params - `{name}` substitution values.
|
|
105
165
|
*/
|
package/locale/ja.json
ADDED