@@ -114,26 +114,6 @@ const AddStack = (props: any): JSX.Element => {
114114 const rawMasterLocale = sourceLocales . length > 0 ? sourceLocales [ 0 ] : 'en-us' ;
115115 const masterLocale = ( typeof rawMasterLocale === 'string' ? rawMasterLocale : rawMasterLocale ?. label || rawMasterLocale ?. value || 'en-us' ) . toLowerCase ( ) ;
116116
117- // 🔍 DEBUG: Log master locale detection (FIRST element from source_locales)
118- console . info ( '================================================================================' ) ;
119- console . info ( '🔍 AddStack - Master locale detection (source_locales[0]):' , {
120- sourceLocales,
121- sourceLocales_length : sourceLocales . length ,
122- sourceLocales_first_element : sourceLocales [ 0 ] ,
123- rawMasterLocale,
124- masterLocale_after_lowercase : masterLocale ,
125- masterLocale_type : typeof masterLocale ,
126- isLowercase : masterLocale === masterLocale ?. toLowerCase ?.( ) ,
127- } ) ;
128- console . info ( '🔍 AddStack - Contentstack locales sample (first 3):' ,
129- rawMappedLocalesMapped ?. slice ( 0 , 3 ) ?. map ( l => ( {
130- value : l . value ,
131- value_lowercase : l . value ?. toLowerCase ( ) ,
132- label : l . label
133- } ) )
134- ) ;
135- console . info ( '================================================================================' ) ;
136-
137117 // 🔧 CRITICAL: Find matching Contentstack locale (all lowercase comparison)
138118 const matchingLocale = rawMappedLocalesMapped . find ( locale => {
139119 const localeValueLower = ( locale . value || '' ) . toLowerCase ( ) ;
@@ -149,15 +129,6 @@ const AddStack = (props: any): JSX.Element => {
149129 return false ;
150130 } ) ;
151131
152- // 🔍 DEBUG: Log matching result
153- console . info ( '🔍 AddStack - Matching Contentstack locale:' , {
154- matchingLocale,
155- matchingLocale_value : matchingLocale ?. value ,
156- matchingLocale_value_lowercase : matchingLocale ?. value ?. toLowerCase ( ) ,
157- will_auto_select : ! ! matchingLocale
158- } ) ;
159- console . info ( '================================================================================' ) ;
160-
161132 setAllLocales ( rawMappedLocalesMapped ) ;
162133
163134 // Update form with correct master locale after locales are loaded
@@ -184,15 +155,6 @@ const AddStack = (props: any): JSX.Element => {
184155 const rawMasterLocale = sourceLocales . length > 0 ? sourceLocales [ 0 ] : 'en-us' ;
185156 const masterLocale = ( typeof rawMasterLocale === 'string' ? rawMasterLocale : rawMasterLocale ?. label || rawMasterLocale ?. value || 'en-us' ) . toLowerCase ( ) ;
186157
187- // 🔍 DEBUG: Log master locale in useEffect (source_locales[0])
188- console . info ( '🔍 AddStack useEffect - Re-checking master locale:' , {
189- sourceLocales,
190- sourceLocales_first_element : sourceLocales [ 0 ] ,
191- rawMasterLocale,
192- masterLocale_after_lowercase : masterLocale ,
193- allLocales_count : allLocales . length
194- } ) ;
195-
196158 // 🔧 CRITICAL: Find matching Contentstack locale (all lowercase comparison)
197159 const matchingLocale = allLocales . find ( locale => {
198160 const localeValueLower = ( locale . value || '' ) . toLowerCase ( ) ;
@@ -208,15 +170,7 @@ const AddStack = (props: any): JSX.Element => {
208170 return false ;
209171 } ) ;
210172
211- // 🔍 DEBUG: Log matching result in useEffect
212- console . info ( '🔍 AddStack useEffect - Final matching locale:' , {
213- matchingLocale,
214- matchingLocale_value : matchingLocale ?. value ,
215- will_update_form : ! ! matchingLocale
216- } ) ;
217-
218173 if ( matchingLocale ) {
219- console . info ( '✅ AddStack - Auto-selecting master locale:' , matchingLocale . value ) ;
220174 formRef . current . change ( 'locale' , matchingLocale ) ;
221175 } else {
222176 console . warn ( '⚠️ AddStack - No matching Contentstack locale found for:' , masterLocale ) ;
0 commit comments