From 9cec2c2fddab5da9fc738c7d63793a932f18ac0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D5=A1=C9=A8=D5=BC=C9=A2=D3=84=D5=A1=D6=85=D5=BC=C9=A2?= Date: Thu, 25 Apr 2024 13:07:24 +0800 Subject: [PATCH] feat(docs): add example how to set locale --- .../docs/api-references/nextui-provider.mdx | 40 ++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/apps/docs/content/docs/api-references/nextui-provider.mdx b/apps/docs/content/docs/api-references/nextui-provider.mdx index 063ca19891..55b3117275 100644 --- a/apps/docs/content/docs/api-references/nextui-provider.mdx +++ b/apps/docs/content/docs/api-references/nextui-provider.mdx @@ -19,10 +19,48 @@ Here's the API reference for the `NextUIProvider`. ### locale -The locale to apply to the children. The [BCP47](https://www.ietf.org/rfc/bcp/bcp47.txt) language code for the locale. By default, It is `en-US`. +The locale to apply to the children. **type**: `string | undefined` +Here's the supported locales. By default, It is `en-US`. + +```tsx +const localeValues = [ + 'fr-FR', 'fr-CA', 'de-DE', 'en-US', 'en-GB', 'ja-JP', + 'da-DK', 'nl-NL', 'fi-FI', 'it-IT', 'nb-NO', 'es-ES', + 'sv-SE', 'pt-BR', 'zh-CN', 'zh-TW', 'ko-KR', 'bg-BG', + 'hr-HR', 'cs-CZ', 'et-EE', 'hu-HU', 'lv-LV', 'lt-LT', + 'pl-PL', 'ro-RO', 'ru-RU', 'sr-SP', 'sk-SK', 'sl-SI', + 'tr-TR', 'uk-UA', 'ar-AE', 'ar-DZ', 'AR-EG', 'ar-SA', + 'el-GR', 'he-IL', 'fa-AF', 'am-ET', 'hi-IN', 'th-TH' +]; +``` + +Here's an example to set a Spanish locale. + +```tsx +"use client"; + +import {type ReactNode} from "react"; +import {NextUIProvider} from "@nextui-org/react"; + +export function AppProvider(props: AppProviderProps) { + const {children, className} = props; + + return ( + + {children} + + ); +} + +interface AppProviderProps { + children: ReactNode; + className?: string; +} +``` + ### defaultDates The default dates range that can be selected in the calendar.