Add localization for payment method and currency in transaction/settlement modules
- Add payment method name localization mapping for both Korean and English - Support payment methods: Credit Card, Virtual Account, Account Transfer, Simple Account Transfer, Mobile Payment, SSG Money, SSG Bank Account, Culture Voucher, Tmoney Pay - Update transaction list to use localized currency format (ko: 9,999,999원, en: ₩9,999,999) - Apply localization to payment method dropdown options in filters and list pages - Update settlement transaction info to display localized payment method names 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -83,6 +83,34 @@ export const AllTransactionFilter = ({
|
||||
const moidTidOptionsGroup = getAllTransactionMoidTidOptionsGroup(t);
|
||||
const allTransactionStatusCode = getAllTransactionStatusCode(t);
|
||||
|
||||
const getLocalizedServiceCodeName = (name?: string): string => {
|
||||
if (!name) return '';
|
||||
|
||||
const nameMap: Record<string, string> = {
|
||||
'전체': t('transaction.constants.all'),
|
||||
'신용카드': t('transaction.constants.creditCard'),
|
||||
'계좌이체': t('transaction.constants.accountTransfer'),
|
||||
'가상계좌': t('transaction.constants.virtualAccount'),
|
||||
'휴대폰': t('transaction.constants.mobilePayment'),
|
||||
'문화상품권': t('transaction.constants.cultureLand'),
|
||||
'(구)SSG머니': t('transaction.constants.ssgMoney'),
|
||||
'SSG은행계좌결제': t('transaction.constants.ssgBank'),
|
||||
'계좌간편결제': t('transaction.constants.accountSimpleTransfer'),
|
||||
'티머니페이': t('transaction.constants.tmoneyPay'),
|
||||
};
|
||||
|
||||
return nameMap[name] || name;
|
||||
};
|
||||
|
||||
const getLocalizedServiceCodeOptions = () => {
|
||||
if (!serviceCodeOptions) return [];
|
||||
|
||||
return serviceCodeOptions.map(option => ({
|
||||
...option,
|
||||
name: getLocalizedServiceCodeName(option.name)
|
||||
}));
|
||||
};
|
||||
|
||||
const onClickToClose = () => {
|
||||
setFilterOn(false);
|
||||
};
|
||||
@@ -238,7 +266,7 @@ export const AllTransactionFilter = ({
|
||||
title={t('filter.paymentMethod')}
|
||||
selectValue={ filterServiceCode }
|
||||
selectSetter={ onChangeServiceCode }
|
||||
selectOptions={ serviceCodeOptions }
|
||||
selectOptions={ getLocalizedServiceCodeOptions() }
|
||||
></FilterSelect>
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||
import { ListItemProps, TransactionCategory } from '../model/types';
|
||||
import moment from 'moment';
|
||||
import { useStore } from '@/shared/model/store';
|
||||
import { getAllTransactionStatusCode } from '../model/contant';
|
||||
import { getAllTransactionStatusCode, getPaymentMethodName } from '../model/contant';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
export const ListItem = ({
|
||||
@@ -179,7 +179,7 @@ export const ListItem = ({
|
||||
<span className="separator">|</span>
|
||||
<span>{ transactionType }</span>
|
||||
<span className="separator">|</span>
|
||||
<span>{ paymentMethod }</span>
|
||||
<span>{ getPaymentMethodName(t, paymentMethod) }</span>
|
||||
<span className="separator">|</span>
|
||||
<span>{ processResult }</span>
|
||||
</div>
|
||||
@@ -212,7 +212,7 @@ export const ListItem = ({
|
||||
<span className="separator">|</span>
|
||||
<span>{ processResult }</span>
|
||||
<span className="separator">|</span>
|
||||
<span>{ paymentMethod }</span>
|
||||
<span>{ getPaymentMethodName(t, paymentMethod) }</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -233,12 +233,7 @@ export const ListItem = ({
|
||||
{ getDetail() }
|
||||
</div>
|
||||
<div className="transaction-amount">
|
||||
<NumericFormat
|
||||
value={ goodsAmount || amount || transactionAmount }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
suffix={ t('home.currencyWon') }
|
||||
></NumericFormat>
|
||||
{t('home.money', { value: new Intl.NumberFormat('en-US').format(goodsAmount || amount || transactionAmount || 0) })}
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user