mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-11 20:44:32 -05:00
Add Indian Rupee (INR) Currency (#5483)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React, { ReactNode } from 'react';
|
||||
import React, { useMemo } from 'react';
|
||||
import { useTranslation, Trans } from 'react-i18next';
|
||||
|
||||
import { Select } from '@actual-app/components/select';
|
||||
@@ -17,6 +17,29 @@ import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
|
||||
export function CurrencySettings() {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const currencyTranslations = useMemo(
|
||||
() =>
|
||||
new Map<string, string>([
|
||||
['', t('None')],
|
||||
['AUD', t('Australian Dollar')],
|
||||
['CAD', t('Canadian Dollar')],
|
||||
['CHF', t('Swiss Franc')],
|
||||
['CNY', t('Yuan Renminbi')],
|
||||
['EUR', t('Euro')],
|
||||
['GBP', t('Pound Sterling')],
|
||||
['HKD', t('Hong Kong Dollar')],
|
||||
['INR', t('Indian Rupee')],
|
||||
// ['JPY', t('Yen')],
|
||||
['PHP', t('Philippine Peso')],
|
||||
['SEK', t('Swedish Krona')],
|
||||
['SGD', t('Singapore Dollar')],
|
||||
['TRY', t('Turkish Lira')],
|
||||
['USD', t('US Dollar')],
|
||||
['QAR', t('Qatari Riyal')],
|
||||
]),
|
||||
[t],
|
||||
);
|
||||
|
||||
const [defaultCurrencyCode, setDefaultCurrencyCodePref] = useSyncedPref(
|
||||
'defaultCurrencyCode',
|
||||
);
|
||||
@@ -35,24 +58,6 @@ export function CurrencySettings() {
|
||||
},
|
||||
});
|
||||
|
||||
const currencyTranslations = new Map([
|
||||
['', t('None')],
|
||||
['AUD', t('Australian Dollar')],
|
||||
['CAD', t('Canadian Dollar')],
|
||||
['CHF', t('Swiss Franc')],
|
||||
['CNY', t('Yuan Renminbi')],
|
||||
['EUR', t('Euro')],
|
||||
['GBP', t('Pound Sterling')],
|
||||
['HKD', t('Hong Kong Dollar')],
|
||||
// ['JPY', t('Yen')],
|
||||
['PHP', t('Philippine Peso')],
|
||||
['SEK', t('Swedish Krona')],
|
||||
['SGD', t('Singapore Dollar')],
|
||||
['TRY', t('Turkish Lira')],
|
||||
['USD', t('US Dollar')],
|
||||
['QAR', t('Qatari Riyal')],
|
||||
]);
|
||||
|
||||
const currencyOptions: [string, string][] = currencies.map(currency => {
|
||||
const translatedName =
|
||||
currencyTranslations.get(currency.code) ?? currency.name;
|
||||
|
||||
@@ -19,6 +19,7 @@ export const currencies: Currency[] = [
|
||||
{ code: 'EUR', name: 'Euro', symbol: '€', decimalPlaces: 2 },
|
||||
{ code: 'GBP', name: 'Pound Sterling', symbol: '£', decimalPlaces: 2 },
|
||||
{ code: 'HKD', name: 'Hong Kong Dollar', symbol: 'HK$', decimalPlaces: 2 },
|
||||
{ code: 'INR', name: 'Indian Rupee', symbol: '₹', decimalPlaces: 2 },
|
||||
// { code: 'JPY', name: 'Yen', symbol: '¥', decimalPlaces: 0 },
|
||||
{ code: 'PHP', name: 'Philippine Peso', symbol: '₱', decimalPlaces: 2 },
|
||||
{ code: 'SEK', name: 'Swedish Krona', symbol: 'kr', decimalPlaces: 2 },
|
||||
|
||||
6
upcoming-release-notes/5483.md
Normal file
6
upcoming-release-notes/5483.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Enhancements
|
||||
authors: [emilgeo]
|
||||
---
|
||||
|
||||
Add Indian Rupee (INR) currency
|
||||
Reference in New Issue
Block a user