Skip to content

Open-source personal finance manager. Self-hosted, privacy-first.

feat: add Turkish lira currency support (#788)

arya7be239fd9441
diff --git a/backend/app/api/currencies.py b/backend/app/api/currencies.py
index b6603cb4..06aa9d29 100644
--- a/backend/app/api/currencies.py
+++ b/backend/app/api/currencies.py
@@ -39,6 +39,7 @@ CURRENCY_META = {
"NZD": {"symbol": "NZ$", "name": "New Zealand Dollar", "flag": "\U0001F1F3\U0001F1FF"},
"VND": {"symbol": "₫", "name": "Vietnamese Dong", "flag": "\U0001F1FB\U0001F1F3"},
"SGD": {"symbol": "S$", "name": "Singapore Dollar", "flag": "\U0001F1F8\U0001F1EC"},
+ "TRY": {"symbol": "₺", "name": "Turkish Lira", "flag": "\U0001F1F9\U0001F1F7"},
}
diff --git a/backend/app/core/config.py b/backend/app/core/config.py
index 858503e7..0f6085e4 100644
--- a/backend/app/core/config.py
+++ b/backend/app/core/config.py
@@ -66,7 +66,7 @@ class Settings(BaseSettings):
# FX Rates
openexchangerates_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" # 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" # comma-separated list
fx_sync_mode: str = "on_demand" # "on_demand" or "scheduled"
# Storage
diff --git a/backend/tests/test_currencies_api.py b/backend/tests/test_currencies_api.py
index 8f5c6a14..88ddac68 100644
--- a/backend/tests/test_currencies_api.py
+++ b/backend/tests/test_currencies_api.py
@@ -106,4 +106,16 @@ async def test_currencies_include_azn_with_metadata(client: AsyncClient):
assert azn is not None
assert azn["symbol"] == "₼"
assert azn["name"] == "Azerbaijani Manat"
- assert azn["flag"] == "🇦🇿"
\ No newline at end of file
+ assert azn["flag"] == "🇦🇿"
+
+
+async def test_currencies_include_try_with_metadata(client: AsyncClient):
+ response = await client.get("/api/currencies")
+ data = response.json()
+ turkish_lira = next((currency for currency in data if currency["code"] == "TRY"), None)
+
+ assert turkish_lira is not None
+ assert turkish_lira["symbol"] == "₺"
+ assert turkish_lira["name"] == "Turkish Lira"
+ assert turkish_lira["flag"] == "🇹🇷"
diff --git a/frontend/src/components/currency-select.tsx b/frontend/src/components/currency-select.tsx
index 58075862..791f29b3 100644
--- a/frontend/src/components/currency-select.tsx
+++ b/frontend/src/components/currency-select.tsx
@@ -41,6 +41,7 @@ export const CURRENCIES = [
{ code: 'NZD', flag: '\u{1F1F3}\u{1F1FF}', symbol: 'NZ$' },
{ code: 'VND', flag: '\u{1F1FB}\u{1F1F3}', symbol: '₫' },
{ code: 'SGD', flag: '\u{1F1F8}\u{1F1EC}', symbol: 'S$' },
+ { code: 'TRY', flag: '\u{1F1F9}\u{1F1F7}', symbol: '₺' },
] as const
interface CurrencySelectProps {
diff --git a/frontend/src/lib/format.ts b/frontend/src/lib/format.ts
index e07a8e79..0fb44677 100644
--- a/frontend/src/lib/format.ts
+++ b/frontend/src/lib/format.ts
@@ -64,6 +64,7 @@ const CURRENCY_LOCALE: Record<string, string> = {
VND: 'vi-VN',
SGD: 'en-SG',
AZN: 'az-AZ',
+ TRY: 'tr-TR',
}
/**