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:
@@ -17,4 +17,31 @@ export const getSettlementPaymentMethodOptionsGroup = (t: TFunction) => [
|
|||||||
{name: t('transaction.constants.ssgBank'), value: SettlementPaymentMethod.SSG_BANK_ACCOUNT},
|
{name: t('transaction.constants.ssgBank'), value: SettlementPaymentMethod.SSG_BANK_ACCOUNT},
|
||||||
{name: t('transaction.constants.cultureLand'), value: SettlementPaymentMethod.CULTURE_VOUCHER},
|
{name: t('transaction.constants.cultureLand'), value: SettlementPaymentMethod.CULTURE_VOUCHER},
|
||||||
{name: t('transaction.constants.tmoneyPay'), value: SettlementPaymentMethod.TMONEY_PAY},
|
{name: t('transaction.constants.tmoneyPay'), value: SettlementPaymentMethod.TMONEY_PAY},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const getPaymentMethodName = (t: TFunction, paymentMethod?: string): string => {
|
||||||
|
if (!paymentMethod) return '';
|
||||||
|
|
||||||
|
const methodMap: Record<string, string> = {
|
||||||
|
'신용카드': t('transaction.constants.creditCard'),
|
||||||
|
'가상계좌': t('transaction.constants.virtualAccount'),
|
||||||
|
'계좌이체': t('transaction.constants.accountTransfer'),
|
||||||
|
'간편계좌이체': t('transaction.constants.accountSimpleTransfer'),
|
||||||
|
'휴대폰': t('transaction.constants.mobilePayment'),
|
||||||
|
'SSG머니': t('transaction.constants.ssgMoney'),
|
||||||
|
'SSG은행계좌': t('transaction.constants.ssgBank'),
|
||||||
|
'문화상품권': t('transaction.constants.cultureLand'),
|
||||||
|
'티머니페이': t('transaction.constants.tmoneyPay'),
|
||||||
|
'Credit Card': t('transaction.constants.creditCard'),
|
||||||
|
'Virtual Account': t('transaction.constants.virtualAccount'),
|
||||||
|
'Account Transfer': t('transaction.constants.accountTransfer'),
|
||||||
|
'Simple Account Transfer': t('transaction.constants.accountSimpleTransfer'),
|
||||||
|
'Mobile Payment': t('transaction.constants.mobilePayment'),
|
||||||
|
'SSG Money': t('transaction.constants.ssgMoney'),
|
||||||
|
'SSG Bank Account': t('transaction.constants.ssgBank'),
|
||||||
|
'Culture Voucher': t('transaction.constants.cultureLand'),
|
||||||
|
'Tmoney Pay': t('transaction.constants.tmoneyPay'),
|
||||||
|
};
|
||||||
|
|
||||||
|
return methodMap[paymentMethod] || paymentMethod;
|
||||||
|
};
|
||||||
@@ -7,6 +7,7 @@ import {
|
|||||||
InfoWrapKeys,
|
InfoWrapKeys,
|
||||||
TransactionInfoWrapProps,
|
TransactionInfoWrapProps,
|
||||||
} from '@/entities/settlement/model/types';
|
} from '@/entities/settlement/model/types';
|
||||||
|
import { getPaymentMethodName } from '@/entities/settlement/model/constant';
|
||||||
|
|
||||||
export const TransactionInfoWrap = ({
|
export const TransactionInfoWrap = ({
|
||||||
transactionInfo,
|
transactionInfo,
|
||||||
@@ -51,7 +52,7 @@ export const TransactionInfoWrap = ({
|
|||||||
</li>
|
</li>
|
||||||
<li className="kv-row bolder">
|
<li className="kv-row bolder">
|
||||||
<span className="k">{t('transaction.fields.paymentMethod')}</span>
|
<span className="k">{t('transaction.fields.paymentMethod')}</span>
|
||||||
<span className="v">{ transactionInfo?.paymentMethod }</span>
|
<span className="v">{ getPaymentMethodName(t, transactionInfo?.paymentMethod) }</span>
|
||||||
</li>
|
</li>
|
||||||
<li className="kv-row bolder">
|
<li className="kv-row bolder">
|
||||||
<span className="k">{t('additionalService.settlementAgency.settlementDate')}</span>
|
<span className="k">{t('additionalService.settlementAgency.settlementDate')}</span>
|
||||||
|
|||||||
@@ -210,3 +210,30 @@ export const getBillingPaymentMethodBtnGroup = (t: TFunction) => [
|
|||||||
{name: t('transaction.constants.virtualAccount'), value: BillingPaymentMethod.VIRTUAL_ACCOUNT},
|
{name: t('transaction.constants.virtualAccount'), value: BillingPaymentMethod.VIRTUAL_ACCOUNT},
|
||||||
{name: t('transaction.constants.mobilePayment'), value: BillingPaymentMethod.MOBILE_PAYMENT},
|
{name: t('transaction.constants.mobilePayment'), value: BillingPaymentMethod.MOBILE_PAYMENT},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const getPaymentMethodName = (t: TFunction, paymentMethod?: string): string => {
|
||||||
|
if (!paymentMethod) return '';
|
||||||
|
|
||||||
|
const methodMap: Record<string, string> = {
|
||||||
|
'신용카드': t('transaction.constants.creditCard'),
|
||||||
|
'가상계좌': t('transaction.constants.virtualAccount'),
|
||||||
|
'계좌이체': t('transaction.constants.accountTransfer'),
|
||||||
|
'간편계좌이체': t('transaction.constants.accountSimpleTransfer'),
|
||||||
|
'휴대폰': t('transaction.constants.mobilePayment'),
|
||||||
|
'SSG머니': t('transaction.constants.ssgMoney'),
|
||||||
|
'SSG은행계좌': t('transaction.constants.ssgBank'),
|
||||||
|
'문화상품권': t('transaction.constants.cultureLand'),
|
||||||
|
'티머니페이': t('transaction.constants.tmoneyPay'),
|
||||||
|
'Credit Card': t('transaction.constants.creditCard'),
|
||||||
|
'Virtual Account': t('transaction.constants.virtualAccount'),
|
||||||
|
'Account Transfer': t('transaction.constants.accountTransfer'),
|
||||||
|
'Simple Account Transfer': t('transaction.constants.accountSimpleTransfer'),
|
||||||
|
'Mobile Payment': t('transaction.constants.mobilePayment'),
|
||||||
|
'SSG Money': t('transaction.constants.ssgMoney'),
|
||||||
|
'SSG Bank Account': t('transaction.constants.ssgBank'),
|
||||||
|
'Culture Voucher': t('transaction.constants.cultureLand'),
|
||||||
|
'Tmoney Pay': t('transaction.constants.tmoneyPay'),
|
||||||
|
};
|
||||||
|
|
||||||
|
return methodMap[paymentMethod] || paymentMethod;
|
||||||
|
};
|
||||||
|
|||||||
@@ -83,6 +83,34 @@ export const AllTransactionFilter = ({
|
|||||||
const moidTidOptionsGroup = getAllTransactionMoidTidOptionsGroup(t);
|
const moidTidOptionsGroup = getAllTransactionMoidTidOptionsGroup(t);
|
||||||
const allTransactionStatusCode = getAllTransactionStatusCode(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 = () => {
|
const onClickToClose = () => {
|
||||||
setFilterOn(false);
|
setFilterOn(false);
|
||||||
};
|
};
|
||||||
@@ -238,7 +266,7 @@ export const AllTransactionFilter = ({
|
|||||||
title={t('filter.paymentMethod')}
|
title={t('filter.paymentMethod')}
|
||||||
selectValue={ filterServiceCode }
|
selectValue={ filterServiceCode }
|
||||||
selectSetter={ onChangeServiceCode }
|
selectSetter={ onChangeServiceCode }
|
||||||
selectOptions={ serviceCodeOptions }
|
selectOptions={ getLocalizedServiceCodeOptions() }
|
||||||
></FilterSelect>
|
></FilterSelect>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
|||||||
import { ListItemProps, TransactionCategory } from '../model/types';
|
import { ListItemProps, TransactionCategory } from '../model/types';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { useStore } from '@/shared/model/store';
|
import { useStore } from '@/shared/model/store';
|
||||||
import { getAllTransactionStatusCode } from '../model/contant';
|
import { getAllTransactionStatusCode, getPaymentMethodName } from '../model/contant';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
export const ListItem = ({
|
export const ListItem = ({
|
||||||
@@ -179,7 +179,7 @@ export const ListItem = ({
|
|||||||
<span className="separator">|</span>
|
<span className="separator">|</span>
|
||||||
<span>{ transactionType }</span>
|
<span>{ transactionType }</span>
|
||||||
<span className="separator">|</span>
|
<span className="separator">|</span>
|
||||||
<span>{ paymentMethod }</span>
|
<span>{ getPaymentMethodName(t, paymentMethod) }</span>
|
||||||
<span className="separator">|</span>
|
<span className="separator">|</span>
|
||||||
<span>{ processResult }</span>
|
<span>{ processResult }</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -212,7 +212,7 @@ export const ListItem = ({
|
|||||||
<span className="separator">|</span>
|
<span className="separator">|</span>
|
||||||
<span>{ processResult }</span>
|
<span>{ processResult }</span>
|
||||||
<span className="separator">|</span>
|
<span className="separator">|</span>
|
||||||
<span>{ paymentMethod }</span>
|
<span>{ getPaymentMethodName(t, paymentMethod) }</span>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -233,12 +233,7 @@ export const ListItem = ({
|
|||||||
{ getDetail() }
|
{ getDetail() }
|
||||||
</div>
|
</div>
|
||||||
<div className="transaction-amount">
|
<div className="transaction-amount">
|
||||||
<NumericFormat
|
{t('home.money', { value: new Intl.NumberFormat('en-US').format(goodsAmount || amount || transactionAmount || 0) })}
|
||||||
value={ goodsAmount || amount || transactionAmount }
|
|
||||||
thousandSeparator
|
|
||||||
displayType="text"
|
|
||||||
suffix={ t('home.currencyWon') }
|
|
||||||
></NumericFormat>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -93,7 +93,7 @@
|
|||||||
"periods": {
|
"periods": {
|
||||||
"today": "Today",
|
"today": "Today",
|
||||||
"week": "1 Week",
|
"week": "1 Week",
|
||||||
"currentMonth": "Current Month",
|
"currentMonth": "Current",
|
||||||
"1month": "1 Month",
|
"1month": "1 Month",
|
||||||
"2months": "2 Months",
|
"2months": "2 Months",
|
||||||
"3months": "3 Months",
|
"3months": "3 Months",
|
||||||
|
|||||||
@@ -197,16 +197,37 @@ export const AllTransactionListPage = () => {
|
|||||||
let rs = [];
|
let rs = [];
|
||||||
if(!!serviceCodeOptions && serviceCodeOptions.length > 0)
|
if(!!serviceCodeOptions && serviceCodeOptions.length > 0)
|
||||||
for(let i=0;i<serviceCodeOptions.length;i++){
|
for(let i=0;i<serviceCodeOptions.length;i++){
|
||||||
|
const option = serviceCodeOptions[i];
|
||||||
|
const localizedName = getLocalizedServiceCodeName(option?.name);
|
||||||
rs.push(
|
rs.push(
|
||||||
<option
|
<option
|
||||||
key={`key-${i}`}
|
key={`key-${i}`}
|
||||||
value={serviceCodeOptions[i]?.value}
|
value={option?.value}
|
||||||
>{ serviceCodeOptions[i]?.name }</option>
|
>{ localizedName }</option>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
return rs;
|
return rs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
callServiceCodeOptions();
|
callServiceCodeOptions();
|
||||||
}, []);
|
}, []);
|
||||||
|
|||||||
Reference in New Issue
Block a user