Commit 47ee925211 for woocommerce

commit 47ee925211fb16fb54de05306aa39f3b858343d8
Author: Néstor Soriano <konamiman@konamiman.com>
Date:   Thu Jan 15 12:46:36 2026 +0100

    Add caching for the currencies REST API endpoints (#62816)

diff --git a/plugins/woocommerce/changelog/pr-62816 b/plugins/woocommerce/changelog/pr-62816
new file mode 100644
index 0000000000..4ae7cb8af3
--- /dev/null
+++ b/plugins/woocommerce/changelog/pr-62816
@@ -0,0 +1,4 @@
+Significance: minor
+Type: update
+
+Add caching for the currencies REST API endpoints
diff --git a/plugins/woocommerce/i18n/currencies.php b/plugins/woocommerce/i18n/currencies.php
new file mode 100644
index 0000000000..730e9c4070
--- /dev/null
+++ b/plugins/woocommerce/i18n/currencies.php
@@ -0,0 +1,176 @@
+<?php
+/**
+ * Returns an array of currency codes and names.
+ * Currency symbols and names should follow the Unicode CLDR recommendation (https://cldr.unicode.org/translation/currency-names-and-symbols)
+ *
+ * @package WooCommerce\i18n
+ * @version 10.6.0
+ */
+
+defined( 'ABSPATH' ) || exit;
+
+return array(
+	'AED' => __( 'United Arab Emirates dirham', 'woocommerce' ),
+	'AFN' => __( 'Afghan afghani', 'woocommerce' ),
+	'ALL' => __( 'Albanian lek', 'woocommerce' ),
+	'AMD' => __( 'Armenian dram', 'woocommerce' ),
+	'ANG' => __( 'Netherlands Antillean guilder', 'woocommerce' ),
+	'AOA' => __( 'Angolan kwanza', 'woocommerce' ),
+	'ARS' => __( 'Argentine peso', 'woocommerce' ),
+	'AUD' => __( 'Australian dollar', 'woocommerce' ),
+	'AWG' => __( 'Aruban florin', 'woocommerce' ),
+	'AZN' => __( 'Azerbaijani manat', 'woocommerce' ),
+	'BAM' => __( 'Bosnia and Herzegovina convertible mark', 'woocommerce' ),
+	'BBD' => __( 'Barbadian dollar', 'woocommerce' ),
+	'BDT' => __( 'Bangladeshi taka', 'woocommerce' ),
+	'BGN' => __( 'Bulgarian lev', 'woocommerce' ),
+	'BHD' => __( 'Bahraini dinar', 'woocommerce' ),
+	'BIF' => __( 'Burundian franc', 'woocommerce' ),
+	'BMD' => __( 'Bermudian dollar', 'woocommerce' ),
+	'BND' => __( 'Brunei dollar', 'woocommerce' ),
+	'BOB' => __( 'Bolivian boliviano', 'woocommerce' ),
+	'BRL' => __( 'Brazilian real', 'woocommerce' ),
+	'BSD' => __( 'Bahamian dollar', 'woocommerce' ),
+	'BTC' => __( 'Bitcoin', 'woocommerce' ),
+	'BTN' => __( 'Bhutanese ngultrum', 'woocommerce' ),
+	'BWP' => __( 'Botswana pula', 'woocommerce' ),
+	'BYR' => __( 'Belarusian ruble (old)', 'woocommerce' ),
+	'BYN' => __( 'Belarusian ruble', 'woocommerce' ),
+	'BZD' => __( 'Belize dollar', 'woocommerce' ),
+	'CAD' => __( 'Canadian dollar', 'woocommerce' ),
+	'CDF' => __( 'Congolese franc', 'woocommerce' ),
+	'CHF' => __( 'Swiss franc', 'woocommerce' ),
+	'CLP' => __( 'Chilean peso', 'woocommerce' ),
+	'CNY' => __( 'Chinese yuan', 'woocommerce' ),
+	'COP' => __( 'Colombian peso', 'woocommerce' ),
+	'CRC' => __( 'Costa Rican col&oacute;n', 'woocommerce' ),
+	'CUC' => __( 'Cuban convertible peso', 'woocommerce' ),
+	'CUP' => __( 'Cuban peso', 'woocommerce' ),
+	'CVE' => __( 'Cape Verdean escudo', 'woocommerce' ),
+	'CZK' => __( 'Czech koruna', 'woocommerce' ),
+	'DJF' => __( 'Djiboutian franc', 'woocommerce' ),
+	'DKK' => __( 'Danish krone', 'woocommerce' ),
+	'DOP' => __( 'Dominican peso', 'woocommerce' ),
+	'DZD' => __( 'Algerian dinar', 'woocommerce' ),
+	'EGP' => __( 'Egyptian pound', 'woocommerce' ),
+	'ERN' => __( 'Eritrean nakfa', 'woocommerce' ),
+	'ETB' => __( 'Ethiopian birr', 'woocommerce' ),
+	'EUR' => __( 'Euro', 'woocommerce' ),
+	'FJD' => __( 'Fijian dollar', 'woocommerce' ),
+	'FKP' => __( 'Falkland Islands pound', 'woocommerce' ),
+	'GBP' => __( 'Pound sterling', 'woocommerce' ),
+	'GEL' => __( 'Georgian lari', 'woocommerce' ),
+	'GGP' => __( 'Guernsey pound', 'woocommerce' ),
+	'GHS' => __( 'Ghana cedi', 'woocommerce' ),
+	'GIP' => __( 'Gibraltar pound', 'woocommerce' ),
+	'GMD' => __( 'Gambian dalasi', 'woocommerce' ),
+	'GNF' => __( 'Guinean franc', 'woocommerce' ),
+	'GTQ' => __( 'Guatemalan quetzal', 'woocommerce' ),
+	'GYD' => __( 'Guyanese dollar', 'woocommerce' ),
+	'HKD' => __( 'Hong Kong dollar', 'woocommerce' ),
+	'HNL' => __( 'Honduran lempira', 'woocommerce' ),
+	'HRK' => __( 'Croatian kuna', 'woocommerce' ),
+	'HTG' => __( 'Haitian gourde', 'woocommerce' ),
+	'HUF' => __( 'Hungarian forint', 'woocommerce' ),
+	'IDR' => __( 'Indonesian rupiah', 'woocommerce' ),
+	'ILS' => __( 'Israeli new shekel', 'woocommerce' ),
+	'IMP' => __( 'Manx pound', 'woocommerce' ),
+	'INR' => __( 'Indian rupee', 'woocommerce' ),
+	'IQD' => __( 'Iraqi dinar', 'woocommerce' ),
+	'IRR' => __( 'Iranian rial', 'woocommerce' ),
+	'IRT' => __( 'Iranian toman', 'woocommerce' ),
+	'ISK' => __( 'Icelandic kr&oacute;na', 'woocommerce' ),
+	'JEP' => __( 'Jersey pound', 'woocommerce' ),
+	'JMD' => __( 'Jamaican dollar', 'woocommerce' ),
+	'JOD' => __( 'Jordanian dinar', 'woocommerce' ),
+	'JPY' => __( 'Japanese yen', 'woocommerce' ),
+	'KES' => __( 'Kenyan shilling', 'woocommerce' ),
+	'KGS' => __( 'Kyrgyzstani som', 'woocommerce' ),
+	'KHR' => __( 'Cambodian riel', 'woocommerce' ),
+	'KMF' => __( 'Comorian franc', 'woocommerce' ),
+	'KPW' => __( 'North Korean won', 'woocommerce' ),
+	'KRW' => __( 'South Korean won', 'woocommerce' ),
+	'KWD' => __( 'Kuwaiti dinar', 'woocommerce' ),
+	'KYD' => __( 'Cayman Islands dollar', 'woocommerce' ),
+	'KZT' => __( 'Kazakhstani tenge', 'woocommerce' ),
+	'LAK' => __( 'Lao kip', 'woocommerce' ),
+	'LBP' => __( 'Lebanese pound', 'woocommerce' ),
+	'LKR' => __( 'Sri Lankan rupee', 'woocommerce' ),
+	'LRD' => __( 'Liberian dollar', 'woocommerce' ),
+	'LSL' => __( 'Lesotho loti', 'woocommerce' ),
+	'LYD' => __( 'Libyan dinar', 'woocommerce' ),
+	'MAD' => __( 'Moroccan dirham', 'woocommerce' ),
+	'MDL' => __( 'Moldovan leu', 'woocommerce' ),
+	'MGA' => __( 'Malagasy ariary', 'woocommerce' ),
+	'MKD' => __( 'Macedonian denar', 'woocommerce' ),
+	'MMK' => __( 'Burmese kyat', 'woocommerce' ),
+	'MNT' => __( 'Mongolian t&ouml;gr&ouml;g', 'woocommerce' ),
+	'MOP' => __( 'Macanese pataca', 'woocommerce' ),
+	'MRU' => __( 'Mauritanian ouguiya', 'woocommerce' ),
+	'MUR' => __( 'Mauritian rupee', 'woocommerce' ),
+	'MVR' => __( 'Maldivian rufiyaa', 'woocommerce' ),
+	'MWK' => __( 'Malawian kwacha', 'woocommerce' ),
+	'MXN' => __( 'Mexican peso', 'woocommerce' ),
+	'MYR' => __( 'Malaysian ringgit', 'woocommerce' ),
+	'MZN' => __( 'Mozambican metical', 'woocommerce' ),
+	'NAD' => __( 'Namibian dollar', 'woocommerce' ),
+	'NGN' => __( 'Nigerian naira', 'woocommerce' ),
+	'NIO' => __( 'Nicaraguan c&oacute;rdoba', 'woocommerce' ),
+	'NOK' => __( 'Norwegian krone', 'woocommerce' ),
+	'NPR' => __( 'Nepalese rupee', 'woocommerce' ),
+	'NZD' => __( 'New Zealand dollar', 'woocommerce' ),
+	'OMR' => __( 'Omani rial', 'woocommerce' ),
+	'PAB' => __( 'Panamanian balboa', 'woocommerce' ),
+	'PEN' => __( 'Sol', 'woocommerce' ),
+	'PGK' => __( 'Papua New Guinean kina', 'woocommerce' ),
+	'PHP' => __( 'Philippine peso', 'woocommerce' ),
+	'PKR' => __( 'Pakistani rupee', 'woocommerce' ),
+	'PLN' => __( 'Polish z&#x142;oty', 'woocommerce' ),
+	'PRB' => __( 'Transnistrian ruble', 'woocommerce' ),
+	'PYG' => __( 'Paraguayan guaran&iacute;', 'woocommerce' ),
+	'QAR' => __( 'Qatari riyal', 'woocommerce' ),
+	'RON' => __( 'Romanian leu', 'woocommerce' ),
+	'RSD' => __( 'Serbian dinar', 'woocommerce' ),
+	'RUB' => __( 'Russian ruble', 'woocommerce' ),
+	'RWF' => __( 'Rwandan franc', 'woocommerce' ),
+	'SAR' => __( 'Saudi riyal', 'woocommerce' ),
+	'SBD' => __( 'Solomon Islands dollar', 'woocommerce' ),
+	'SCR' => __( 'Seychellois rupee', 'woocommerce' ),
+	'SDG' => __( 'Sudanese pound', 'woocommerce' ),
+	'SEK' => __( 'Swedish krona', 'woocommerce' ),
+	'SGD' => __( 'Singapore dollar', 'woocommerce' ),
+	'SHP' => __( 'Saint Helena pound', 'woocommerce' ),
+	'SLL' => __( 'Sierra Leonean leone', 'woocommerce' ),
+	'SOS' => __( 'Somali shilling', 'woocommerce' ),
+	'SRD' => __( 'Surinamese dollar', 'woocommerce' ),
+	'SSP' => __( 'South Sudanese pound', 'woocommerce' ),
+	'STN' => __( 'S&atilde;o Tom&eacute; and Pr&iacute;ncipe dobra', 'woocommerce' ),
+	'SYP' => __( 'Syrian pound', 'woocommerce' ),
+	'SZL' => __( 'Swazi lilangeni', 'woocommerce' ),
+	'THB' => __( 'Thai baht', 'woocommerce' ),
+	'TJS' => __( 'Tajikistani somoni', 'woocommerce' ),
+	'TMT' => __( 'Turkmenistan manat', 'woocommerce' ),
+	'TND' => __( 'Tunisian dinar', 'woocommerce' ),
+	'TOP' => __( 'Tongan pa&#x2bb;anga', 'woocommerce' ),
+	'TRY' => __( 'Turkish lira', 'woocommerce' ),
+	'TTD' => __( 'Trinidad and Tobago dollar', 'woocommerce' ),
+	'TWD' => __( 'New Taiwan dollar', 'woocommerce' ),
+	'TZS' => __( 'Tanzanian shilling', 'woocommerce' ),
+	'UAH' => __( 'Ukrainian hryvnia', 'woocommerce' ),
+	'UGX' => __( 'Ugandan shilling', 'woocommerce' ),
+	'USD' => __( 'United States (US) dollar', 'woocommerce' ),
+	'UYU' => __( 'Uruguayan peso', 'woocommerce' ),
+	'UZS' => __( 'Uzbekistani som', 'woocommerce' ),
+	'VEF' => __( 'Venezuelan bol&iacute;var (2008–2018)', 'woocommerce' ),
+	'VES' => __( 'Venezuelan bol&iacute;var', 'woocommerce' ),
+	'VND' => __( 'Vietnamese &#x111;&#x1ed3;ng', 'woocommerce' ),
+	'VUV' => __( 'Vanuatu vatu', 'woocommerce' ),
+	'WST' => __( 'Samoan t&#x101;l&#x101;', 'woocommerce' ),
+	'XAF' => __( 'Central African CFA franc', 'woocommerce' ),
+	'XCD' => __( 'East Caribbean dollar', 'woocommerce' ),
+	'XOF' => __( 'West African CFA franc', 'woocommerce' ),
+	'XPF' => __( 'CFP franc', 'woocommerce' ),
+	'YER' => __( 'Yemeni rial', 'woocommerce' ),
+	'ZAR' => __( 'South African rand', 'woocommerce' ),
+	'ZMW' => __( 'Zambian kwacha', 'woocommerce' ),
+);
diff --git a/plugins/woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-data-currencies-controller.php b/plugins/woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-data-currencies-controller.php
index 1eda22a0be..46a9e25fb0 100644
--- a/plugins/woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-data-currencies-controller.php
+++ b/plugins/woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-data-currencies-controller.php
@@ -8,6 +8,8 @@
  * @since   3.5.0
  */

+use Automattic\WooCommerce\Internal\Traits\RestApiCache;
+
 defined( 'ABSPATH' ) || exit;

 /**
@@ -17,6 +19,8 @@ defined( 'ABSPATH' ) || exit;
  */
 class WC_REST_Data_Currencies_Controller extends WC_REST_Data_Controller {

+	use RestApiCache;
+
 	/**
 	 * Endpoint namespace.
 	 *
@@ -31,6 +35,13 @@ class WC_REST_Data_Currencies_Controller extends WC_REST_Data_Controller {
 	 */
 	protected $rest_base = 'data/currencies';

+	/**
+	 * Constructor.
+	 */
+	public function __construct() {
+		$this->initialize_rest_api_cache();
+	}
+
 	/**
 	 * Register routes.
 	 */
@@ -41,7 +52,7 @@ class WC_REST_Data_Currencies_Controller extends WC_REST_Data_Controller {
 			array(
 				array(
 					'methods'             => WP_REST_Server::READABLE,
-					'callback'            => array( $this, 'get_items' ),
+					'callback'            => $this->with_cache( array( $this, 'get_items' ) ),
 					'permission_callback' => array( $this, 'get_items_permissions_check' ),
 				),
 				'schema' => array( $this, 'get_public_item_schema' ),
@@ -65,7 +76,7 @@ class WC_REST_Data_Currencies_Controller extends WC_REST_Data_Controller {
 			array(
 				array(
 					'methods'             => WP_REST_Server::READABLE,
-					'callback'            => array( $this, 'get_item' ),
+					'callback'            => $this->with_cache( array( $this, 'get_item' ) ),
 					'permission_callback' => array( $this, 'get_item_permissions_check' ),
 					'args'                => array(
 						'location' => array(
@@ -225,4 +236,49 @@ class WC_REST_Data_Currencies_Controller extends WC_REST_Data_Controller {

 		return $this->add_additional_fields_schema( $schema );
 	}
+
+	/**
+	 * Get the default entity type for response caching.
+	 *
+	 * @return string|null The entity type.
+	 */
+	protected function get_default_response_entity_type(): ?string {
+		return 'currency';
+	}
+
+	/**
+	 * Get the files relevant to response caching.
+	 *
+	 * @param WP_REST_Request<array<string, mixed>> $request     The request object.
+	 * @param string|null                           $endpoint_id Optional endpoint identifier.
+	 * @return array Array of file paths to track for cache invalidation.
+	 */
+	protected function get_files_relevant_to_response_caching( WP_REST_Request $request, ?string $endpoint_id = null ): array { // phpcs:ignore Squiz.Commenting.FunctionComment.IncorrectTypeHint
+		return array( 'i18n/currencies.php' );
+	}
+
+	/**
+	 * Whether the response cache should vary by user.
+	 *
+	 * @param WP_REST_Request<array<string, mixed>> $request     The request object.
+	 * @param string|null                           $endpoint_id Optional endpoint identifier.
+	 * @return bool False since currency data doesn't vary by user.
+	 */
+	protected function response_cache_vary_by_user( WP_REST_Request $request, ?string $endpoint_id = null ): bool { // phpcs:ignore Squiz.Commenting.FunctionComment.IncorrectTypeHint
+		return false;
+	}
+
+	/**
+	 * Extract entity IDs from response data.
+	 *
+	 * Currencies don't have entity IDs, cache invalidation is file-based.
+	 *
+	 * @param array                                 $response_data Response data.
+	 * @param WP_REST_Request<array<string, mixed>> $request       The request object.
+	 * @param string|null                           $endpoint_id   Optional endpoint identifier.
+	 * @return array Empty array since currencies don't have entity IDs.
+	 */
+	protected function extract_entity_ids_from_response( array $response_data, WP_REST_Request $request, ?string $endpoint_id = null ): array { // phpcs:ignore Squiz.Commenting.FunctionComment.IncorrectTypeHint
+		return array();
+	}
 }
diff --git a/plugins/woocommerce/includes/wc-core-functions.php b/plugins/woocommerce/includes/wc-core-functions.php
index 256ab1a7d0..a915bba9e6 100644
--- a/plugins/woocommerce/includes/wc-core-functions.php
+++ b/plugins/woocommerce/includes/wc-core-functions.php
@@ -498,174 +498,13 @@ function get_woocommerce_currencies() {

 	if ( ! isset( $currencies ) ) {
 		$currencies = array_unique(
-			apply_filters(
-				'woocommerce_currencies',
-				array(
-					'AED' => __( 'United Arab Emirates dirham', 'woocommerce' ),
-					'AFN' => __( 'Afghan afghani', 'woocommerce' ),
-					'ALL' => __( 'Albanian lek', 'woocommerce' ),
-					'AMD' => __( 'Armenian dram', 'woocommerce' ),
-					'ANG' => __( 'Netherlands Antillean guilder', 'woocommerce' ),
-					'AOA' => __( 'Angolan kwanza', 'woocommerce' ),
-					'ARS' => __( 'Argentine peso', 'woocommerce' ),
-					'AUD' => __( 'Australian dollar', 'woocommerce' ),
-					'AWG' => __( 'Aruban florin', 'woocommerce' ),
-					'AZN' => __( 'Azerbaijani manat', 'woocommerce' ),
-					'BAM' => __( 'Bosnia and Herzegovina convertible mark', 'woocommerce' ),
-					'BBD' => __( 'Barbadian dollar', 'woocommerce' ),
-					'BDT' => __( 'Bangladeshi taka', 'woocommerce' ),
-					'BGN' => __( 'Bulgarian lev', 'woocommerce' ),
-					'BHD' => __( 'Bahraini dinar', 'woocommerce' ),
-					'BIF' => __( 'Burundian franc', 'woocommerce' ),
-					'BMD' => __( 'Bermudian dollar', 'woocommerce' ),
-					'BND' => __( 'Brunei dollar', 'woocommerce' ),
-					'BOB' => __( 'Bolivian boliviano', 'woocommerce' ),
-					'BRL' => __( 'Brazilian real', 'woocommerce' ),
-					'BSD' => __( 'Bahamian dollar', 'woocommerce' ),
-					'BTC' => __( 'Bitcoin', 'woocommerce' ),
-					'BTN' => __( 'Bhutanese ngultrum', 'woocommerce' ),
-					'BWP' => __( 'Botswana pula', 'woocommerce' ),
-					'BYR' => __( 'Belarusian ruble (old)', 'woocommerce' ),
-					'BYN' => __( 'Belarusian ruble', 'woocommerce' ),
-					'BZD' => __( 'Belize dollar', 'woocommerce' ),
-					'CAD' => __( 'Canadian dollar', 'woocommerce' ),
-					'CDF' => __( 'Congolese franc', 'woocommerce' ),
-					'CHF' => __( 'Swiss franc', 'woocommerce' ),
-					'CLP' => __( 'Chilean peso', 'woocommerce' ),
-					'CNY' => __( 'Chinese yuan', 'woocommerce' ),
-					'COP' => __( 'Colombian peso', 'woocommerce' ),
-					'CRC' => __( 'Costa Rican col&oacute;n', 'woocommerce' ),
-					'CUC' => __( 'Cuban convertible peso', 'woocommerce' ),
-					'CUP' => __( 'Cuban peso', 'woocommerce' ),
-					'CVE' => __( 'Cape Verdean escudo', 'woocommerce' ),
-					'CZK' => __( 'Czech koruna', 'woocommerce' ),
-					'DJF' => __( 'Djiboutian franc', 'woocommerce' ),
-					'DKK' => __( 'Danish krone', 'woocommerce' ),
-					'DOP' => __( 'Dominican peso', 'woocommerce' ),
-					'DZD' => __( 'Algerian dinar', 'woocommerce' ),
-					'EGP' => __( 'Egyptian pound', 'woocommerce' ),
-					'ERN' => __( 'Eritrean nakfa', 'woocommerce' ),
-					'ETB' => __( 'Ethiopian birr', 'woocommerce' ),
-					'EUR' => __( 'Euro', 'woocommerce' ),
-					'FJD' => __( 'Fijian dollar', 'woocommerce' ),
-					'FKP' => __( 'Falkland Islands pound', 'woocommerce' ),
-					'GBP' => __( 'Pound sterling', 'woocommerce' ),
-					'GEL' => __( 'Georgian lari', 'woocommerce' ),
-					'GGP' => __( 'Guernsey pound', 'woocommerce' ),
-					'GHS' => __( 'Ghana cedi', 'woocommerce' ),
-					'GIP' => __( 'Gibraltar pound', 'woocommerce' ),
-					'GMD' => __( 'Gambian dalasi', 'woocommerce' ),
-					'GNF' => __( 'Guinean franc', 'woocommerce' ),
-					'GTQ' => __( 'Guatemalan quetzal', 'woocommerce' ),
-					'GYD' => __( 'Guyanese dollar', 'woocommerce' ),
-					'HKD' => __( 'Hong Kong dollar', 'woocommerce' ),
-					'HNL' => __( 'Honduran lempira', 'woocommerce' ),
-					'HRK' => __( 'Croatian kuna', 'woocommerce' ),
-					'HTG' => __( 'Haitian gourde', 'woocommerce' ),
-					'HUF' => __( 'Hungarian forint', 'woocommerce' ),
-					'IDR' => __( 'Indonesian rupiah', 'woocommerce' ),
-					'ILS' => __( 'Israeli new shekel', 'woocommerce' ),
-					'IMP' => __( 'Manx pound', 'woocommerce' ),
-					'INR' => __( 'Indian rupee', 'woocommerce' ),
-					'IQD' => __( 'Iraqi dinar', 'woocommerce' ),
-					'IRR' => __( 'Iranian rial', 'woocommerce' ),
-					'IRT' => __( 'Iranian toman', 'woocommerce' ),
-					'ISK' => __( 'Icelandic kr&oacute;na', 'woocommerce' ),
-					'JEP' => __( 'Jersey pound', 'woocommerce' ),
-					'JMD' => __( 'Jamaican dollar', 'woocommerce' ),
-					'JOD' => __( 'Jordanian dinar', 'woocommerce' ),
-					'JPY' => __( 'Japanese yen', 'woocommerce' ),
-					'KES' => __( 'Kenyan shilling', 'woocommerce' ),
-					'KGS' => __( 'Kyrgyzstani som', 'woocommerce' ),
-					'KHR' => __( 'Cambodian riel', 'woocommerce' ),
-					'KMF' => __( 'Comorian franc', 'woocommerce' ),
-					'KPW' => __( 'North Korean won', 'woocommerce' ),
-					'KRW' => __( 'South Korean won', 'woocommerce' ),
-					'KWD' => __( 'Kuwaiti dinar', 'woocommerce' ),
-					'KYD' => __( 'Cayman Islands dollar', 'woocommerce' ),
-					'KZT' => __( 'Kazakhstani tenge', 'woocommerce' ),
-					'LAK' => __( 'Lao kip', 'woocommerce' ),
-					'LBP' => __( 'Lebanese pound', 'woocommerce' ),
-					'LKR' => __( 'Sri Lankan rupee', 'woocommerce' ),
-					'LRD' => __( 'Liberian dollar', 'woocommerce' ),
-					'LSL' => __( 'Lesotho loti', 'woocommerce' ),
-					'LYD' => __( 'Libyan dinar', 'woocommerce' ),
-					'MAD' => __( 'Moroccan dirham', 'woocommerce' ),
-					'MDL' => __( 'Moldovan leu', 'woocommerce' ),
-					'MGA' => __( 'Malagasy ariary', 'woocommerce' ),
-					'MKD' => __( 'Macedonian denar', 'woocommerce' ),
-					'MMK' => __( 'Burmese kyat', 'woocommerce' ),
-					'MNT' => __( 'Mongolian t&ouml;gr&ouml;g', 'woocommerce' ),
-					'MOP' => __( 'Macanese pataca', 'woocommerce' ),
-					'MRU' => __( 'Mauritanian ouguiya', 'woocommerce' ),
-					'MUR' => __( 'Mauritian rupee', 'woocommerce' ),
-					'MVR' => __( 'Maldivian rufiyaa', 'woocommerce' ),
-					'MWK' => __( 'Malawian kwacha', 'woocommerce' ),
-					'MXN' => __( 'Mexican peso', 'woocommerce' ),
-					'MYR' => __( 'Malaysian ringgit', 'woocommerce' ),
-					'MZN' => __( 'Mozambican metical', 'woocommerce' ),
-					'NAD' => __( 'Namibian dollar', 'woocommerce' ),
-					'NGN' => __( 'Nigerian naira', 'woocommerce' ),
-					'NIO' => __( 'Nicaraguan c&oacute;rdoba', 'woocommerce' ),
-					'NOK' => __( 'Norwegian krone', 'woocommerce' ),
-					'NPR' => __( 'Nepalese rupee', 'woocommerce' ),
-					'NZD' => __( 'New Zealand dollar', 'woocommerce' ),
-					'OMR' => __( 'Omani rial', 'woocommerce' ),
-					'PAB' => __( 'Panamanian balboa', 'woocommerce' ),
-					'PEN' => __( 'Sol', 'woocommerce' ),
-					'PGK' => __( 'Papua New Guinean kina', 'woocommerce' ),
-					'PHP' => __( 'Philippine peso', 'woocommerce' ),
-					'PKR' => __( 'Pakistani rupee', 'woocommerce' ),
-					'PLN' => __( 'Polish z&#x142;oty', 'woocommerce' ),
-					'PRB' => __( 'Transnistrian ruble', 'woocommerce' ),
-					'PYG' => __( 'Paraguayan guaran&iacute;', 'woocommerce' ),
-					'QAR' => __( 'Qatari riyal', 'woocommerce' ),
-					'RON' => __( 'Romanian leu', 'woocommerce' ),
-					'RSD' => __( 'Serbian dinar', 'woocommerce' ),
-					'RUB' => __( 'Russian ruble', 'woocommerce' ),
-					'RWF' => __( 'Rwandan franc', 'woocommerce' ),
-					'SAR' => __( 'Saudi riyal', 'woocommerce' ),
-					'SBD' => __( 'Solomon Islands dollar', 'woocommerce' ),
-					'SCR' => __( 'Seychellois rupee', 'woocommerce' ),
-					'SDG' => __( 'Sudanese pound', 'woocommerce' ),
-					'SEK' => __( 'Swedish krona', 'woocommerce' ),
-					'SGD' => __( 'Singapore dollar', 'woocommerce' ),
-					'SHP' => __( 'Saint Helena pound', 'woocommerce' ),
-					'SLL' => __( 'Sierra Leonean leone', 'woocommerce' ),
-					'SOS' => __( 'Somali shilling', 'woocommerce' ),
-					'SRD' => __( 'Surinamese dollar', 'woocommerce' ),
-					'SSP' => __( 'South Sudanese pound', 'woocommerce' ),
-					'STN' => __( 'S&atilde;o Tom&eacute; and Pr&iacute;ncipe dobra', 'woocommerce' ),
-					'SYP' => __( 'Syrian pound', 'woocommerce' ),
-					'SZL' => __( 'Swazi lilangeni', 'woocommerce' ),
-					'THB' => __( 'Thai baht', 'woocommerce' ),
-					'TJS' => __( 'Tajikistani somoni', 'woocommerce' ),
-					'TMT' => __( 'Turkmenistan manat', 'woocommerce' ),
-					'TND' => __( 'Tunisian dinar', 'woocommerce' ),
-					'TOP' => __( 'Tongan pa&#x2bb;anga', 'woocommerce' ),
-					'TRY' => __( 'Turkish lira', 'woocommerce' ),
-					'TTD' => __( 'Trinidad and Tobago dollar', 'woocommerce' ),
-					'TWD' => __( 'New Taiwan dollar', 'woocommerce' ),
-					'TZS' => __( 'Tanzanian shilling', 'woocommerce' ),
-					'UAH' => __( 'Ukrainian hryvnia', 'woocommerce' ),
-					'UGX' => __( 'Ugandan shilling', 'woocommerce' ),
-					'USD' => __( 'United States (US) dollar', 'woocommerce' ),
-					'UYU' => __( 'Uruguayan peso', 'woocommerce' ),
-					'UZS' => __( 'Uzbekistani som', 'woocommerce' ),
-					'VEF' => __( 'Venezuelan bol&iacute;var (2008–2018)', 'woocommerce' ),
-					'VES' => __( 'Venezuelan bol&iacute;var', 'woocommerce' ),
-					'VND' => __( 'Vietnamese &#x111;&#x1ed3;ng', 'woocommerce' ),
-					'VUV' => __( 'Vanuatu vatu', 'woocommerce' ),
-					'WST' => __( 'Samoan t&#x101;l&#x101;', 'woocommerce' ),
-					'XAF' => __( 'Central African CFA franc', 'woocommerce' ),
-					'XCD' => __( 'East Caribbean dollar', 'woocommerce' ),
-					'XOF' => __( 'West African CFA franc', 'woocommerce' ),
-					'XPF' => __( 'CFP franc', 'woocommerce' ),
-					'YER' => __( 'Yemeni rial', 'woocommerce' ),
-					'ZAR' => __( 'South African rand', 'woocommerce' ),
-					'ZMW' => __( 'Zambian kwacha', 'woocommerce' ),
-				)
-			)
+			/**
+			 * Filters the list of available currencies.
+			 *
+			 * @since 2.1.0
+			 * @param array $currencies Array of currency codes and names.
+			 */
+			apply_filters( 'woocommerce_currencies', include WC()->plugin_path() . '/i18n/currencies.php' )
 		);
 	}