> For the complete documentation index, see [llms.txt](https://kotus.gitbook.io/saas-starter-kit/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kotus.gitbook.io/saas-starter-kit/components/locale-switcher.md).

# LocaleSwitcher

## Description

The `LocaleSwitcher` component allows users to switch between different locales (languages) in the application.

## Example Usage

```typescript
import { LocaleSwitcher } from '@/src/components/locale-switcher';

function App() {
  return (
    <div>
      <LocaleSwitcher />
      {/* Other components */}
    </div>
  );
}
```

## How It Works

1. **Dropdown Menu**: The component renders a dropdown menu with available locales.
2. **Locale Change Handling**: When a locale is selected, the `handleLocaleChange` function is called to update the application's locale.
3. **Flag Icons**: Each locale option is displayed with a corresponding flag icon.
4. **Automatic Locale Configuration**: All available locales are automatically derived from the `const locales` configuration in `@/src/i18n/routing`.

## Locale Configuration

The available locales are defined in the `@/src/i18n/routing` file. This configuration is used throughout the application to ensure consistency.
