> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt ## Resource: Sample Flows ## Article: Sample Flows ## Article Link: https://dev.wix.com/docs/api-reference/business-management/multilingual/locale-management/locales/sample-flows.md ## Article Content: # Locales: Sample Flows This article presents some possible use cases you can support using the Locale API. This can be a helpful jumping off point as you plan your implementation. ## Implement a custom language switcher You can create a custom language switcher presented as a dropdown of available languages or regions for site visitors to select from. 1. Call [Query Locales](https://dev.wix.com/docs/api-reference/business-management/multilingual/locale-management/locales/query-locales.md) with `{ "visibility": "VISIBLE" }` to retrieve a list of all visible locales for the site. 1. Display the retrieved locales in your custom language switcher, showing each locale's `displayName` and `flag`. 1. When a site visitor selects a different language, use the locale's `id` and `effectiveUrlStructure` to construct the appropriate URL for the newly selected language version of the current page, and then redirect the visitor to that URL. ## Change primary locale You can change the site's primary locale, for example if headquarters relocates to a different country. 1. Call [List Supported Locales](https://dev.wix.com/docs/api-reference/business-management/multilingual/locale-management/locales/list-supported-locales.md) to see a list of all locales supported by Wix. 1. Choose a locale from the list and call [Get Locale](https://dev.wix.com/docs/api-reference/business-management/multilingual/locale-management/locales/get-locale.md) to ensure the locale doesn't already exist on the site as a secondary locale. If the locale already exists on the site, call [Delete Locale](https://dev.wix.com/docs/api-reference/business-management/multilingual/locale-management/locales/delete-locale.md) to remove it and its data. 2. Call [Create New Primary Locale](https://dev.wix.com/docs/api-reference/business-management/multilingual/locale-management/locales/create-new-primary-locale.md) to create and set the new primary locale. 3. Call [Get New Primary Locale Status](https://dev.wix.com/docs/api-reference/business-management/multilingual/locale-management/locales/get-new-primary-locale-status.md) with the token returned from the Create New Primary Locale method and monitor the progress of the change, and continue checking the status until the it returns either `FINISH_SUCCESSFUL` or `FINISH_WITH_ERROR`. 4. If the change is successful, update your app's UI to reflect the new primary locale. If there's an error, inform the Wix user and provide options for troubleshooting or retrying the operation.