mirror of
https://github.com/anomalyco/opencode.git
synced 2026-02-01 22:48:16 +00:00
chore: generate
This commit is contained in:
@@ -163,6 +163,7 @@ Completed (2026-01-20):
|
||||
### 15) File Load Failure Toast (Duplicate)
|
||||
|
||||
Files:
|
||||
|
||||
- `packages/app/src/context/file.tsx`
|
||||
- `packages/app/src/context/local.tsx`
|
||||
|
||||
@@ -220,13 +221,17 @@ Also reuse existing command keys for tooltip titles whenever possible (e.g. `com
|
||||
## Appendix: Remaining Files At-a-Glance
|
||||
|
||||
Pages:
|
||||
|
||||
- (none)
|
||||
|
||||
Components:
|
||||
|
||||
- (none)
|
||||
|
||||
Context:
|
||||
|
||||
- (none)
|
||||
|
||||
Utils:
|
||||
|
||||
- (none)
|
||||
|
||||
@@ -27,7 +27,7 @@ Why this is the best long-term shape:
|
||||
|
||||
### Proposed Architecture
|
||||
|
||||
1) **UI provides an i18n context (no persistence)**
|
||||
1. **UI provides an i18n context (no persistence)**
|
||||
|
||||
- Add `packages/ui/src/context/i18n.tsx`:
|
||||
- Exports `I18nProvider` and `useI18n()`.
|
||||
@@ -36,14 +36,14 @@ Why this is the best long-term shape:
|
||||
- `locale()` accessor for locale-sensitive formatting (Luxon/Intl).
|
||||
- Context should have a safe default (English) so UI components can render even if a consumer forgets the provider.
|
||||
|
||||
2) **UI owns UI strings (dictionaries live in UI)**
|
||||
2. **UI owns UI strings (dictionaries live in UI)**
|
||||
|
||||
- Add `packages/ui/src/i18n/en.ts` and `packages/ui/src/i18n/zh.ts`.
|
||||
- Export them from `@opencode-ai/ui` via `packages/ui/package.json` exports (e.g. `"./i18n/*": "./src/i18n/*.ts"`).
|
||||
- Use a clear namespace prefix for all UI keys to avoid collisions:
|
||||
- Recommended: `ui.*` (e.g. `ui.sessionReview.title`).
|
||||
|
||||
3) **Consumers merge dictionaries and provide `t`/`locale` once**
|
||||
3. **Consumers merge dictionaries and provide `t`/`locale` once**
|
||||
|
||||
- `packages/app/`:
|
||||
- Keep `packages/app/src/context/language.tsx` as the source of truth for locale selection/persistence.
|
||||
|
||||
Reference in New Issue
Block a user