> 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 # CreateNewPrimaryLocale # Package: localeManagement # Namespace: LocalesService # Method link: https://dev.wix.com/docs/api-reference/business-management/multilingual/locale-management/locales/create-new-primary-locale.md ## Permission Scopes: Wix Multilingual: SCOPE.MULTILINGUAL.MANAGE_TRANSLATIONS ## Introduction Creates and assigns a new primary locale for a site. This method changes the site's primary locale. The process may take time, depending on the amount of content present on the site. When called, this method returns a token, which you can use with the Get New Primary Locale Status method to check the status of the primary locale change.
Important: - The desired new primary locale can't already exist as a secondary locale on the site. If the locale is already a secondary locale on the site, you must first remove it from the site by calling Delete Locale before changing the primary locale. - This method automatically deletes the original primary locale and transfers its data to the new primary locale.--- ## REST API ### Schema ``` Method: createNewPrimaryLocale Description: Creates and assigns a new primary locale for a site. This method changes the site's primary locale. The process may take time, depending on the amount of content present on the site. When called, this method returns a token, which you can use with the Get New Primary Locale Status method to check the status of the primary locale change.
Important: - The desired new primary locale can't already exist as a secondary locale on the site. If the locale is already a secondary locale on the site, you must first remove it from the site by calling Delete Locale before changing the primary locale. - This method automatically deletes the original primary locale and transfers its data to the new primary locale.URL: https://www.wixapis.com/v2/locale/change-primary Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: primaryLocale Method parameters: param name: primaryLocale | type: Locale | required: true - name: languageCode | type: string | description: Language code. For example, `"en"` for English. - name: regionCode | type: string | description: Region code. For example, `"UK"` for United Kingdom. - name: visibility | type: LocaleVisibility | description: Locale visibility status. - enum: - HIDDEN: Locale is hidden from site visitors. A site's locale should be hidden when a translation is not ready to be exposed to visitors. - VISIBLE: Locale is visible to site visitors. A site can only have up to 100 visible locales. - name: flag | type: string | description: Flag icon as a 3-letter language code based on Wix's supported locales. For example, `"USA"` for the United States flag icon. - name: regionalFormat | type: string | description: Regional format for determining how to display data types such as dates, times, numbers, and currencies. For example, `"en-US"` to format dates like this: `MM-DD-YYYY`. - name: urlStructureOverride | type: UrlStructureOverride | description: Optional override for the locale's default URL structure. - name: urlStructure | type: UrlStructure | description: URL structure to use instead of the default. - enum: - SUBDIRECTORY: URL structure as a subdirectory. For example, `"www.mysite.com/fr"`. - SUBDOMAIN: URL structure as a subdomain. For example, `"fr.mysite.com"`. - QUERY_PARAM: URL structure as a query parameter. For example, `"www.mysite.com?lang=fr"`. - name: machineTranslationCode | type: string | description: Language code based on Wix's supported locales, used to specify the target language when translatable content is sent for machine translation. For example, `"ES"` for Spanish or `"ZH_TW"` for Traditional Chinese. Default: The locale's `languageCode` value. - name: overrideDisplayName | type: string | description: Optional override for the locale's display name. Return type: CreateNewPrimaryLocaleResponse - name: token | type: string | description: Possible Errors: HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: NEW_MAIN_LOCALE_EXIST_ON_SITE | Description: The specified locale already exists as a secondary locale on the site. ``` ### Examples ### Create New Primary Locale ```curl curl -X POST \ 'https://www.wixapis.com/locales/v2/locale/change-primary' \ -H 'Authorization:
Important: - The desired new primary locale can't already exist as a secondary locale on the site. If the locale is already a secondary locale on the site, you must first remove it from the site by calling Delete Locale before changing the primary locale. - This method automatically deletes the original primary locale and transfers its data to the new primary locale.# Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: primaryLocale Method parameters: param name: primaryLocale | type: Locale | required: true - name: languageCode | type: string | description: Language code. For example, `"en"` for English. - name: regionCode | type: string | description: Region code. For example, `"UK"` for United Kingdom. - name: visibility | type: LocaleVisibility | description: Locale visibility status. - enum: - HIDDEN: Locale is hidden from site visitors. A site's locale should be hidden when a translation is not ready to be exposed to visitors. - VISIBLE: Locale is visible to site visitors. A site can only have up to 100 visible locales. - name: flag | type: string | description: Flag icon as a 3-letter language code based on Wix's supported locales. For example, `"USA"` for the United States flag icon. - name: regionalFormat | type: string | description: Regional format for determining how to display data types such as dates, times, numbers, and currencies. For example, `"en-US"` to format dates like this: `MM-DD-YYYY`. - name: urlStructureOverride | type: UrlStructureOverride | description: Optional override for the locale's default URL structure. - name: urlStructure | type: UrlStructure | description: URL structure to use instead of the default. - enum: - SUBDIRECTORY: URL structure as a subdirectory. For example, `"www.mysite.com/fr"`. - SUBDOMAIN: URL structure as a subdomain. For example, `"fr.mysite.com"`. - QUERY_PARAM: URL structure as a query parameter. For example, `"www.mysite.com?lang=fr"`. - name: machineTranslationCode | type: string | description: Language code based on Wix's supported locales, used to specify the target language when translatable content is sent for machine translation. For example, `"ES"` for Spanish or `"ZH_TW"` for Traditional Chinese. Default: The locale's `languageCode` value. - name: overrideDisplayName | type: string | description: Optional override for the locale's display name. Return type: PROMISE