mirror of
https://github.com/langgenius/webapp-conversation.git
synced 2025-12-08 09:12:29 +08:00
11 lines
505 B
Plaintext
11 lines
505 B
Plaintext
---
|
|
description: i18n usage and locale resolution
|
|
---
|
|
|
|
### i18n
|
|
|
|
- Server locale: `getLocaleOnServer()` reads cookie or negotiates from headers: `[i18n/server.ts](mdc:i18n/server.ts)`.
|
|
- Client locale: use `getLocaleOnClient()` / `setLocaleOnClient()` in `[i18n/client.ts](mdc:i18n/client.ts)`; uses `LOCALE_COOKIE_NAME` from config.
|
|
- Place translations in `i18n/lang/**`. Keep keys synchronized across locales.
|
|
- Render `<html lang>` using the resolved locale in `[app/layout.tsx](mdc:app/layout.tsx)`.
|