feat(docs): add bilingual package documentation site
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
---
|
||||
title: Localize UI
|
||||
description: Load only the UI catalog and calendar locale required by the active language.
|
||||
order: 21
|
||||
toc:
|
||||
- id: catalog-source
|
||||
title: Catalog source
|
||||
- id: direct-imports
|
||||
title: Direct imports
|
||||
- id: supported-locales
|
||||
title: Supported locales
|
||||
---
|
||||
|
||||
## Catalog source {#catalog-source}
|
||||
|
||||
Add the UI locale source to the application's internationalization configuration:
|
||||
|
||||
```json
|
||||
{
|
||||
"catalogSources": ["@workspace/ui/locales/{locale}"]
|
||||
}
|
||||
```
|
||||
|
||||
The locales root contains metadata and types. It does not import every language catalog.
|
||||
|
||||
## Direct imports {#direct-imports}
|
||||
|
||||
```ts
|
||||
import { calendarLocale, messages } from "@workspace/ui/locales/en-US"
|
||||
```
|
||||
|
||||
Each language entry also exports its matching `react-day-picker` locale.
|
||||
|
||||
## Supported locales {#supported-locales}
|
||||
|
||||
The UI catalogs include American English (`en-US`) and Simplified Chinese (`zh-Hans`).
|
||||
Reference in New Issue
Block a user