Skip to content

Commit

Permalink
Update symbol and formatting of the XPF currency (#46960)
Browse files Browse the repository at this point in the history
* Update XPF currency symbol to XPF

* Change XPF default locale formatting

* Change decimal separator of countries that use XPF to dot

* Add changelog entry

* Update changelog entry

* Fix XPF test data

* Fix some JS linting issues

* Revert "Fix some JS linting issues"

This reverts commit 51abcf4.

* Fix some JS linting issues
  • Loading branch information
cesarcosta99 committed May 14, 2024
1 parent b931117 commit f5e45ef
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 87 deletions.
4 changes: 4 additions & 0 deletions plugins/woocommerce/changelog/fix-5150-xpf-currency
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: tweak

Update XPF currency symbol to XPF and change its default formatting.
2 changes: 1 addition & 1 deletion plugins/woocommerce/i18n/currency-info.php
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@
'fr_NC' => $global_formats['rs_comma_space_ltr'],
'fr_PF' => $global_formats['rs_comma_space_ltr'],
'fr_WF' => $global_formats['rs_comma_space_ltr'],
'default' => $global_formats['rs_comma_space_ltr'],
'default' => $global_formats['ls_dot_comma_ltr'],
),
'YER' => array(
'ar_YE' => $global_formats['rs_comma_dot_rtl'],
Expand Down
6 changes: 3 additions & 3 deletions plugins/woocommerce/i18n/locale-info.php
Original file line number Diff line number Diff line change
Expand Up @@ -2559,7 +2559,7 @@
'currency_code' => 'XPF',
'currency_pos' => 'right_space',
'thousand_sep' => ' ',
'decimal_sep' => ',',
'decimal_sep' => '.',
'num_decimals' => 0,
'weight_unit' => 'kg',
'dimension_unit' => 'cm',
Expand Down Expand Up @@ -2783,7 +2783,7 @@
'currency_code' => 'XPF',
'currency_pos' => 'right_space',
'thousand_sep' => ' ',
'decimal_sep' => ',',
'decimal_sep' => '.',
'num_decimals' => 0,
'weight_unit' => 'kg',
'dimension_unit' => 'cm',
Expand Down Expand Up @@ -3855,7 +3855,7 @@
'currency_code' => 'XPF',
'currency_pos' => 'right_space',
'thousand_sep' => ' ',
'decimal_sep' => ',',
'decimal_sep' => '.',
'num_decimals' => 0,
'weight_unit' => 'kg',
'dimension_unit' => 'cm',
Expand Down
2 changes: 1 addition & 1 deletion plugins/woocommerce/includes/wc-core-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ function get_woocommerce_currency_symbols() {
'XAF' => 'CFA',
'XCD' => '$',
'XOF' => 'CFA',
'XPF' => 'Fr',
'XPF' => 'XPF',
'YER' => '﷼',
'ZAR' => 'R',
'ZMW' => 'ZK',
Expand Down
153 changes: 77 additions & 76 deletions plugins/woocommerce/tests/api-core-tests/data/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ const currencies = {
XAF: 'Central African CFA franc (CFA) — XAF',
XCD: 'East Caribbean dollar ($) — XCD',
XOF: 'West African CFA franc (CFA) — XOF',
XPF: 'CFP franc (Fr) — XPF',
XPF: 'CFP franc (XPF) — XPF',
YER: 'Yemeni rial (﷼) — YER',
ZAR: 'South African rand (R) — ZAR',
ZMW: 'Zambian kwacha (ZK) — ZMW',
Expand Down Expand Up @@ -1473,81 +1473,82 @@ const stateOptions = {
MN: 'Mongolia',
ME: 'Montenegro',
MS: 'Montserrat',
"MA:maagd": "Morocco - Agadir-Ida Ou Tanane",
"MA:maazi": "Morocco - Azilal",
"MA:mabem": "Morocco - Béni-Mellal",
"MA:maber": "Morocco - Berkane",
"MA:mabes": "Morocco - Ben Slimane",
"MA:mabod": "Morocco - Boujdour",
"MA:mabom": "Morocco - Boulemane",
"MA:mabrr": "Morocco - Berrechid",
"MA:macas": "Morocco - Casablanca",
"MA:mache": "Morocco - Chefchaouen",
"MA:machi": "Morocco - Chichaoua",
"MA:macht": "Morocco - Chtouka Aït Baha",
"MA:madri": "Morocco - Driouch",
"MA:maedi": "Morocco - Essaouira",
"MA:maerr": "Morocco - Errachidia",
"MA:mafah": "Morocco - Fahs-Beni Makada",
"MA:mafes": "Morocco - Fès-Dar-Dbibegh",
"MA:mafig": "Morocco - Figuig",
"MA:mafqh": "Morocco - Fquih Ben Salah",
"MA:mague": "Morocco - Guelmim",
"MA:maguf": "Morocco - Guercif",
"MA:mahaj": "Morocco - El Hajeb",
"MA:mahao": "Morocco - Al Haouz",
"MA:mahoc": "Morocco - Al Hoceïma",
"MA:maifr": "Morocco - Ifrane",
"MA:maine": "Morocco - Inezgane-Aït Melloul",
"MA:majdi": "Morocco - El Jadida",
"MA:majra": "Morocco - Jerada",
"MA:maken": "Morocco - Kénitra",
"MA:makes": "Morocco - Kelaat Sraghna",
"MA:makhe": "Morocco - Khemisset",
"MA:makhn": "Morocco - Khénifra",
"MA:makho": "Morocco - Khouribga",
"MA:malaa": "Morocco - Laâyoune",
"MA:malar": "Morocco - Larache",
"MA:mamar": "Morocco - Marrakech",
"MA:mamdf": "Morocco - M’diq-Fnideq",
"MA:mamed": "Morocco - Médiouna",
"MA:mamek": "Morocco - Meknès",
"MA:mamid": "Morocco - Midelt",
"MA:mammd": "Morocco - Marrakech-Medina",
"MA:mammn": "Morocco - Marrakech-Menara",
"MA:mamoh": "Morocco - Mohammedia",
"MA:mamou": "Morocco - Moulay Yacoub",
"MA:manad": "Morocco - Nador",
"MA:manou": "Morocco - Nouaceur",
"MA:maoua": "Morocco - Ouarzazate",
"MA:maoud": "Morocco - Oued Ed-Dahab",
"MA:maouj": "Morocco - Oujda-Angad",
"MA:maouz": "Morocco - Ouezzane",
"MA:marab": "Morocco - Rabat",
"MA:mareh": "Morocco - Rehamna",
"MA:masaf": "Morocco - Safi",
"MA:masal": "Morocco - Salé",
"MA:masef": "Morocco - Sefrou",
"MA:maset": "Morocco - Settat",
"MA:masib": "Morocco - Sidi Bennour",
"MA:masif": "Morocco - Sidi Ifni",
"MA:masik": "Morocco - Sidi Kacem",
"MA:masil": "Morocco - Sidi Slimane",
"MA:maskh": "Morocco - Skhirat-Témara",
"MA:masyb": "Morocco - Sidi Youssef Ben Ali",
"MA:mataf": "Morocco - Tarfaya (EH-partial)",
"MA:matai": "Morocco - Taourirt",
"MA:matao": "Morocco - Taounate",
"MA:matar": "Morocco - Taroudant",
"MA:matat": "Morocco - Tata",
"MA:mataz": "Morocco - Taza",
"MA:matet": "Morocco - Tétouan",
"MA:matin": "Morocco - Tinghir",
"MA:matiz": "Morocco - Tiznit",
"MA:matng": "Morocco - Tangier-Assilah",
"MA:matnt": "Morocco - Tan-Tan",
"MA:mayus": "Morocco - Youssoufia",
"MA:mazag": "Morocco - Zagora", 'MZ:MZP': 'Mozambique - Cabo Delgado',
'MA:maagd': 'Morocco - Agadir-Ida Ou Tanane',
'MA:maazi': 'Morocco - Azilal',
'MA:mabem': 'Morocco - Béni-Mellal',
'MA:maber': 'Morocco - Berkane',
'MA:mabes': 'Morocco - Ben Slimane',
'MA:mabod': 'Morocco - Boujdour',
'MA:mabom': 'Morocco - Boulemane',
'MA:mabrr': 'Morocco - Berrechid',
'MA:macas': 'Morocco - Casablanca',
'MA:mache': 'Morocco - Chefchaouen',
'MA:machi': 'Morocco - Chichaoua',
'MA:macht': 'Morocco - Chtouka Aït Baha',
'MA:madri': 'Morocco - Driouch',
'MA:maedi': 'Morocco - Essaouira',
'MA:maerr': 'Morocco - Errachidia',
'MA:mafah': 'Morocco - Fahs-Beni Makada',
'MA:mafes': 'Morocco - Fès-Dar-Dbibegh',
'MA:mafig': 'Morocco - Figuig',
'MA:mafqh': 'Morocco - Fquih Ben Salah',
'MA:mague': 'Morocco - Guelmim',
'MA:maguf': 'Morocco - Guercif',
'MA:mahaj': 'Morocco - El Hajeb',
'MA:mahao': 'Morocco - Al Haouz',
'MA:mahoc': 'Morocco - Al Hoceïma',
'MA:maifr': 'Morocco - Ifrane',
'MA:maine': 'Morocco - Inezgane-Aït Melloul',
'MA:majdi': 'Morocco - El Jadida',
'MA:majra': 'Morocco - Jerada',
'MA:maken': 'Morocco - Kénitra',
'MA:makes': 'Morocco - Kelaat Sraghna',
'MA:makhe': 'Morocco - Khemisset',
'MA:makhn': 'Morocco - Khénifra',
'MA:makho': 'Morocco - Khouribga',
'MA:malaa': 'Morocco - Laâyoune',
'MA:malar': 'Morocco - Larache',
'MA:mamar': 'Morocco - Marrakech',
'MA:mamdf': 'Morocco - M’diq-Fnideq',
'MA:mamed': 'Morocco - Médiouna',
'MA:mamek': 'Morocco - Meknès',
'MA:mamid': 'Morocco - Midelt',
'MA:mammd': 'Morocco - Marrakech-Medina',
'MA:mammn': 'Morocco - Marrakech-Menara',
'MA:mamoh': 'Morocco - Mohammedia',
'MA:mamou': 'Morocco - Moulay Yacoub',
'MA:manad': 'Morocco - Nador',
'MA:manou': 'Morocco - Nouaceur',
'MA:maoua': 'Morocco - Ouarzazate',
'MA:maoud': 'Morocco - Oued Ed-Dahab',
'MA:maouj': 'Morocco - Oujda-Angad',
'MA:maouz': 'Morocco - Ouezzane',
'MA:marab': 'Morocco - Rabat',
'MA:mareh': 'Morocco - Rehamna',
'MA:masaf': 'Morocco - Safi',
'MA:masal': 'Morocco - Salé',
'MA:masef': 'Morocco - Sefrou',
'MA:maset': 'Morocco - Settat',
'MA:masib': 'Morocco - Sidi Bennour',
'MA:masif': 'Morocco - Sidi Ifni',
'MA:masik': 'Morocco - Sidi Kacem',
'MA:masil': 'Morocco - Sidi Slimane',
'MA:maskh': 'Morocco - Skhirat-Témara',
'MA:masyb': 'Morocco - Sidi Youssef Ben Ali',
'MA:mataf': 'Morocco - Tarfaya (EH-partial)',
'MA:matai': 'Morocco - Taourirt',
'MA:matao': 'Morocco - Taounate',
'MA:matar': 'Morocco - Taroudant',
'MA:matat': 'Morocco - Tata',
'MA:mataz': 'Morocco - Taza',
'MA:matet': 'Morocco - Tétouan',
'MA:matin': 'Morocco - Tinghir',
'MA:matiz': 'Morocco - Tiznit',
'MA:matng': 'Morocco - Tangier-Assilah',
'MA:matnt': 'Morocco - Tan-Tan',
'MA:mayus': 'Morocco - Youssoufia',
'MA:mazag': 'Morocco - Zagora',
'MZ:MZP': 'Mozambique - Cabo Delgado',
'MZ:MZG': 'Mozambique - Gaza',
'MZ:MZI': 'Mozambique - Inhambane',
'MZ:MZB': 'Mozambique - Manica',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
const { test, expect } = require( '@playwright/test' );
const { API_BASE_URL } = process.env;
const shouldSkip = API_BASE_URL != undefined;

// 259 countries total
const countryCodes = [
Expand Down Expand Up @@ -2940,7 +2938,7 @@ test.describe( 'Data API tests', () => {
name: 'CFP franc',
currency_code: 'XPF',
currency_pos: 'right_space',
decimal_sep: ',',
decimal_sep: '.',
dimension_unit: 'cm',
num_decimals: 0,
thousand_sep: ' ',
Expand Down Expand Up @@ -3000,7 +2998,7 @@ test.describe( 'Data API tests', () => {
name: 'CFP franc',
currency_code: 'XPF',
currency_pos: 'right_space',
decimal_sep: ',',
decimal_sep: '.',
dimension_unit: 'cm',
num_decimals: 0,
thousand_sep: ' ',
Expand Down Expand Up @@ -3120,7 +3118,7 @@ test.describe( 'Data API tests', () => {
name: 'CFP franc',
currency_code: 'XPF',
currency_pos: 'right_space',
decimal_sep: ',',
decimal_sep: '.',
dimension_unit: 'cm',
num_decimals: 0,
thousand_sep: ' ',
Expand Down Expand Up @@ -7992,7 +7990,7 @@ test.describe( 'Data API tests', () => {
expect.objectContaining( {
code: 'XPF',
name: 'CFP franc',
symbol: 'Fr',
symbol: 'XPF',
_links: {
self: [
{
Expand Down

0 comments on commit f5e45ef

Please sign in to comment.