# UI: UiProvider

> Setzt die Locale der Komponenten und ihrer eigenen Texte.

Source: https://pithyx.org/de/docs/reference/sdk/ui/ui-provider/
Markdown: https://pithyx.org/de/docs/reference/sdk/ui/ui-provider.md

Setzt die Locale der Komponenten und ihrer eigenen Texte. Importiere die Token-Datei einmal (`@pithyx/ui/tokens.css`) und umschließe die App mit `UiProvider`; siehe [@pithyx/ui](https://pithyx.org/de/docs/sdk/ui/).

Beim Build aus den TSDoc-Kommentaren von @pithyx/ui 1.0.0-rc.9 erzeugt; der Text unter den Überschriften ist der Kommentar im Quelltext und bleibt Englisch.

## Schnittstellen

### UiProviderProps

The props of [UiProvider](#uiprovider).

#### Eigenschaften

##### locale

```ts
locale: string;
```

A BCP 47 tag such as `de-AT`. Dates and numbers follow it; the texts follow its language.

##### children

```ts
children: ReactNode;
```

The app, or the part of it that uses the locale.

## Funktionen

### UiProvider()

```ts
function UiProvider(props): Element;
```

Sets the language of the components below it: React Aria's formatting and announcements, and the package's own
texts (English and German; English for any other language). Without it, both follow the browser.

#### Parameter

| Parameter | Typ                                   | Beschreibung                            |
| --------- | ------------------------------------- | --------------------------------------- |
| `props`   | [`UiProviderProps`](#uiproviderprops) | The locale and the components below it. |

#### Rückgabewert

`Element`

React Aria's `I18nProvider` with the locale.

#### Beispiel

```tsx
<UiProvider locale={app.context.locale}>
  <App />
</UiProvider>
```
