From 218ad2e48a101d3d4066b4b4edb94c40f4788c56 Mon Sep 17 00:00:00 2001 From: Igor Radovanov Date: Tue, 6 Jun 2023 14:01:12 +0200 Subject: [PATCH 1/5] Add Saint Kitts and Nevis localizations for address entry #38280 --- plugins/woocommerce/i18n/states.php | 18 ++++++++++++++++++ .../includes/class-wc-countries.php | 10 ++++++++++ 2 files changed, 28 insertions(+) diff --git a/plugins/woocommerce/i18n/states.php b/plugins/woocommerce/i18n/states.php index c8f0a66e54d..1ddf68432e4 100644 --- a/plugins/woocommerce/i18n/states.php +++ b/plugins/woocommerce/i18n/states.php @@ -1082,6 +1082,24 @@ return array( 'KE46' => __( 'Wajir', 'woocommerce' ), 'KE47' => __( 'West Pokot', 'woocommerce' ), ), + 'KN' => array( // Saint Kitts and Nevis parishes. + 'KNK' => __( 'Saint Kitts', 'woocommerce' ), + 'KNN' => __( 'Nevis', 'woocommerce' ), + 'KN01' => __( 'Christ Church Nichola Town', 'woocommerce' ), + 'KN02' => __( 'Saint Anne Sandy Point', 'woocommerce' ), + 'KN03' => __( 'Saint George Basseterre', 'woocommerce' ), + 'KN04' => __( 'Saint George Gingerland', 'woocommerce' ), + 'KN05' => __( 'Saint James Windward', 'woocommerce' ), + 'KN06' => __( 'Saint John Capisterre', 'woocommerce' ), + 'KN07' => __( 'Saint John Figtree', 'woocommerce' ), + 'KN08' => __( 'Saint Mary Cayon', 'woocommerce' ), + 'KN09' => __( 'Saint Paul Capisterre', 'woocommerce' ), + 'KN10' => __( 'Saint Paul Charlestown', 'woocommerce' ), + 'KN11' => __( 'Saint Peter Basseterre', 'woocommerce' ), + 'KN12' => __( 'Saint Thomas Lowland', 'woocommerce' ), + 'KN13' => __( 'Saint Thomas Middle Island', 'woocommerce' ), + 'KN15' => __( 'Trinity Palmetto Point', 'woocommerce' ), + ), 'KR' => array(), 'KW' => array(), 'LA' => array( // Laotian provinces. diff --git a/plugins/woocommerce/includes/class-wc-countries.php b/plugins/woocommerce/includes/class-wc-countries.php index 0ceb476b290..9a66e8acead 100644 --- a/plugins/woocommerce/includes/class-wc-countries.php +++ b/plugins/woocommerce/includes/class-wc-countries.php @@ -1286,6 +1286,16 @@ class WC_Countries { 'priority' => 69, ), ), + 'KN' => array( + 'postcode' => array( + 'required' => false, + 'label' => __( 'Postal code', 'woocommerce' ), + ), + 'state' => array( + 'required' => true, + 'label' => __( 'Parish', 'woocommerce' ), + ), + ), 'KR' => array( 'state' => array( 'required' => false, From f608615d1bd9e25ecb130534a7bfdb3c7f92db20 Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Tue, 6 Jun 2023 11:56:11 -0300 Subject: [PATCH 2/5] Add changelog file --- plugins/woocommerce/changelog/pr-38621 | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 plugins/woocommerce/changelog/pr-38621 diff --git a/plugins/woocommerce/changelog/pr-38621 b/plugins/woocommerce/changelog/pr-38621 new file mode 100644 index 00000000000..8e8a3068ee6 --- /dev/null +++ b/plugins/woocommerce/changelog/pr-38621 @@ -0,0 +1,4 @@ +Significance: minor +Type: add + +Add Saint Kitts and Nevis parishes \ No newline at end of file From ed84b8319ff8a4ad8f24812ffaa8d1bb6bc23f46 Mon Sep 17 00:00:00 2001 From: Igor Radovanov Date: Tue, 6 Jun 2023 21:19:01 +0200 Subject: [PATCH 3/5] label spacing alignment fixed --- plugins/woocommerce/includes/class-wc-countries.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/woocommerce/includes/class-wc-countries.php b/plugins/woocommerce/includes/class-wc-countries.php index 9a66e8acead..b793f419175 100644 --- a/plugins/woocommerce/includes/class-wc-countries.php +++ b/plugins/woocommerce/includes/class-wc-countries.php @@ -1289,11 +1289,11 @@ class WC_Countries { 'KN' => array( 'postcode' => array( 'required' => false, - 'label' => __( 'Postal code', 'woocommerce' ), + 'label' => __( 'Postal code', 'woocommerce' ), ), 'state' => array( 'required' => true, - 'label' => __( 'Parish', 'woocommerce' ), + 'label' => __( 'Parish', 'woocommerce' ), ), ), 'KR' => array( From f54686c639dbc4558347ee2f2f4ad047a7ce0442 Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Fri, 9 Jun 2023 15:39:34 -0300 Subject: [PATCH 4/5] update playwright stateOptions configuration --- .../tests/api-core-tests/data/settings.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/plugins/woocommerce/tests/api-core-tests/data/settings.js b/plugins/woocommerce/tests/api-core-tests/data/settings.js index 6322159f3db..4098d33db42 100644 --- a/plugins/woocommerce/tests/api-core-tests/data/settings.js +++ b/plugins/woocommerce/tests/api-core-tests/data/settings.js @@ -1616,7 +1616,22 @@ const stateOptions = { "ST": "São Tomé and Príncipe", "BL": "Saint Barthélemy", "SH": "Saint Helena", - "KN": "Saint Kitts and Nevis", + "KN:KNK": "Saint Kitts and Nevis - Saint Kitts", + "KN:KNN": "Saint Kitts and Nevis - Nevis", + "KN:KN01": "Saint Kitts and Nevis - Christ Church Nichola Town", + "KN:KN02": "Saint Kitts and Nevis - Saint Anne Sandy Point", + "KN:KN03": "Saint Kitts and Nevis - Saint George Basseterre", + "KN:KN04": "Saint Kitts and Nevis - Saint George Gingerland", + "KN:KN05": "Saint Kitts and Nevis - Saint James Windward", + "KN:KN06": "Saint Kitts and Nevis - Saint John Capisterre", + "KN:KN07": "Saint Kitts and Nevis - Saint John Figtree", + "KN:KN08": "Saint Kitts and Nevis - Saint Mary Cayon", + "KN:KN09": "Saint Kitts and Nevis - Saint Paul Capisterre", + "KN:KN10": "Saint Kitts and Nevis - Saint Paul Charlestown", + "KN:KN11": "Saint Kitts and Nevis - Saint Peter Basseterre", + "KN:KN12": "Saint Kitts and Nevis - Saint Thomas Lowland", + "KN:KN13": "Saint Kitts and Nevis - Saint Thomas Middle Island", + "KN:KN15": "Saint Kitts and Nevis - Trinity Palmetto Point", "LC": "Saint Lucia", "SX": "Saint Martin (Dutch part)", "MF": "Saint Martin (French part)", From 66f4e8c1bb7e2280387499561bc61a9881c28730 Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Fri, 9 Jun 2023 16:31:01 -0300 Subject: [PATCH 5/5] update playwright country crud configuration --- .../tests/api-core-tests/tests/data/data-crud.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/woocommerce/tests/api-core-tests/tests/data/data-crud.test.js b/plugins/woocommerce/tests/api-core-tests/tests/data/data-crud.test.js index 43ca63dfd7b..b25231e80c4 100644 --- a/plugins/woocommerce/tests/api-core-tests/tests/data/data-crud.test.js +++ b/plugins/woocommerce/tests/api-core-tests/tests/data/data-crud.test.js @@ -2346,7 +2346,7 @@ test.describe('Data API tests', () => { "num_decimals": 2, "thousand_sep": ",", "weight_unit": "kg", - "states": [] + "states": expect.arrayContaining([]) }, { "code": "KY",