@opencode-ai/ui 0.0.0-dev-202608040739 → 0.0.0-dev-202608040853
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/dist/context/i18n.d.ts +1 -0
- package/package.json +1 -1
- package/src/context/i18n.tsx +2 -1
package/dist/context/i18n.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export type UiI18nPluralLookupKey = `${UiI18nPluralKey}.${UiPluralCategory}`;
|
|
|
8
8
|
export type UiI18nParams = Record<string, string | number | boolean>;
|
|
9
9
|
export type UiI18n = {
|
|
10
10
|
locale: Accessor<string>;
|
|
11
|
+
layoutLocale?: Accessor<string>;
|
|
11
12
|
t: (key: UiI18nKey, params?: UiI18nParams) => string;
|
|
12
13
|
plural: (key: UiI18nPluralKey, count: number, params?: UiI18nParams) => string;
|
|
13
14
|
};
|
package/package.json
CHANGED
package/src/context/i18n.tsx
CHANGED
|
@@ -18,6 +18,7 @@ export type UiI18nParams = Record<string, string | number | boolean>
|
|
|
18
18
|
|
|
19
19
|
export type UiI18n = {
|
|
20
20
|
locale: Accessor<string>
|
|
21
|
+
layoutLocale?: Accessor<string>
|
|
21
22
|
t: (key: UiI18nKey, params?: UiI18nParams) => string
|
|
22
23
|
plural: (key: UiI18nPluralKey, count: number, params?: UiI18nParams) => string
|
|
23
24
|
}
|
|
@@ -60,7 +61,7 @@ const Context = createContext<UiI18n>(fallback)
|
|
|
60
61
|
|
|
61
62
|
function UiI18nProvider(props: ParentProps<{ value: UiI18n }>) {
|
|
62
63
|
return (
|
|
63
|
-
<I18nProvider locale={props.value.locale()}>
|
|
64
|
+
<I18nProvider locale={(props.value.layoutLocale ?? props.value.locale)()}>
|
|
64
65
|
<Context.Provider value={props.value}>{props.children}</Context.Provider>
|
|
65
66
|
</I18nProvider>
|
|
66
67
|
)
|