Open-source personal finance manager. Self-hosted, privacy-first.
feat: add Malaysian ringgit (MYR) currency support (#939)
Shayn Hornik5c0f44d4610c
diff --git a/backend/app/api/currencies.py b/backend/app/api/currencies.pyindex 862b7fa8..3338aa8c 100644--- a/backend/app/api/currencies.py+++ b/backend/app/api/currencies.py@@ -45,6 +45,7 @@ CURRENCY_META = {"AED": {"symbol": "د.إ", "name": "UAE Dirham", "flag": "\U0001F1E6\U0001F1EA"},"THB": {"symbol": "\u0e3f", "name": "Thai Baht", "flag": "\U0001F1F9\U0001F1ED"},"EGP": {"symbol": "E£", "name": "Egyptian Pound", "flag": "\U0001F1EA\U0001F1EC"},+ "MYR": {"symbol": "RM", "name": "Malaysian Ringgit", "flag": "\U0001F1F2\U0001F1FE"},}diff --git a/backend/app/core/config.py b/backend/app/core/config.pyindex cf88db23..4dc6fadf 100644--- a/backend/app/core/config.py+++ b/backend/app/core/config.py@@ -66,7 +66,7 @@ class Settings(BaseSettings):# FX Ratesopenexchangerates_app_id: str = ""- supported_currencies: str = "USD,EUR,GBP,BRL,CAD,AUD,CHF,ARS,JPY,MXN,INR,SEK,DKK,NOK,PLN,CZK,HUF,RON,CRC,IDR,COP,CLP,DOP,RUB,GTQ,PHP,UAH,NZD,VND,SGD,AZN,TRY,PKR,MDL,AED,THB,EGP" # comma-separated list+ supported_currencies: str = "USD,EUR,GBP,BRL,CAD,AUD,CHF,ARS,JPY,MXN,INR,SEK,DKK,NOK,PLN,CZK,HUF,RON,CRC,IDR,COP,CLP,DOP,RUB,GTQ,PHP,UAH,NZD,VND,SGD,AZN,TRY,PKR,MDL,AED,THB,EGP,MYR" # comma-separated listfx_sync_mode: str = "on_demand" # "on_demand" or "scheduled"# Storagediff --git a/backend/tests/test_currencies_api.py b/backend/tests/test_currencies_api.pyindex 88fd00bc..da43a9c7 100644--- a/backend/tests/test_currencies_api.py+++ b/backend/tests/test_currencies_api.py@@ -173,3 +173,12 @@ async def test_currencies_include_egp_with_metadata(client: AsyncClient):assert egp["symbol"] == "E£"assert egp["name"] == "Egyptian Pound"assert egp["flag"] == "🇪🇬"+async def test_currencies_include_myr_with_metadata(client: AsyncClient):+ response = await client.get("/api/currencies")+ data = response.json()+ myr = next((currency for currency in data if currency["code"] == "MYR"), None)++ assert myr is not None+ assert myr["symbol"] == "RM"+ assert myr["name"] == "Malaysian Ringgit"+ assert myr["flag"] == "🇲🇾"diff --git a/frontend/src/components/currency-select.tsx b/frontend/src/components/currency-select.tsxindex 839560f5..8af09e54 100644--- a/frontend/src/components/currency-select.tsx+++ b/frontend/src/components/currency-select.tsx@@ -47,6 +47,7 @@ export const CURRENCIES = [{ code: 'AED', flag: '\u{1F1E6}\u{1F1EA}', symbol: 'د.إ' },{ code: 'THB', flag: '\u{1F1F9}\u{1F1ED}', symbol: '฿' },{ code: 'EGP', flag: '\u{1F1EA}\u{1F1EC}', symbol: 'E£' },+ { code: 'MYR', flag: '\u{1F1F2}\u{1F1FE}', symbol: 'RM' },] as constinterface CurrencySelectProps {diff --git a/frontend/src/lib/format.ts b/frontend/src/lib/format.tsindex 6c26ce45..e1a1f25b 100644--- a/frontend/src/lib/format.ts+++ b/frontend/src/lib/format.ts@@ -70,6 +70,7 @@ const CURRENCY_LOCALE: Record<string, string> = {AED: 'ar-AE',THB: 'th-TH',EGP: 'en-EG',+ MYR: 'ms-MY',}/**