@qilin-agent/client-locale 0.0.0-stage → 3.1.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/LICENSE +21 -0
- package/README.i18n.yaml +61 -0
- package/README.md +139 -2
- package/README.zh.md +140 -0
- package/lib/client.js +1390 -0
- package/lib/index.js +27 -0
- package/lib/types/client/index.d.ts +238 -0
- package/lib/types/index.d.ts +9 -0
- package/lib/types/locale-settings.d.ts +22 -0
- package/lib/types/locales/en.d.ts +43 -0
- package/lib/types/locales/index.d.ts +9 -0
- package/lib/types/locales/zh.d.ts +45 -0
- package/package.json +71 -3
package/lib/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import z from "@qilin-agent/schemastery";
|
|
2
|
+
//#region lib/types/locale-settings.js
|
|
3
|
+
/** Locale preference stored in the Host user-settings document. */
|
|
4
|
+
/** Settings namespace owned by the locale plugin. */
|
|
5
|
+
const LOCALE_SETTINGS_NAMESPACE = "locale";
|
|
6
|
+
/** Field carrying an explicit locale selection; absence delegates to the browser. */
|
|
7
|
+
const LOCALE_PREFERENCE_FIELD = "preference";
|
|
8
|
+
/** Accepted BCP 47-style language ids. */
|
|
9
|
+
const LOCALE_ID_PATTERN = /^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{1,8})*$/u;
|
|
10
|
+
/** Locale identifiers shipped by the browser client. */
|
|
11
|
+
const LOCALE_IDS = ["zh", "en"];
|
|
12
|
+
/** Durable locale schema; also the wire envelope the browser scope validates against. */
|
|
13
|
+
const LocaleSettingsSchema = z.object({ [LOCALE_PREFERENCE_FIELD]: z.string().pattern(LOCALE_ID_PATTERN).required(false) });
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region lib/types/index.js
|
|
16
|
+
/** Host registration for the browser locale preference. */
|
|
17
|
+
/**
|
|
18
|
+
* Register the durable locale section when a settings provider exists.
|
|
19
|
+
* @param ctx - Host context whose optional settings service owns the section.
|
|
20
|
+
*/
|
|
21
|
+
function apply(ctx) {
|
|
22
|
+
ctx.inject(["settings"], (settingsCtx) => {
|
|
23
|
+
settingsCtx.settings.register(LOCALE_SETTINGS_NAMESPACE, LocaleSettingsSchema);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { LOCALE_IDS, LOCALE_PREFERENCE_FIELD, LOCALE_SETTINGS_NAMESPACE, apply };
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser-side locale registry. Bound translation functions retain stable
|
|
3
|
+
* identity for injected consumers. The account menu is the surface that
|
|
4
|
+
* switches languages; this plugin owns the preference, the registry, and the
|
|
5
|
+
* document language attribute.
|
|
6
|
+
*/
|
|
7
|
+
import type { Context as ClientContext } from '@qilin-agent/kylin';
|
|
8
|
+
import type { LocalizedText } from '@qilin-agent/package-manifest';
|
|
9
|
+
import { type LocaleDictOf, type LocaleNamespaceMap, type Translate, type TranslateNS } from '@qilin-agent/client-ui-slots';
|
|
10
|
+
import type { ConfigForm } from '@qilin-agent/client-ui-settings/client';
|
|
11
|
+
import { type BuiltInLocaleId, type LocaleId, type LocaleSettings } from '../locale-settings.ts';
|
|
12
|
+
import { type CommonKey } from '../locales/index.ts';
|
|
13
|
+
export type { CommonKey } from '../locales/index.ts';
|
|
14
|
+
export type { BuiltInLocaleId, LocaleId, LocaleSettings } from '../locale-settings.ts';
|
|
15
|
+
export type { Translate, TranslateNS } from '@qilin-agent/client-ui-slots';
|
|
16
|
+
declare module '@qilin-agent/client-ui-slots' {
|
|
17
|
+
interface LocaleNamespaceMap {
|
|
18
|
+
/** Shared cross-feature vocabulary, consulted by the lookup chain after the entry's own namespace misses. */
|
|
19
|
+
common: CommonKey;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/** Locale dictionary: flat key to template string ({name} placeholders). */
|
|
23
|
+
export type LocaleDict = Record<string, string>;
|
|
24
|
+
/** Input accepted when a language-pack plugin adds a selectable language. */
|
|
25
|
+
export interface LanguageRegistration {
|
|
26
|
+
/** Stable BCP 47-style id stored as the locale preference. */
|
|
27
|
+
id: LocaleId;
|
|
28
|
+
/** Display name written in the represented language. */
|
|
29
|
+
label: string;
|
|
30
|
+
/** Registered language consulted when this language lacks a dictionary key. */
|
|
31
|
+
fallback: LocaleId;
|
|
32
|
+
}
|
|
33
|
+
/** One normalized selectable locale published in snapshots. */
|
|
34
|
+
export interface LocaleDefinition {
|
|
35
|
+
/** Stable id persisted by {@link LocaleRuntime.setLocale}. */
|
|
36
|
+
readonly id: LocaleId;
|
|
37
|
+
/** Display name written in the represented language. */
|
|
38
|
+
readonly label: string;
|
|
39
|
+
/** Next language in the per-key fallback chain; absent only for English. */
|
|
40
|
+
readonly fallback?: LocaleId;
|
|
41
|
+
}
|
|
42
|
+
/** Immutable locale state published on every change. */
|
|
43
|
+
export interface LocaleSnapshot {
|
|
44
|
+
/** Active locale id. */
|
|
45
|
+
active: LocaleId;
|
|
46
|
+
/** Selectable locales in display order. */
|
|
47
|
+
locales: readonly LocaleDefinition[];
|
|
48
|
+
/** Monotonic change counter (registry or active changes). */
|
|
49
|
+
revision: number;
|
|
50
|
+
}
|
|
51
|
+
declare module '@qilin-agent/kylin' {
|
|
52
|
+
interface Context {
|
|
53
|
+
locale: LocaleRuntime;
|
|
54
|
+
}
|
|
55
|
+
interface Events {
|
|
56
|
+
/**
|
|
57
|
+
* The active locale switched. Dictionary registrations do NOT emit this
|
|
58
|
+
* event (listeners may re-register slots in response, and boot registers
|
|
59
|
+
* one namespace per package); continuous render refresh rides the
|
|
60
|
+
* LocaleFace revision instead.
|
|
61
|
+
* @param snapshot - Current immutable locale snapshot.
|
|
62
|
+
* @mode emit
|
|
63
|
+
*/
|
|
64
|
+
'locale/change'(snapshot: LocaleSnapshot): void;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* English is both the locale the UI opens in when the browser names no registered
|
|
69
|
+
* language (and for non-browser runs), and the dictionary consulted after the
|
|
70
|
+
* active locale misses a key. One constant serves both because the shipped
|
|
71
|
+
* `zh`/`en` dictionaries carry identical key sets, so neither direction can
|
|
72
|
+
* leave a key unresolved; the residual case points at English rather than
|
|
73
|
+
* zh because a browser naming no registered language is the reader least
|
|
74
|
+
* likely to read Chinese.
|
|
75
|
+
*/
|
|
76
|
+
export declare const FALLBACK_LOCALE: BuiltInLocaleId;
|
|
77
|
+
/** Shared namespace for shell-level texts. */
|
|
78
|
+
export declare const COMMON_NS = "common";
|
|
79
|
+
/**
|
|
80
|
+
* Dictionary registry plus locale preference. Lookup walks the active
|
|
81
|
+
* language's declared fallback chain in the entry namespace, then repeats it
|
|
82
|
+
* in the shared common namespace before showing the key itself. Reads go
|
|
83
|
+
* through {@link getLocale}; preferences change only through
|
|
84
|
+
* {@link setLocale}, while language packs extend the catalog through
|
|
85
|
+
* {@link addLanguage}. Continuous sync uses the `locale/change` event or
|
|
86
|
+
* the LocaleFace getSnapshot/subscribe pair installed through
|
|
87
|
+
* `ctx.slots.installLocale`.
|
|
88
|
+
*/
|
|
89
|
+
export declare class LocaleRuntime {
|
|
90
|
+
private dicts;
|
|
91
|
+
private bound;
|
|
92
|
+
private catalog;
|
|
93
|
+
private fallbackChains;
|
|
94
|
+
private snapshot;
|
|
95
|
+
private listeners;
|
|
96
|
+
private readonly ctx;
|
|
97
|
+
private readonly host;
|
|
98
|
+
/** Browser-derived locale standing wherever no explicit Host selection does. */
|
|
99
|
+
private provisional;
|
|
100
|
+
/** Last explicit selection, including one awaiting an external registration. */
|
|
101
|
+
private preference;
|
|
102
|
+
/**
|
|
103
|
+
* @param ctx - owning context (change events are emitted on it; the scope
|
|
104
|
+
* listener is released through ctx.effect on dispose).
|
|
105
|
+
* @param host - durable preference scope owned by the providing plugin;
|
|
106
|
+
* absent compositions (standalone dictionary registries) stay process-local.
|
|
107
|
+
*/
|
|
108
|
+
constructor(ctx: ClientContext, host?: ConfigForm<LocaleSettings>);
|
|
109
|
+
/**
|
|
110
|
+
* Read the current immutable locale snapshot.
|
|
111
|
+
* @returns the current snapshot (stable reference until the next change).
|
|
112
|
+
*/
|
|
113
|
+
getLocale(): LocaleSnapshot;
|
|
114
|
+
/**
|
|
115
|
+
* Resolve package text through the active language's declared fallback chain.
|
|
116
|
+
* Plain strings stay verbatim; maps do not consult registered dictionaries.
|
|
117
|
+
* @param text - package text whose locale keys are lowercase and include English.
|
|
118
|
+
* @returns the first available translation, including an empty string.
|
|
119
|
+
*/
|
|
120
|
+
resolveText(text: LocalizedText): string;
|
|
121
|
+
/**
|
|
122
|
+
* LocaleFace getSnapshot: the current snapshot (carries `revision`; stable
|
|
123
|
+
* reference between changes, uSES-safe).
|
|
124
|
+
* @returns the current snapshot.
|
|
125
|
+
*/
|
|
126
|
+
getSnapshot(): LocaleSnapshot;
|
|
127
|
+
/**
|
|
128
|
+
* LocaleFace subscribe: notified on every snapshot change (locale switch
|
|
129
|
+
* or dictionary registration — registrations bump the revision so already
|
|
130
|
+
* rendered outlets pick up late-arriving dictionaries and locale definitions).
|
|
131
|
+
* @param fn - change callback.
|
|
132
|
+
* @returns unsubscribe.
|
|
133
|
+
*/
|
|
134
|
+
subscribe(fn: () => void): () => void;
|
|
135
|
+
/**
|
|
136
|
+
* Switch the active locale — the only user preference write entry.
|
|
137
|
+
*
|
|
138
|
+
* The durable write happens even when the id already matches the active
|
|
139
|
+
* locale, because the active value may be a provisional browser-derived or
|
|
140
|
+
* fallback resolution that nothing has stored yet. Picking the language
|
|
141
|
+
* already on screen is still an explicit choice, and it must survive a
|
|
142
|
+
* different browser sharing the same QILIN home. Only the render notification
|
|
143
|
+
* is conditional: republishing an unchanged locale would churn every
|
|
144
|
+
* subscriber for nothing.
|
|
145
|
+
* @param id - a registered locale id; unknown ids throw.
|
|
146
|
+
*/
|
|
147
|
+
setLocale(id: string): void;
|
|
148
|
+
/**
|
|
149
|
+
* Add one selectable language to the shared catalog. Its fallback must
|
|
150
|
+
* already be registered, and following fallback definitions must terminate
|
|
151
|
+
* at English. Dictionaries may register before or after this definition.
|
|
152
|
+
* Registration rechecks an unresolved Host preference and the browser's
|
|
153
|
+
* ordered language list. The caller owns the returned disposer; removing an
|
|
154
|
+
* active language falls back without clearing the stored id.
|
|
155
|
+
* @param input - stable id, self-described label, and fallback language id.
|
|
156
|
+
* @returns idempotent disposer removing this exact definition.
|
|
157
|
+
* @throws when fields are malformed, the id is occupied, or the fallback
|
|
158
|
+
* target is unknown or creates a cycle.
|
|
159
|
+
*/
|
|
160
|
+
addLanguage(input: LanguageRegistration): () => void;
|
|
161
|
+
/**
|
|
162
|
+
* Adopt the scope's accepted durable selection without writing it back; an
|
|
163
|
+
* absent selection returns to the browser-derived locale.
|
|
164
|
+
* @param host - the constructor-narrowed scope driving this adoption.
|
|
165
|
+
*/
|
|
166
|
+
private adopt;
|
|
167
|
+
/** Recompute browser fallback and publish the current catalog. */
|
|
168
|
+
private publishCatalog;
|
|
169
|
+
/** Resolve an explicit preference only while its definition is available. */
|
|
170
|
+
private resolveActive;
|
|
171
|
+
/** Snapshot the catalog in registration order. */
|
|
172
|
+
private localeList;
|
|
173
|
+
/** Fail a new definition whose complete fallback path does not reach English. */
|
|
174
|
+
private assertFallbackChain;
|
|
175
|
+
/** Resolve a lookup chain, falling directly to English across an unload gap. */
|
|
176
|
+
private fallbackChain;
|
|
177
|
+
/**
|
|
178
|
+
* Register a declared namespace's dictionaries, all locales in one call —
|
|
179
|
+
* the typed form: each dictionary is checked against the namespace's
|
|
180
|
+
* {@link LocaleNamespaceMap} key union (a missing or extra key is a
|
|
181
|
+
* compile error), and every shipped locale is required (bilingual balance
|
|
182
|
+
* enforced at registration). Duplicate (ns, locale) throws (single occupant; a
|
|
183
|
+
* namespace's texts have one owner). Registration bumps the revision so
|
|
184
|
+
* mounted outlets pick up late-arriving dictionaries.
|
|
185
|
+
* @param ns - a namespace merged into LocaleNamespaceMap.
|
|
186
|
+
* @param dicts - complete dictionaries keyed by built-in locale id.
|
|
187
|
+
* @returns disposer removing every locale registered by this call (idempotent).
|
|
188
|
+
*/
|
|
189
|
+
register<N extends Extract<keyof LocaleNamespaceMap, string>>(ns: N, dicts: Record<BuiltInLocaleId, LocaleDictOf<N>>): () => void;
|
|
190
|
+
/**
|
|
191
|
+
* Single-locale untyped form for language-pack contributions and namespaces
|
|
192
|
+
* outside the merge table.
|
|
193
|
+
* @param ns - namespace.
|
|
194
|
+
* @param locale - locale tag.
|
|
195
|
+
* @param dict - dictionary.
|
|
196
|
+
* @returns disposer (idempotent).
|
|
197
|
+
* @throws when locale is not a BCP 47-style tag.
|
|
198
|
+
*/
|
|
199
|
+
register(ns: string, locale: string, dict: LocaleDict): () => void;
|
|
200
|
+
/**
|
|
201
|
+
* Bind a declared namespace to a translate function typed to its
|
|
202
|
+
* dictionary key union (plus the shared common vocabulary) — the same key
|
|
203
|
+
* domain the framework-injected `t` seat carries. The returned reference
|
|
204
|
+
* is stable per namespace (repeat binds return the same function), so it
|
|
205
|
+
* can ride inject surfaces without breaking memoization.
|
|
206
|
+
* @param ns - a namespace merged into LocaleNamespaceMap.
|
|
207
|
+
* @returns the typed translate function (reads the active locale at call time).
|
|
208
|
+
*/
|
|
209
|
+
bind<N extends Extract<keyof LocaleNamespaceMap, string>>(ns: N): TranslateNS<N>;
|
|
210
|
+
/**
|
|
211
|
+
* Untyped form for namespaces outside the merge table (dynamic
|
|
212
|
+
* composition, tests).
|
|
213
|
+
* @param ns - namespace.
|
|
214
|
+
* @returns the translate function.
|
|
215
|
+
*/
|
|
216
|
+
bind(ns: string): Translate;
|
|
217
|
+
private translate;
|
|
218
|
+
private lookup;
|
|
219
|
+
/**
|
|
220
|
+
* Advance the snapshot revision and notify LocaleFace subscribers (render
|
|
221
|
+
* refresh). Only an active-locale switch additionally emits
|
|
222
|
+
* `locale/change` — dictionary registrations stay off the event so
|
|
223
|
+
* registration-heavy boot cannot storm event listeners (which may
|
|
224
|
+
* re-register slots in response).
|
|
225
|
+
*/
|
|
226
|
+
private publish;
|
|
227
|
+
}
|
|
228
|
+
/** Required services: slot registration plus the settings transport. */
|
|
229
|
+
export declare const inject: string[];
|
|
230
|
+
/**
|
|
231
|
+
* Client plugin body: provide the locale service with base dictionaries and
|
|
232
|
+
* keep `<html lang>` in step with the active locale. The account menu is the
|
|
233
|
+
* surface that switches languages; this plugin owns the preference and its
|
|
234
|
+
* registry, not a settings row.
|
|
235
|
+
* @param ctx - client cordis context.
|
|
236
|
+
*/
|
|
237
|
+
export declare function apply(ctx: ClientContext): void;
|
|
238
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Host registration for the browser locale preference. */
|
|
2
|
+
import type { Context } from '@qilin-agent/kylin';
|
|
3
|
+
export { LOCALE_IDS, LOCALE_PREFERENCE_FIELD, LOCALE_SETTINGS_NAMESPACE, type BuiltInLocaleId, type LocaleId, type LocaleSettings, } from './locale-settings.ts';
|
|
4
|
+
/**
|
|
5
|
+
* Register the durable locale section when a settings provider exists.
|
|
6
|
+
* @param ctx - Host context whose optional settings service owns the section.
|
|
7
|
+
*/
|
|
8
|
+
export declare function apply(ctx: Context): void;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Locale preference stored in the Host user-settings document. */
|
|
2
|
+
import z from '@qilin-agent/schemastery';
|
|
3
|
+
/** Settings namespace owned by the locale plugin. */
|
|
4
|
+
export declare const LOCALE_SETTINGS_NAMESPACE = "locale";
|
|
5
|
+
/** Field carrying an explicit locale selection; absence delegates to the browser. */
|
|
6
|
+
export declare const LOCALE_PREFERENCE_FIELD = "preference";
|
|
7
|
+
/** Accepted BCP 47-style language ids. */
|
|
8
|
+
export declare const LOCALE_ID_PATTERN: RegExp;
|
|
9
|
+
/** Locale identifiers shipped by the browser client. */
|
|
10
|
+
export declare const LOCALE_IDS: readonly ["zh", "en"];
|
|
11
|
+
/** Locale identifier shipped by the browser client. */
|
|
12
|
+
export type BuiltInLocaleId = typeof LOCALE_IDS[number];
|
|
13
|
+
/** Open locale identifier accepted from language-pack plugins. */
|
|
14
|
+
export type LocaleId = string;
|
|
15
|
+
/** Durable locale section shared by the Host schema and the browser scope. */
|
|
16
|
+
export interface LocaleSettings {
|
|
17
|
+
/** Explicit locale selection; absence delegates to the browser. */
|
|
18
|
+
preference?: LocaleId;
|
|
19
|
+
}
|
|
20
|
+
/** Durable locale schema; also the wire envelope the browser scope validates against. */
|
|
21
|
+
export declare const LocaleSettingsSchema: z<LocaleSettings>;
|
|
22
|
+
//# sourceMappingURL=locale-settings.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** en base dictionary for the common namespace, checked complete against the zh key set. */
|
|
2
|
+
export declare const en: {
|
|
3
|
+
ok: string;
|
|
4
|
+
cancel: string;
|
|
5
|
+
close: string;
|
|
6
|
+
copy: string;
|
|
7
|
+
copied: string;
|
|
8
|
+
'copy.failed': string;
|
|
9
|
+
'copy.value': string;
|
|
10
|
+
'copy.json': string;
|
|
11
|
+
'copy.path': string;
|
|
12
|
+
'copy.prettyJson': string;
|
|
13
|
+
'copy.compactJson': string;
|
|
14
|
+
'copy.optionsHint': string;
|
|
15
|
+
retry: string;
|
|
16
|
+
loading: string;
|
|
17
|
+
'load.failed': string;
|
|
18
|
+
submit: string;
|
|
19
|
+
submitting: string;
|
|
20
|
+
next: string;
|
|
21
|
+
previous: string;
|
|
22
|
+
skip: string;
|
|
23
|
+
delete: string;
|
|
24
|
+
edit: string;
|
|
25
|
+
save: string;
|
|
26
|
+
search: string;
|
|
27
|
+
more: string;
|
|
28
|
+
collapse: string;
|
|
29
|
+
expand: string;
|
|
30
|
+
back: string;
|
|
31
|
+
'brand.localBuild': string;
|
|
32
|
+
unknown: string;
|
|
33
|
+
none: string;
|
|
34
|
+
truncated: string;
|
|
35
|
+
'json.label': string;
|
|
36
|
+
'markdown.footnotes': string;
|
|
37
|
+
'markdown.diagram': string;
|
|
38
|
+
'markdown.enlarged': string;
|
|
39
|
+
'markdown.truncatedCharacters': string;
|
|
40
|
+
'number.thousand': string;
|
|
41
|
+
'number.million': string;
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=en.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The common-namespace dictionary pair. zh is the source of truth for the
|
|
3
|
+
* key set (Chinese-first repo convention); en is checked complete against it
|
|
4
|
+
* — a missing or extra en key is a compile error.
|
|
5
|
+
*/
|
|
6
|
+
export { zh } from './zh.ts';
|
|
7
|
+
export { en } from './en.ts';
|
|
8
|
+
export type { CommonKey } from './zh.ts';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** zh base dictionary for the common namespace: cross-feature standard words. */
|
|
2
|
+
export declare const zh: {
|
|
3
|
+
ok: string;
|
|
4
|
+
cancel: string;
|
|
5
|
+
close: string;
|
|
6
|
+
copy: string;
|
|
7
|
+
copied: string;
|
|
8
|
+
'copy.failed': string;
|
|
9
|
+
'copy.value': string;
|
|
10
|
+
'copy.json': string;
|
|
11
|
+
'copy.path': string;
|
|
12
|
+
'copy.prettyJson': string;
|
|
13
|
+
'copy.compactJson': string;
|
|
14
|
+
'copy.optionsHint': string;
|
|
15
|
+
retry: string;
|
|
16
|
+
loading: string;
|
|
17
|
+
'load.failed': string;
|
|
18
|
+
submit: string;
|
|
19
|
+
submitting: string;
|
|
20
|
+
next: string;
|
|
21
|
+
previous: string;
|
|
22
|
+
skip: string;
|
|
23
|
+
delete: string;
|
|
24
|
+
edit: string;
|
|
25
|
+
save: string;
|
|
26
|
+
search: string;
|
|
27
|
+
more: string;
|
|
28
|
+
collapse: string;
|
|
29
|
+
expand: string;
|
|
30
|
+
back: string;
|
|
31
|
+
'brand.localBuild': string;
|
|
32
|
+
unknown: string;
|
|
33
|
+
none: string;
|
|
34
|
+
truncated: string;
|
|
35
|
+
'json.label': string;
|
|
36
|
+
'markdown.footnotes': string;
|
|
37
|
+
'markdown.diagram': string;
|
|
38
|
+
'markdown.enlarged': string;
|
|
39
|
+
'markdown.truncatedCharacters': string;
|
|
40
|
+
'number.thousand': string;
|
|
41
|
+
'number.million': string;
|
|
42
|
+
};
|
|
43
|
+
/** The common vocabulary key union (zh is the key-set source of truth). */
|
|
44
|
+
export type CommonKey = keyof typeof zh;
|
|
45
|
+
//# sourceMappingURL=zh.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,74 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qilin-agent/client-locale",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"description": "Locale plugin: Host-backed preference, extensible language catalog, browser fallback, and typed built-in dictionaries",
|
|
4
|
+
"version": "3.1.4",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/kkutysllb/QiLin.git",
|
|
11
|
+
"directory": "packages/client/locale"
|
|
12
|
+
},
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": "^22.19.0 || >=24.0.0"
|
|
15
|
+
},
|
|
16
|
+
"type": "module",
|
|
17
|
+
"main": "lib/index.js",
|
|
18
|
+
"types": "lib/types/index.d.ts",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./lib/types/index.d.ts",
|
|
22
|
+
"default": "./lib/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./client": {
|
|
25
|
+
"types": "./lib/types/client/index.d.ts",
|
|
26
|
+
"default": "./lib/client.js"
|
|
27
|
+
},
|
|
28
|
+
"./src/*": "./src/*",
|
|
29
|
+
"./package.json": "./package.json"
|
|
30
|
+
},
|
|
31
|
+
"qilin": {
|
|
32
|
+
"client": {
|
|
33
|
+
"inject": [
|
|
34
|
+
"@qilin-agent/client-connection",
|
|
35
|
+
"@qilin-agent/client-ui-renderer",
|
|
36
|
+
"@qilin-agent/client-ui-settings",
|
|
37
|
+
"@qilin-agent/api-remotes"
|
|
38
|
+
],
|
|
39
|
+
"platform": "web",
|
|
40
|
+
"immediately": true
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"license": "MIT",
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"@qilin-agent/kylin": "~4.0.3"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@types/react": "~18.3.1",
|
|
49
|
+
"react": "^18.2.0",
|
|
50
|
+
"@qilin-agent/kylin": "~4.0.3",
|
|
51
|
+
"@qilin-agent/api-remotes": "3.1.4",
|
|
52
|
+
"@qilin-agent/client-store": "3.1.4",
|
|
53
|
+
"@qilin-agent/client-test-runtime": "3.1.4",
|
|
54
|
+
"@qilin-agent/client-ui-primitives": "3.1.4",
|
|
55
|
+
"@qilin-agent/client-ui-renderer": "3.1.4",
|
|
56
|
+
"@qilin-agent/client-ui-slots": "3.1.4",
|
|
57
|
+
"@qilin-agent/package-manifest": "3.1.4",
|
|
58
|
+
"@qilin-agent/settings": "3.1.4",
|
|
59
|
+
"@qilin-agent/client-connection": "3.1.4",
|
|
60
|
+
"@qilin-agent/client-ui-settings": "3.1.4"
|
|
61
|
+
},
|
|
62
|
+
"dependencies": {
|
|
63
|
+
"@qilin-agent/schemastery": "~3.18.3"
|
|
64
|
+
},
|
|
65
|
+
"files": [
|
|
66
|
+
"lib/index.js",
|
|
67
|
+
"lib/client.js",
|
|
68
|
+
"lib/types/**/*.d.ts"
|
|
69
|
+
],
|
|
70
|
+
"scripts": {
|
|
71
|
+
"bundle": "tsdown",
|
|
72
|
+
"watch": "tsdown --watch"
|
|
73
|
+
}
|
|
6
74
|
}
|