@@ -72,12 +72,12 @@ struct ScreenshotObjectGraph: MockObjectGraph {
7272 createSiteSetting ( settingID: " woocommerce_default_country " ,
7373 label: " Country and State " ,
7474 settingDescription: " The country and state or province, if any, in which your business is located. " ,
75- value: Self . countryValue ( for : Locale . current . identifier ) ,
75+ value: " US:CA " ,
7676 settingGroupKey: " general " ) ,
7777 createSiteSetting ( settingID: " woocommerce_currency " ,
7878 label: " Currency " ,
7979 settingDescription: " This controls what currency prices are listed at in the catalog and which currency gateways will take payments in. " ,
80- value: Self . currencyCode ( for : Locale . current . identifier ) ,
80+ value: CurrencyCode . USD . rawValue ,
8181 settingGroupKey: " general " )
8282 ]
8383
@@ -332,58 +332,6 @@ struct ScreenshotObjectGraph: MockObjectGraph {
332332 init ( date: Date = . init( ) ) {
333333 self . date = date
334334 }
335-
336- /// Maps the given locale to an appropriate country value for the site setting for all locales in Fastfile IOS_LOCALES.
337- /// Uses the same format as WooCommerce's default country setting: "COUNTRY:STATE".
338- private static func countryValue( for locale: String ) -> String {
339- // Map locales to country values based on IOS_LOCALES from Fastfile
340- let localeToCountryMap : [ String : String ] = [
341- " ar-SA " : " SA " , // Saudi Arabia
342- " de-DE " : " DE " , // Germany
343- " en-US " : " US:CA " , // United States, California
344- " es-ES " : " ES " , // Spain
345- " fr-FR " : " FR " , // France
346- " he " : " IL " , // Israel (Hebrew)
347- " id " : " ID " , // Indonesia
348- " it " : " IT " , // Italy
349- " ja " : " JP " , // Japan
350- " ko " : " KR " , // South Korea
351- " nl-NL " : " NL " , // Netherlands
352- " pt-BR " : " BR " , // Brazil
353- " ru " : " RU " , // Russia
354- " sv " : " SE " , // Sweden
355- " tr " : " TR " , // Turkey
356- " zh-Hans " : " CN " , // China (Simplified Chinese)
357- " zh-Hant " : " TW " // Taiwan (Traditional Chinese)
358- ]
359- return localeToCountryMap [ locale] ?? " US:CA " // Default to US:CA.
360- }
361-
362- /// Maps the given locale to an appropriate currency code for the site setting for all locales in Fastfile IOS_LOCALES.
363- /// Uses the CurrencyCode enum rawValues.
364- private static func currencyCode( for locale: String ) -> String {
365- // Map locales to currency codes based on IOS_LOCALES from Fastfile
366- let localeToCurrencyMap : [ String : CurrencyCode ] = [
367- " ar-SA " : . SAR, // Saudi Riyal
368- " de-DE " : . EUR, // Euro
369- " en-US " : . USD, // US Dollar
370- " es-ES " : . EUR, // Euro
371- " fr-FR " : . EUR, // Euro
372- " he " : . ILS, // Israeli Shekel
373- " id " : . IDR, // Indonesian Rupiah
374- " it " : . EUR, // Euro
375- " ja " : . JPY, // Japanese Yen
376- " ko " : . KRW, // South Korean Won
377- " nl-NL " : . EUR, // Euro
378- " pt-BR " : . BRL, // Brazilian Real
379- " ru " : . RUB, // Russian Ruble
380- " sv " : . SEK, // Swedish Krona
381- " tr " : . TRY, // Turkish Lira
382- " zh-Hans " : . CNY, // Chinese Yuan
383- " zh-Hant " : . TWD // Taiwan Dollar
384- ]
385- return localeToCurrencyMap [ locale] ? . rawValue ?? CurrencyCode . USD. rawValue // Default to USD.
386- }
387335}
388336
389337extension ScreenshotObjectGraph {
0 commit comments