diff --git a/includes/RestApi/RestApi.php b/includes/RestApi/RestApi.php index 1fc377c16..0ad914434 100644 --- a/includes/RestApi/RestApi.php +++ b/includes/RestApi/RestApi.php @@ -33,7 +33,6 @@ final class RestApi { 'NewfoldLabs\\WP\\Module\\Onboarding\\RestApi\\SiteClassificationController', 'NewfoldLabs\\WP\\Module\\Onboarding\\RestApi\\SiteGenController', 'NewfoldLabs\\WP\\Module\\Onboarding\\RestApi\\PreviewsController', - 'NewfoldLabs\\WP\\Module\\Onboarding\\RestApi\\LanguagesController', 'NewfoldLabs\\WP\\Module\\Onboarding\\RestApi\\DesignController', 'NewfoldLabs\\WP\\Module\\Onboarding\\RestApi\\GlobalStylesController', ); diff --git a/includes/RestApi/SiteGenController.php b/includes/RestApi/SiteGenController.php index 8fc729461..b91b18e5c 100644 --- a/includes/RestApi/SiteGenController.php +++ b/includes/RestApi/SiteGenController.php @@ -6,6 +6,7 @@ use NewfoldLabs\WP\Module\Onboarding\Data\Services\SiteGenService as LegacySiteGenService; use NewfoldLabs\WP\Module\Onboarding\Data\SiteGen as SiteGenData; use NewfoldLabs\WP\Module\Onboarding\Services\Ai\ContentGeneration\SitekitsContentGeneration; +use NewfoldLabs\WP\Module\Onboarding\Services\LanguageService; use NewfoldLabs\WP\Module\Onboarding\Services\SiteGenService; use NewfoldLabs\WP\Module\Onboarding\Services\SiteNavigationService; @@ -121,10 +122,6 @@ public function sitegen_meta_args() { 'required' => true, 'type' => 'string', ), - 'locale' => array( - 'required' => true, - 'type' => 'string', - ), 'skip_cache' => array( 'required' => false, 'type' => 'boolean', @@ -148,10 +145,6 @@ public function get_homepages_args() { 'required' => true, 'type' => 'string', ), - 'locale' => array( - 'required' => true, - 'type' => 'string', - ), ); } @@ -235,9 +228,9 @@ public function generate_sitegen_meta( \WP_REST_Request $request ) { } $site_info = $request->get_param( 'site_info' ); - $identifier = $request->get_param( 'identifier' ); + $identifier = $request->get_param( 'identifier' ); $site_type = $request->get_param( 'site_type' ); - $locale = $request->get_param( 'locale' ); + $locale = LanguageService::get_site_locale(); $skip_cache = $request->get_param( 'skip_cache' ); return LegacySiteGenService::instantiate_site_meta( @@ -264,7 +257,7 @@ public function get_homepages( \WP_REST_Request $request ) { $site_description = $request->get_param( 'site_description' ); $site_info = array( 'site_description' => $site_description ); $site_type = $request->get_param( 'site_type' ); - $locale = $request->get_param( 'locale' ); + $locale = LanguageService::get_site_locale(); $homepages = []; if ( SitekitsContentGeneration::site_type_supported( $site_type ) ) { @@ -272,7 +265,6 @@ public function get_homepages( \WP_REST_Request $request ) { $homepages = $siteGenService->get_sitekits( $site_description, $site_type, - $locale, true ); @@ -315,7 +307,7 @@ public function regenerate_homepage( \WP_REST_Request $request ) { $color_palette = $request->get_param( 'palette' ); $is_favorite = $request->get_param( 'isFavorite' ); $site_info = array( 'site_description' => $site_description ); - $locale = $request->get_param( 'locale' ); + $locale = LanguageService::get_site_locale(); $skip_cache = $request->get_param( 'skip_cache' ); $target_audience = LegacySiteGenService::instantiate_site_meta( $site_info, 'target_audience', $locale, $skip_cache ); @@ -356,7 +348,7 @@ public function publish_sitemap_pages( \WP_REST_Request $request ) { $site_description = $request->get_param( 'site_description' ); $site_info = array( 'site_description' => $site_description ); $site_type = $request->get_param( 'site_type' ); - $locale = $request->get_param( 'locale' ); + $locale = LanguageService::get_site_locale(); $skip_cache = $request->get_param( 'skip_cache' ); $target_audience = LegacySiteGenService::instantiate_site_meta( $site_info, 'target_audience', $site_type, $locale, $skip_cache ); diff --git a/includes/Services/Ai/ContentGeneration/ContentGenerationPrompt.php b/includes/Services/Ai/ContentGeneration/ContentGenerationPrompt.php index 9727e30ea..6b87b93f8 100644 --- a/includes/Services/Ai/ContentGeneration/ContentGenerationPrompt.php +++ b/includes/Services/Ai/ContentGeneration/ContentGenerationPrompt.php @@ -13,6 +13,7 @@ use NewfoldLabs\WP\Module\AI\SiteGen\SiteGen; use NewfoldLabs\WP\Module\Onboarding\Data\Services\SiteGenService as LegacySiteGenService; +use NewfoldLabs\WP\Module\Onboarding\Services\LanguageService; /** * Content Generation Prompt Class @@ -36,13 +37,6 @@ class ContentGenerationPrompt { */ private $site_type; - /** - * The locale/language code for the site. - * - * @var string - */ - private $locale; - /** * The required site meta dependencies. * @@ -59,14 +53,12 @@ class ContentGenerationPrompt { * * @param string $site_description The user-provided site description. * @param string $site_type The type of site (e.g., 'business', 'personal', 'ecommerce', 'linkinbio'). - * @param string $locale The locale/language code for the site. */ - public function __construct( $site_description, $site_type, $locale ) { - $this->validate_input( $site_description, $site_type, $locale ); + public function __construct( $site_description, $site_type ) { + $this->validate_input( $site_description, $site_type ); $this->site_description = trim( $site_description ); $this->site_type = trim( $site_type ); - $this->locale = trim( $locale ); } /** @@ -74,11 +66,10 @@ public function __construct( $site_description, $site_type, $locale ) { * * @param string $site_description The site description. * @param string $site_type The site type. - * @param string $locale The locale. * * @throws \Exception If any parameter is empty. */ - private function validate_input( $site_description, $site_type, $locale ) { + private function validate_input( $site_description, $site_type ) { if ( empty( $site_description ) ) { throw new \Exception( 'Site description cannot be empty' ); } @@ -86,10 +77,6 @@ private function validate_input( $site_description, $site_type, $locale ) { if ( empty( $site_type ) ) { throw new \Exception( 'Site type cannot be empty' ); } - - if ( empty( $locale ) ) { - throw new \Exception( 'Locale cannot be empty' ); - } } /** @@ -113,7 +100,7 @@ private function get_meta_response( $site_meta_dependency ): array { $this->site_description, $site_meta_dependency, $this->site_type, - $this->locale + LanguageService::get_site_locale() ); if ( is_wp_error( $response ) ) { diff --git a/includes/Services/Ai/ContentGeneration/SitekitsContentGeneration.php b/includes/Services/Ai/ContentGeneration/SitekitsContentGeneration.php index ec3eb582d..4b9b0c7ef 100644 --- a/includes/Services/Ai/ContentGeneration/SitekitsContentGeneration.php +++ b/includes/Services/Ai/ContentGeneration/SitekitsContentGeneration.php @@ -2,6 +2,7 @@ namespace NewfoldLabs\WP\Module\Onboarding\Services\Ai\ContentGeneration; +use NewfoldLabs\WP\Module\Onboarding\Services\LanguageService; use NewfoldLabs\WP\Module\Onboarding\Services\SiteGenService; use NewfoldLabs\WP\Module\Onboarding\Services\SiteTypes\EcommerceSiteTypeService; use NewfoldLabs\WP\Module\Onboarding\Services\SiteTypes\CommonSiteTypeService; @@ -23,13 +24,6 @@ class SitekitsContentGeneration { */ private $site_type; - /** - * The locale. - * - * @var string - */ - private $locale; - /** * The prompt. * @@ -48,13 +42,11 @@ class SitekitsContentGeneration { * Constructor. * * @param string $site_type The site type. - * @param string $locale The locale. * @param ContentGenerationPrompt $prompt The prompt. * @param SiteClassification $site_classification The site classification. */ - public function __construct( string $site_type, string $locale, ContentGenerationPrompt $prompt, SiteClassification $site_classification ) { + public function __construct( string $site_type, ContentGenerationPrompt $prompt, SiteClassification $site_classification ) { $this->site_type = $site_type; - $this->locale = $locale; $this->prompt = $prompt; $this->site_classification = $site_classification; } @@ -71,7 +63,7 @@ public function generate_sitekits( int $count = 3 ) { 'siteType' => $this->site_type, 'count' => $count, 'prompt' => $prompt, - 'locale' => $this->locale, + 'locale' => LanguageService::get_site_locale(), 'primaryType' => $this->site_classification->get_primary_type(), 'secondaryType' => $this->site_classification->get_secondary_type(), ); diff --git a/includes/Services/LanguageService.php b/includes/Services/LanguageService.php index 39cf0e3c3..7688588ed 100644 --- a/includes/Services/LanguageService.php +++ b/includes/Services/LanguageService.php @@ -2,6 +2,8 @@ namespace NewfoldLabs\WP\Module\Onboarding\Services; +use NewfoldLabs\WP\Module\Onboarding\Data\Languages; + /** * Class LanguageService * @@ -10,92 +12,16 @@ class LanguageService { /** - * Get all available languages including the default English. + * Get the site locale. * - * @return array List of language data + * @return string The site locale. */ - public static function get_all_languages() { - // Load translation-install.php if the function doesn't exist - if ( ! function_exists( 'wp_get_available_translations' ) ) { - require_once ABSPATH . 'wp-admin/includes/translation-install.php'; - } - - // Get all available translations from WordPress API - $translations = \wp_get_available_translations(); - - // If translations API fails, provide basic fallback - if ( empty( $translations ) ) { - return self::get_fallback_languages(); + public static function get_site_locale(): string { + $locale = Languages::get_default_language(); + if ( ! $locale ) { + // Fallback to en_US if no default language is found. + $locale = 'en_US'; } - - // Format data for response - include English as default - $formatted_languages = array( - array( - 'code' => 'en_US', - 'name' => 'English (United States)', - 'native_name' => 'English (United States)', - ), - ); - - // Add translated languages with proper format - foreach ( $translations as $locale => $translation ) { - $formatted_languages[] = array( - 'code' => $locale, - 'name' => $translation['english_name'], - 'native_name' => $translation['native_name'], - ); - } - - return $formatted_languages; - } - - /** - * Get language data array formatted for the language selection component. - * Returns array of [language_name, language_code] pairs. - * - * @return array Array of language name and code pairs - */ - public static function get_languages_for_selection() { - $languages = self::get_all_languages(); - $language_list = array(); - - foreach ( $languages as $language ) { - $language_list[] = array( - $language['name'], - $language['code'], - ); - } - - return $language_list; - } - - /** - * Get fallback languages in case the translations API fails. - * - * @return array Basic list of language data - */ - private static function get_fallback_languages() { - return array( - array( - 'code' => 'en_US', - 'name' => 'English (United States)', - 'native_name' => 'English (United States)', - ), - array( - 'code' => 'es_ES', - 'name' => 'Spanish (Spain)', - 'native_name' => 'Español', - ), - array( - 'code' => 'fr_FR', - 'name' => 'French (France)', - 'native_name' => 'Français', - ), - array( - 'code' => 'de_DE', - 'name' => 'German', - 'native_name' => 'Deutsch', - ), - ); + return $locale; } } diff --git a/includes/Services/SiteGenService.php b/includes/Services/SiteGenService.php index 9af59a2dc..52b6e02a5 100644 --- a/includes/Services/SiteGenService.php +++ b/includes/Services/SiteGenService.php @@ -71,15 +71,14 @@ public static function get_instance(): SiteGenService { * * @param string $site_description The site description. * @param string $site_type The site type. - * @param string $locale The locale. * @param bool $for_onboarding_preview Whether to return the sitekits as array for onboarding preview. * @return array|\WP_Error Array of Sitekit objects, array of sitekits for onboarding preview, or WP_Error if there is an error. */ - public function get_sitekits( string $site_description, string $site_type, string $locale = 'en_US', bool $for_onboarding_preview = false ) { - $prompt = new ContentGenerationPrompt( $site_description, $site_type, $locale ); + public function get_sitekits( string $site_description, string $site_type, bool $for_onboarding_preview = false ) { + $prompt = new ContentGenerationPrompt( $site_description, $site_type ); $site_classification = $this->get_site_classification(); - $sitekits = new SitekitsContentGeneration( $site_type, $locale, $prompt, $site_classification ); + $sitekits = new SitekitsContentGeneration( $site_type, $prompt, $site_classification ); $sitekits = $sitekits->generate_sitekits(); // If there is an error, return it. @@ -159,7 +158,7 @@ public function publish_homepage( string $selected_sitegen_homepage ) { */ public function get_sitemap_page_title( string $slug ) { $prompt = $this->get_prompt(); - $locale = $this->get_locale(); + $locale = LanguageService::get_site_locale(); $site_type = $this->get_site_type(); if ( ! $prompt || ! $locale || ! $site_type ) { return false; @@ -190,7 +189,7 @@ public function get_site_classification(): SiteClassification { $this->get_prompt(), 'site_classification', $this->get_site_type(), - $this->get_locale() + LanguageService::get_site_locale() ); if ( is_array( $site_classification ) ) { @@ -211,7 +210,7 @@ public function get_color_palette() { $this->get_prompt(), 'color_palette', $this->get_site_type(), - $this->get_locale() + LanguageService::get_site_locale() ); if ( ! is_array( $color_palettes ) ) { @@ -254,13 +253,4 @@ public function get_prompt() { public function get_site_type() { return ! empty( $this->input_data['siteType'] ) ? $this->input_data['siteType'] : 'business'; } - - /** - * Get the locale entered during Onboarding. - * - * @return string - */ - public function get_locale() { - return ! empty( $this->input_data['locale'] ) ? $this->input_data['locale'] : 'en_US'; - } } diff --git a/includes/Services/SiteNavigationService.php b/includes/Services/SiteNavigationService.php index 902398037..845efb0e9 100644 --- a/includes/Services/SiteNavigationService.php +++ b/includes/Services/SiteNavigationService.php @@ -45,7 +45,7 @@ public function get_site_navigation_items( $site_type = null ): array { $this->get_prompt(), 'sitemap', $site_type, - $this->get_locale() + LanguageService::get_site_locale() ); $nav_items = array(); diff --git a/src/app/data/store/slices/input.js b/src/app/data/store/slices/input.js index 870ac8311..2fe8badc6 100644 --- a/src/app/data/store/slices/input.js +++ b/src/app/data/store/slices/input.js @@ -4,7 +4,6 @@ import { updateOnboardingInputSlice } from '@/utils/api'; const DEFAULT_STATE = { siteTitle: '', - selectedLocale: '', prompt: '', logo: '', experienceLevel: '', @@ -30,11 +29,6 @@ export function input( state = DEFAULT_STATE, action ) { ...state, siteTitle: action.siteTitle, }; - case 'SET_SELECTED_LOCALE': - return { - ...state, - selectedLocale: action.selectedLocale, - }; case 'SET_PROMPT': return { ...state, @@ -77,10 +71,6 @@ export const actions = { type: 'SET_SITE_TITLE', siteTitle, } ), - setSelectedLocale: ( selectedLocale ) => ( { - type: 'SET_SELECTED_LOCALE', - selectedLocale, - } ), setPrompt: ( prompt ) => ( { type: 'SET_PROMPT', prompt, @@ -105,7 +95,6 @@ export const actions = { export const selectors = { getInputSlice: ( state ) => state.input, getSiteTitle: ( state ) => state.input.siteTitle, - getSelectedLocale: ( state ) => state.input.selectedLocale, getPrompt: ( state ) => state.input.prompt, getLogo: ( state ) => state.input.logo, getExperienceLevel: ( state ) => state.input.experienceLevel, diff --git a/src/app/data/store/slices/runtime.js b/src/app/data/store/slices/runtime.js index 4fe09ea24..049113423 100644 --- a/src/app/data/store/slices/runtime.js +++ b/src/app/data/store/slices/runtime.js @@ -117,6 +117,17 @@ export const selectors = { return Object.values( state.runtime.languages ); }, + /** + * Gets the current locale. + * + * @param {*} state + * @return {string} locale + */ + getLocale( state ) { + const languages = Object.values( state.runtime.languages ); + return languages.find( ( language ) => language.is_default )?.locale || 'en_US'; + }, + /** * Gets all available sitegen identifiers. * diff --git a/src/app/steps/Intake/IntakeStep.js b/src/app/steps/Intake/IntakeStep.js index b85193cb3..40371b4a6 100644 --- a/src/app/steps/Intake/IntakeStep.js +++ b/src/app/steps/Intake/IntakeStep.js @@ -6,17 +6,16 @@ import { Navigate, Step } from '@/components'; import { nfdOnboardingStore } from '@/data/store'; import { OnboardingEvent, trackOnboardingEvent } from '@/utils/analytics/hiive'; import { ACTION_INTAKE_PROMPT_SET, ACTION_SITE_TYPE_SET } from '@/utils/analytics/hiive/constants'; -import { SiteTitleInput, PromptInput, LanguageSelector, calculatePromptStrength, SiteTypeSelector } from '.'; +import { SiteTitleInput, PromptInput, calculatePromptStrength, SiteTypeSelector } from '.'; const IntakeStep = () => { // Initiale state values. - const { siteType, siteTitle, selectedLocale, prompt } = select( nfdOnboardingStore ).getInputSlice(); + const { siteType, siteTitle, prompt } = select( nfdOnboardingStore ).getInputSlice(); const retryMode = select( nfdOnboardingStore ).getRetryMode(); // Step states. const [ siteTypeValue, setSiteTypeValue ] = useState( siteType ); const [ siteTitleValue, setSiteTitleValue ] = useState( siteTitle ); - const [ selectedLocaleValue, setSelectedLocaleValue ] = useState( selectedLocale ); const [ promptValue, setPromptValue ] = useState( prompt ); /** @@ -39,7 +38,6 @@ const IntakeStep = () => { dispatch( nfdOnboardingStore ).setInputSlice( { siteType: siteTypeValue, siteTitle: siteTitleValue.trim(), - selectedLocale: selectedLocaleValue, prompt: promptValue.trim(), } ); @@ -96,10 +94,9 @@ const IntakeStep = () => {
+ -
-
diff --git a/src/app/steps/Intake/LanguageSelector.js b/src/app/steps/Intake/LanguageSelector.js deleted file mode 100644 index 4ea8f1cb6..000000000 --- a/src/app/steps/Intake/LanguageSelector.js +++ /dev/null @@ -1,58 +0,0 @@ -import { SelectField } from '@newfold/ui-component-library'; -import { useSelect } from '@wordpress/data'; -import { nfdOnboardingStore } from '@/data/store'; - -const LanguageSelector = ( { value, onChange } ) => { - const [ selectedLanguage, setSelectedLanguage ] = useState( null ); - // Get languages data. - const { languages } = useSelect( ( select ) => { - return { - languages: select( nfdOnboardingStore ).getLanguages(), - }; - } ); - - // Get the initial language. - const getInitialLanguage = () => { - let initialLanguage = null; - if ( value ) { - initialLanguage = languages.find( ( language ) => language.locale === value ); - } - if ( ! initialLanguage ) { - initialLanguage = languages.find( ( language ) => language.is_default ); - onChange( initialLanguage.locale ); - } - return initialLanguage; - }; - - const handleLanguageChange = ( updatedValue ) => { - const updatedLanguage = languages.find( ( language ) => language.locale === updatedValue ); - setSelectedLanguage( updatedLanguage ); - onChange( updatedLanguage.locale ); - }; - - const languageOptions = languages.map( ( language ) => { - return ( - - ); - } ); - - return ( -
- - { languageOptions } - -
- ); -}; - -export default LanguageSelector; diff --git a/src/app/steps/Intake/index.js b/src/app/steps/Intake/index.js index 35beca1fa..c10e7d2ec 100644 --- a/src/app/steps/Intake/index.js +++ b/src/app/steps/Intake/index.js @@ -1,6 +1,5 @@ export { default as IntakeStep } from './IntakeStep'; export { default as SiteTitleInput } from './SiteTitleInput'; export { default as PromptInput } from './PromptInput'; -export { default as LanguageSelector } from './LanguageSelector'; export { default as calculatePromptStrength } from './calculatePromptStrength'; export { default as SiteTypeSelector } from './SiteTypeSelector'; diff --git a/src/app/utils/api/onboarding.js b/src/app/utils/api/onboarding.js index 3a00f5577..9ed83cc75 100644 --- a/src/app/utils/api/onboarding.js +++ b/src/app/utils/api/onboarding.js @@ -143,7 +143,6 @@ export const setGlobalStylesColorPalette = async ( colorPalette ) => { * @param {string} identifier * @param {string} prompt * @param {string} siteType - * @param {string} locale * @param {boolean} skipCache * @return {Promise} response */ @@ -151,7 +150,6 @@ export async function getSiteMetaForIdentifier( identifier, prompt, siteType, - locale, skipCache = true ) { const response = await resolve( @@ -162,7 +160,6 @@ export async function getSiteMetaForIdentifier( site_info: prompt, identifier, site_type: siteType, - locale, skip_cache: skipCache, }, } ) @@ -176,10 +173,9 @@ export async function getSiteMetaForIdentifier( * * @param {string} prompt * @param {string} siteType - * @param {string} locale * @return {Promise} response */ -export async function getHomepages( prompt, siteType, locale ) { +export async function getHomepages( prompt, siteType ) { const response = await resolve( apiFetch( { url: onboardingRestURL( 'sitegen/homepages' ), @@ -187,7 +183,6 @@ export async function getHomepages( prompt, siteType, locale ) { data: { site_description: prompt, site_type: siteType, - locale, }, } ) ); @@ -200,10 +195,9 @@ export async function getHomepages( prompt, siteType, locale ) { * * @param {string} prompt * @param {string} siteType - * @param {string} locale * @return {Promise} response */ -export async function getSitePages( prompt, siteType, locale ) { +export async function getSitePages( prompt, siteType ) { return await resolve( apiFetch( { url: onboardingRestURL( 'sitegen/pages/sitemap' ), @@ -211,7 +205,6 @@ export async function getSitePages( prompt, siteType, locale ) { data: { site_description: prompt, site_type: siteType, - locale, }, } ).then() ); diff --git a/src/app/utils/sitegen/generateHomePages.js b/src/app/utils/sitegen/generateHomePages.js index 9950b3e7a..0da6c0900 100644 --- a/src/app/utils/sitegen/generateHomePages.js +++ b/src/app/utils/sitegen/generateHomePages.js @@ -11,10 +11,9 @@ import { ACTION_ERROR_STATE_TRIGGERED } from '@/utils/analytics/hiive/constants' */ const generateHomePages = async () => { const prompt = select( nfdOnboardingStore ).getPrompt(); - const locale = select( nfdOnboardingStore ).getSelectedLocale(); const siteType = select( nfdOnboardingStore ).getSiteType(); - const response = await getHomepages( prompt, siteType, locale ); + const response = await getHomepages( prompt, siteType ); if ( response.error ) { trackOnboardingEvent( new OnboardingEvent( diff --git a/src/app/utils/sitegen/generateSiteMeta.js b/src/app/utils/sitegen/generateSiteMeta.js index b81beeae1..911892729 100644 --- a/src/app/utils/sitegen/generateSiteMeta.js +++ b/src/app/utils/sitegen/generateSiteMeta.js @@ -6,7 +6,7 @@ import { getSiteMetaForIdentifier } from '@/utils/api/onboarding'; import { OnboardingEvent, trackOnboardingEvent } from '@/utils/analytics/hiive'; import { ACTION_ERROR_STATE_TRIGGERED } from '@/utils/analytics/hiive/constants'; -const handleFetch = async ( identifier, siteInfo, siteType, locale ) => { +const handleFetch = async ( identifier, siteInfo, siteType ) => { let response; const maxRetries = 3; let retryCount = 0; @@ -16,7 +16,7 @@ const handleFetch = async ( identifier, siteInfo, siteType, locale ) => { while ( retryCount < maxRetries ) { retryCount++; - response = await getSiteMetaForIdentifier( identifier, siteInfo, siteType, locale ); + response = await getSiteMetaForIdentifier( identifier, siteInfo, siteType ); if ( response.error ) { // Exponential backoff await delay( 500 * retryCount ); @@ -64,7 +64,6 @@ const setSiteTagline = async ( tagline ) => { const generateSiteMeta = async () => { const identifiers = select( nfdOnboardingStore ).getSiteGenIdentifiers(); const prompt = select( nfdOnboardingStore ).getPrompt(); - const locale = select( nfdOnboardingStore ).getSelectedLocale(); const siteType = select( nfdOnboardingStore ).getSiteType(); /** * Todo: the site meta api expects an object, but the prompt is a string. @@ -77,7 +76,7 @@ const generateSiteMeta = async () => { try { const siteMetaCalls = identifiers.map( async ( identifier ) => { - const response = await handleFetch( identifier, siteInfo, siteType, locale ); + const response = await handleFetch( identifier, siteInfo, siteType ); if ( response.error ) { trackOnboardingEvent( new OnboardingEvent( diff --git a/src/app/utils/sitegen/generateSitePages.js b/src/app/utils/sitegen/generateSitePages.js index 9b8d4d78b..fb144f4a5 100644 --- a/src/app/utils/sitegen/generateSitePages.js +++ b/src/app/utils/sitegen/generateSitePages.js @@ -6,10 +6,9 @@ import { ACTION_SITE_PAGES_GENERATION_FAILED } from '@/utils/analytics/hiive/con const generateSitePages = async () => { const prompt = select( nfdOnboardingStore ).getPrompt(); - const locale = select( nfdOnboardingStore ).getSelectedLocale(); const siteType = select( nfdOnboardingStore ).getSiteType(); - const response = await getSitePages( prompt, siteType, locale ); + const response = await getSitePages( prompt, siteType ); if ( response.error ) { trackOnboardingEvent( new OnboardingEvent( ACTION_SITE_PAGES_GENERATION_FAILED )