From 03cbb3412a4d3daa4bb907e555593af278c34f49 Mon Sep 17 00:00:00 2001 From: Alvaro Yepes Date: Sun, 17 May 2026 18:03:13 -0500 Subject: [PATCH] feat: Add COP (Colombian Peso) currency support - Add COP to supportedCurrencyCodes - Regenerate currency-data.json with COP for all 23 locales (symbol: CO$, decimal_digits: 0) - Fix generateCurrencyData script to output pretty-printed JSON --- package-lock.json | 11 -- src/lib/currency-data.json | 209 +++++++++++++++++++++++++++- src/lib/currency.ts | 21 +-- src/scripts/generateCurrencyData.ts | 2 +- 4 files changed, 220 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index 17f239100..0fa9676ea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16501,17 +16501,6 @@ } } }, - "node_modules/next-intl/node_modules/@swc/helpers": { - "version": "0.5.17", - "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.17.tgz", - "integrity": "sha512-5IKx/Y13RsYd+sauPb2x+U/xZikHjolzfuDgTAl/Tdf3Q8rslRvC19NKDLgAJQ6wsqADk10ntlv08nPFw/gO/A==", - "license": "Apache-2.0", - "optional": true, - "peer": true, - "dependencies": { - "tslib": "^2.8.0" - } - }, "node_modules/next-intl/node_modules/negotiator": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", diff --git a/src/lib/currency-data.json b/src/lib/currency-data.json index 85c48f355..3484ff6d6 100644 --- a/src/lib/currency-data.json +++ b/src/lib/currency-data.json @@ -269,6 +269,15 @@ "name_plural": "South African rand", "rounding": 0, "decimal_digits": 2 + }, + "COP": { + "name": "Peso Kolombia", + "symbol_native": "$", + "symbol": "CO$", + "code": "COP", + "name_plural": "Colombian pesos", + "rounding": 0, + "decimal_digits": 0 } }, "ca": { @@ -541,6 +550,15 @@ "name_plural": "South African rand", "rounding": 0, "decimal_digits": 2 + }, + "COP": { + "name": "peso colombià", + "symbol_native": "$", + "symbol": "CO$", + "code": "COP", + "name_plural": "Colombian pesos", + "rounding": 0, + "decimal_digits": 0 } }, "cs-CZ": { @@ -813,6 +831,15 @@ "name_plural": "South African rand", "rounding": 0, "decimal_digits": 2 + }, + "COP": { + "name": "kolumbijské peso", + "symbol_native": "$", + "symbol": "CO$", + "code": "COP", + "name_plural": "Colombian pesos", + "rounding": 0, + "decimal_digits": 0 } }, "de-DE": { @@ -1085,6 +1112,15 @@ "name_plural": "South African rand", "rounding": 0, "decimal_digits": 2 + }, + "COP": { + "name": "Kolumbianischer Peso", + "symbol_native": "$", + "symbol": "CO$", + "code": "COP", + "name_plural": "Colombian pesos", + "rounding": 0, + "decimal_digits": 0 } }, "en-US": { @@ -1357,6 +1393,15 @@ "name_plural": "South African rand", "rounding": 0, "decimal_digits": 2 + }, + "COP": { + "name": "Colombian Peso", + "symbol_native": "$", + "symbol": "CO$", + "code": "COP", + "name_plural": "Colombian pesos", + "rounding": 0, + "decimal_digits": 0 } }, "es": { @@ -1629,6 +1674,15 @@ "name_plural": "South African rand", "rounding": 0, "decimal_digits": 2 + }, + "COP": { + "name": "peso colombiano", + "symbol_native": "$", + "symbol": "CO$", + "code": "COP", + "name_plural": "Colombian pesos", + "rounding": 0, + "decimal_digits": 0 } }, "eu": { @@ -1901,6 +1955,15 @@ "name_plural": "South African rand", "rounding": 0, "decimal_digits": 2 + }, + "COP": { + "name": "Kolonbiako pesoa", + "symbol_native": "$", + "symbol": "CO$", + "code": "COP", + "name_plural": "Colombian pesos", + "rounding": 0, + "decimal_digits": 0 } }, "fr-FR": { @@ -2173,6 +2236,15 @@ "name_plural": "South African rand", "rounding": 0, "decimal_digits": 2 + }, + "COP": { + "name": "peso colombien", + "symbol_native": "$", + "symbol": "CO$", + "code": "COP", + "name_plural": "Colombian pesos", + "rounding": 0, + "decimal_digits": 0 } }, "it-IT": { @@ -2445,6 +2517,15 @@ "name_plural": "South African rand", "rounding": 0, "decimal_digits": 2 + }, + "COP": { + "name": "peso colombiano", + "symbol_native": "$", + "symbol": "CO$", + "code": "COP", + "name_plural": "Colombian pesos", + "rounding": 0, + "decimal_digits": 0 } }, "nl-NL": { @@ -2717,6 +2798,15 @@ "name_plural": "South African rand", "rounding": 0, "decimal_digits": 2 + }, + "COP": { + "name": "Colombiaanse peso", + "symbol_native": "$", + "symbol": "CO$", + "code": "COP", + "name_plural": "Colombian pesos", + "rounding": 0, + "decimal_digits": 0 } }, "pl-PL": { @@ -2989,6 +3079,15 @@ "name_plural": "South African rand", "rounding": 0, "decimal_digits": 2 + }, + "COP": { + "name": "peso kolumbijskie", + "symbol_native": "$", + "symbol": "CO$", + "code": "COP", + "name_plural": "Colombian pesos", + "rounding": 0, + "decimal_digits": 0 } }, "pt": { @@ -3261,6 +3360,15 @@ "name_plural": "South African rand", "rounding": 0, "decimal_digits": 2 + }, + "COP": { + "name": "Peso colombiano", + "symbol_native": "$", + "symbol": "CO$", + "code": "COP", + "name_plural": "Colombian pesos", + "rounding": 0, + "decimal_digits": 0 } }, "pt-BR": { @@ -3533,6 +3641,15 @@ "name_plural": "South African rand", "rounding": 0, "decimal_digits": 2 + }, + "COP": { + "name": "Peso colombiano", + "symbol_native": "$", + "symbol": "CO$", + "code": "COP", + "name_plural": "Colombian pesos", + "rounding": 0, + "decimal_digits": 0 } }, "ro": { @@ -3805,6 +3922,15 @@ "name_plural": "South African rand", "rounding": 0, "decimal_digits": 2 + }, + "COP": { + "name": "peso columbian", + "symbol_native": "$", + "symbol": "CO$", + "code": "COP", + "name_plural": "Colombian pesos", + "rounding": 0, + "decimal_digits": 0 } }, "fi": { @@ -4077,6 +4203,15 @@ "name_plural": "South African rand", "rounding": 0, "decimal_digits": 2 + }, + "COP": { + "name": "Kolumbian peso", + "symbol_native": "$", + "symbol": "CO$", + "code": "COP", + "name_plural": "Colombian pesos", + "rounding": 0, + "decimal_digits": 0 } }, "tr-TR": { @@ -4349,6 +4484,15 @@ "name_plural": "South African rand", "rounding": 0, "decimal_digits": 2 + }, + "COP": { + "name": "Kolombiya Pesosu", + "symbol_native": "$", + "symbol": "CO$", + "code": "COP", + "name_plural": "Colombian pesos", + "rounding": 0, + "decimal_digits": 0 } }, "ru-RU": { @@ -4621,6 +4765,15 @@ "name_plural": "South African rand", "rounding": 0, "decimal_digits": 2 + }, + "COP": { + "name": "Колумбийское песо", + "symbol_native": "$", + "symbol": "CO$", + "code": "COP", + "name_plural": "Colombian pesos", + "rounding": 0, + "decimal_digits": 0 } }, "uk-UA": { @@ -4893,6 +5046,15 @@ "name_plural": "South African rand", "rounding": 0, "decimal_digits": 2 + }, + "COP": { + "name": "колумбійський песо", + "symbol_native": "$", + "symbol": "CO$", + "code": "COP", + "name_plural": "Colombian pesos", + "rounding": 0, + "decimal_digits": 0 } }, "he": { @@ -5165,6 +5327,15 @@ "name_plural": "South African rand", "rounding": 0, "decimal_digits": 2 + }, + "COP": { + "name": "פסו קולומביאני", + "symbol_native": "$", + "symbol": "CO$", + "code": "COP", + "name_plural": "Colombian pesos", + "rounding": 0, + "decimal_digits": 0 } }, "ko": { @@ -5437,6 +5608,15 @@ "name_plural": "South African rand", "rounding": 0, "decimal_digits": 2 + }, + "COP": { + "name": "콜롬비아 페소", + "symbol_native": "$", + "symbol": "CO$", + "code": "COP", + "name_plural": "Colombian pesos", + "rounding": 0, + "decimal_digits": 0 } }, "ja-JP": { @@ -5709,6 +5889,15 @@ "name_plural": "South African rand", "rounding": 0, "decimal_digits": 2 + }, + "COP": { + "name": "コロンビア ペソ", + "symbol_native": "$", + "symbol": "CO$", + "code": "COP", + "name_plural": "Colombian pesos", + "rounding": 0, + "decimal_digits": 0 } }, "zh-CN": { @@ -5981,6 +6170,15 @@ "name_plural": "South African rand", "rounding": 0, "decimal_digits": 2 + }, + "COP": { + "name": "哥伦比亚比索", + "symbol_native": "$", + "symbol": "CO$", + "code": "COP", + "name_plural": "Colombian pesos", + "rounding": 0, + "decimal_digits": 0 } }, "zh-TW": { @@ -6253,6 +6451,15 @@ "name_plural": "South African rand", "rounding": 0, "decimal_digits": 2 + }, + "COP": { + "name": "哥伦比亚比索", + "symbol_native": "$", + "symbol": "CO$", + "code": "COP", + "name_plural": "Colombian pesos", + "rounding": 0, + "decimal_digits": 0 } } -} +} \ No newline at end of file diff --git a/src/lib/currency.ts b/src/lib/currency.ts index 031fef5b2..9b4e6083b 100644 --- a/src/lib/currency.ts +++ b/src/lib/currency.ts @@ -42,6 +42,7 @@ export const supportedCurrencyCodes = [ 'SGD', 'THB', 'ZAR', + 'COP', ] as const export type supportedCurrencyCodeType = (typeof supportedCurrencyCodes)[number] @@ -51,16 +52,16 @@ export function defaultCurrencyList( ) { const currencies = customChoice ? [ - { - name: customChoice, - symbol_native: '', - symbol: '', - code: '', - name_plural: customChoice, - rounding: 0, - decimal_digits: 2, - }, - ] + { + name: customChoice, + symbol_native: '', + symbol: '', + code: '', + name_plural: customChoice, + rounding: 0, + decimal_digits: 2, + }, + ] : [] const allCurrencies = currencyList[locale] return currencies.concat(Object.values(allCurrencies)) diff --git a/src/scripts/generateCurrencyData.ts b/src/scripts/generateCurrencyData.ts index d6011e274..48410b619 100644 --- a/src/scripts/generateCurrencyData.ts +++ b/src/scripts/generateCurrencyData.ts @@ -37,4 +37,4 @@ const currencyList = locales.reduce((curList, locale) => { } } -fs.writeFileSync('src/lib/currency-data.json', JSON.stringify(currencyList)) +fs.writeFileSync('src/lib/currency-data.json', JSON.stringify(currencyList, null, 2))