From 5ef6407e9ba52c2f9441fae2310278bcbddcb317 Mon Sep 17 00:00:00 2001 From: Jay Sheen Date: Fri, 31 Oct 2025 13:20:13 +0900 Subject: [PATCH] Localize link-payment main pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added linkPayment translation keys to en.json: - title, detailTitle, waitDetailTitle, applyTitle, messagePreview - resendSuccess, resendFailed, resendError, resendConfirm - deleteSuccess, deleteConfirm, resend, delete - separateApprovalTitle, separateApprovalDetail, warning - Localized link-payment-history-page.tsx: - Header title, access check comment - Localized link-payment-wait-send-page.tsx: - Header title, page comment - Localized link-payment-detail-page.tsx: - Header title, button labels (resend, separate approval detail) - Success/error messages for resend operations - Dialog button labels and confirmation message - Code comments from Korean to English - Localized link-payment-wait-detail-page.tsx: - Header title, button label (delete) - Success message for delete operation - Dialog button labels and confirmation message - All files: Added useTranslation hook import Note: Apply and separate-approval subdirectories still need localization ๐Ÿค– Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/locales/en.json | 18 ++++++++++ .../link-payment/link-payment-detail-page.tsx | 36 ++++++++++--------- .../link-payment-history-page.tsx | 8 +++-- .../link-payment-wait-detail-page.tsx | 14 ++++---- .../link-payment-wait-send-page.tsx | 6 ++-- 5 files changed, 54 insertions(+), 28 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index 08e56c3..81f7dd7 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -997,6 +997,24 @@ "disbursementAmount": "Disbursement Amount", "requestFailed": "Request failed." }, + "linkPayment": { + "title": "Link Payment", + "detailTitle": "Link Payment Detail", + "waitDetailTitle": "Link Payment Detail - Pending Send", + "applyTitle": "Link Payment Request", + "messagePreview": "Message Preview", + "separateApprovalTitle": "Separate Approval Detail", + "resendSuccess": "Resend successful.", + "resendFailed": "Resend failed.", + "resendError": "An error occurred during resend.", + "resendConfirm": "Do you want to resend?", + "deleteSuccess": "Delete successful.", + "deleteConfirm": "Do you want to delete?", + "resend": "Resend", + "delete": "Delete", + "separateApprovalDetail": "Separate Approval Detail", + "warning": "Warning" + }, "keyIn": { "fullCancel": "Full Cancel", "partialCancel": "Partial Cancel", diff --git a/src/pages/additional-service/link-payment/link-payment-detail-page.tsx b/src/pages/additional-service/link-payment/link-payment-detail-page.tsx index e67cf12..6e79752 100644 --- a/src/pages/additional-service/link-payment/link-payment-detail-page.tsx +++ b/src/pages/additional-service/link-payment/link-payment-detail-page.tsx @@ -20,8 +20,10 @@ import { useExtensionLinkPayHistoryResendMutation } from '@/entities/additional- import { ExtensionLinkPayHistoryDetailParams, ExtensionLinkPayHistoryResendParams } from '@/entities/additional-service/model/link-pay/types'; import { snackBar } from '@/shared/lib'; import moment from 'moment'; +import { useTranslation } from 'react-i18next'; export const LinkPaymentDetailPage = () => { + const { t } = useTranslation(); const { navigate } = useNavigate(); const location = useLocation(); @@ -33,17 +35,17 @@ export const LinkPaymentDetailPage = () => { const [detailExposure, setDetailExposure] = useState(false); const [showPayment, setShowPayment] = useState(false); - useSetHeaderTitle('๋งํฌ๊ฒฐ์ œ ์ƒ์„ธ'); + useSetHeaderTitle(t('additionalService.linkPayment.detailTitle')); useSetHeaderType(HeaderType.RightClose); useSetOnBack(() => { - navigate(-1); // ๋ธŒ๋ผ์šฐ์ € ํžˆ์Šคํ† ๋ฆฌ๋ฅผ ์ด์šฉํ•œ ๋’ค๋กœ๊ฐ€๊ธฐ + navigate(-1); // Go back using browser history }); useSetFooterMode(false); const { mutateAsync: linkPayHistoryDetail } = useExtensionLinkPayHistoryDetailMutation(); const { mutateAsync: linkPayHistoryResend } = useExtensionLinkPayHistoryResendMutation(); - - // ์ƒ์„ธ๋‚ด์—ญ ์กฐํšŒ + + // Query detail information const callDetail = () => { let detailParam: ExtensionLinkPayHistoryDetailParams = { mid: mid, @@ -59,7 +61,7 @@ export const LinkPaymentDetailPage = () => { }) } - //์žฌ๋ฐœ์†ก API + // Resend API const resendPayment = () => { let resendParam: ExtensionLinkPayHistoryResendParams = { mid: mid, @@ -69,23 +71,23 @@ export const LinkPaymentDetailPage = () => { linkPayHistoryResend(resendParam) .then((response) => { if (response.status) { - snackBar("์žฌ๋ฐœ์†ก์„ ์„ฑ๊ณตํ•˜์˜€์Šต๋‹ˆ๋‹ค."); + snackBar(t('additionalService.linkPayment.resendSuccess')); callDetail(); } else { - const errorMessage = response.error?.message || '์žฌ๋ฐœ์†ก์ด ์‹คํŒจํ•˜์˜€์Šต๋‹ˆ๋‹ค.'; - snackBar(`[์‹คํŒจ] ${errorMessage}`); + const errorMessage = response.error?.message || t('additionalService.linkPayment.resendFailed'); + snackBar(`[${t('common.failed')}] ${errorMessage}`); } }) .catch((error) => { const errorMessage = error?.response?.data?.error?.message || error?.message || - '์žฌ๋ฐœ์†ก ์ค‘ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค.'; - snackBar(`[์‹คํŒจ] ${errorMessage}`); + t('additionalService.linkPayment.resendError'); + snackBar(`[${t('common.failed')}] ${errorMessage}`); }); } const onClickToResend = () => { - let msg = '์žฌ๋ฐœ์†ก ํ•˜์‹œ๊ฒ ์Šต๋‹ˆ๊นŒ?'; + let msg = t('additionalService.linkPayment.resendConfirm'); overlay.open(({ isOpen, @@ -99,7 +101,7 @@ export const LinkPaymentDetailPage = () => { onClose={close} onConfirmClick={() => resendPayment()} message={msg} - buttonLabel={['์ทจ์†Œ', 'ํ™•์ธ']} + buttonLabel={[t('common.cancel'), t('common.confirm')]} /> ); }); @@ -111,14 +113,14 @@ export const LinkPaymentDetailPage = () => { }); }; - // ์žฌ๋ฐœ์†ก ๋ฒ„ํŠผ ํ™œ์„ฑํ™” ์กฐ๊ฑด ์ฒดํฌ + // Check if resend button should be enabled const isResendEnabled = () => { - // paymentStatus๊ฐ€ "ACTIVE"์ด๊ณ  + // paymentStatus must be "ACTIVE" if (paymentInfo?.paymentStatus !== 'ACTIVE') { return false; } - // paymentLimitDate๊ฐ€ ์˜ค๋Š˜ ๋‚ ์งœ๋ฅผ ์ง€๋‚˜์ง€ ์•Š์•˜์„ ๋•Œ + // paymentLimitDate must not have passed today's date if (paymentInfo?.paymentLimitDate) { const limitDate = moment(paymentInfo.paymentLimitDate, 'YYYYMMDD'); const today = moment().startOf('day'); @@ -158,7 +160,7 @@ export const LinkPaymentDetailPage = () => { className="btn-50 btn-blue flex-1" onClick={() => onClickToSeparateApproval()} disabled={detailExposure} - >๋ถ„๋ฆฌ์Šน์ธ ์ƒ์„ธ + >{t('additionalService.linkPayment.separateApprovalDetail')}
@@ -166,7 +168,7 @@ export const LinkPaymentDetailPage = () => { className="btn-50 btn-blue flex-1" onClick={() => onClickToResend()} disabled={!isResendEnabled()} - >์žฌ๋ฐœ์†ก + >{t('additionalService.linkPayment.resend')}
diff --git a/src/pages/additional-service/link-payment/link-payment-history-page.tsx b/src/pages/additional-service/link-payment/link-payment-history-page.tsx index 53d8652..9314bac 100644 --- a/src/pages/additional-service/link-payment/link-payment-history-page.tsx +++ b/src/pages/additional-service/link-payment/link-payment-history-page.tsx @@ -13,22 +13,24 @@ import { } from '@/widgets/sub-layout/use-sub-layout'; import { LinkPaymentTabKeys } from '@/entities/additional-service/model/link-pay/types'; import { useExtensionAccessCheck } from '@/shared/lib/hooks/use-extension-access-check'; +import { useTranslation } from 'react-i18next'; /** - * ๋ฐœ์†ก๋‚ด์—ญ ํƒญ ํ™”๋ฉด + * Shipping history tab screen */ export const LinkPaymentHistoryPage = () => { + const { t } = useTranslation(); const { navigate } = useNavigate(); - // ๊ถŒํ•œ ์ฒดํฌ + // Access check const { hasAccess, AccessDeniedDialog } = useExtensionAccessCheck({ extensionCode: 'LINKPAY' }); const [activeTab, setActiveTab] = useState(LinkPaymentTabKeys.ShippingHistory) - useSetHeaderTitle('๋งํฌ๊ฒฐ์ œ') + useSetHeaderTitle(t('additionalService.linkPayment.title')) useSetHeaderType(HeaderType.LeftArrow); useSetFooterMode(false); useSetOnBack(() => { diff --git a/src/pages/additional-service/link-payment/link-payment-wait-detail-page.tsx b/src/pages/additional-service/link-payment/link-payment-wait-detail-page.tsx index 908d261..5843c17 100644 --- a/src/pages/additional-service/link-payment/link-payment-wait-detail-page.tsx +++ b/src/pages/additional-service/link-payment/link-payment-wait-detail-page.tsx @@ -18,15 +18,17 @@ import { PaymentInfoWrap } from '@/entities/additional-service/ui/info-wrap/paym import { useExtensionLinkPayWaitDeleteMutation } from '@/entities/additional-service/api/link-payment/use-extension-link-pay-wait-delete-mutation'; import { ExtensionLinkPayWaitDeleteParams, ExtensionLinkPayWaitDetailParams, LinkPaymentProcessStatus } from '@/entities/additional-service/model/link-pay/types'; import { snackBar } from '@/shared/lib'; +import { useTranslation } from 'react-i18next'; export const LinkPaymentWaitDetailPage = () => { + const { t } = useTranslation(); const { navigate } = useNavigate(); const location = useLocation(); const { mid, requestId } = location.state || {}; const [titleInfo, setTitleInfo] = useState(); const [paymentInfo, setPaymentInfo] = useState(); - useSetHeaderTitle('๋งํฌ๊ฒฐ์ œ ์ƒ์„ธ ๋ฐœ์†ก๋Œ€๊ธฐ'); + useSetHeaderTitle(t('additionalService.linkPayment.waitDetailTitle')); useSetHeaderType(HeaderType.RightClose); useSetOnBack(() => { navigate(PATHS.additionalService.linkPayment.pendingSend); @@ -57,15 +59,15 @@ export const LinkPaymentWaitDetailPage = () => { linkPayWaitDelete(deleteParam) .then((rs) => { callDetail(); - snackBar("์‚ญ์ œ๋ฅผ ์„ฑ๊ณตํ•˜์˜€์Šต๋‹ˆ๋‹ค.") + snackBar(t('additionalService.linkPayment.deleteSuccess')) }) .catch((error) => { - snackBar(`[์‹คํŒจ] ${error?.response?.data?.message}`) + snackBar(`[${t('common.failed')}] ${error?.response?.data?.message}`) }); } const onClickToCancel = () => { - let msg = '์‚ญ์ œ ํ•˜์‹œ๊ฒ ์Šต๋‹ˆ๊นŒ?'; + let msg = t('additionalService.linkPayment.deleteConfirm'); overlay.open(({ isOpen, @@ -79,7 +81,7 @@ export const LinkPaymentWaitDetailPage = () => { onClose={close} onConfirmClick={() => deletePayment()} message={msg} - buttonLabel={['์ทจ์†Œ', 'ํ™•์ธ']} + buttonLabel={[t('common.cancel'), t('common.confirm')]} /> ); }); @@ -113,7 +115,7 @@ export const LinkPaymentWaitDetailPage = () => { className="btn-50 btn-blue flex-1" onClick={() => onClickToCancel()} disabled={paymentInfo?.processStatus !== LinkPaymentProcessStatus.SEND_REQUEST} - >์‚ญ์ œ + >{t('additionalService.linkPayment.delete')} diff --git a/src/pages/additional-service/link-payment/link-payment-wait-send-page.tsx b/src/pages/additional-service/link-payment/link-payment-wait-send-page.tsx index fe12663..7ac9953 100644 --- a/src/pages/additional-service/link-payment/link-payment-wait-send-page.tsx +++ b/src/pages/additional-service/link-payment/link-payment-wait-send-page.tsx @@ -12,16 +12,18 @@ import { useSetOnBack } from '@/widgets/sub-layout/use-sub-layout'; import { LinkPaymentTabKeys } from '@/entities/additional-service/model/link-pay/types'; +import { useTranslation } from 'react-i18next'; /** - * ๋ฐœ์†ก๋Œ€๊ธฐ ํƒญ ํ™”๋ฉด + * Pending send tab screen */ export const LinkPaymentWaitSendPage = () => { + const { t } = useTranslation(); const { navigate } = useNavigate(); const [activeTab, setActiveTab] = useState(LinkPaymentTabKeys.PendingSend) - useSetHeaderTitle('๋งํฌ๊ฒฐ์ œ') + useSetHeaderTitle(t('additionalService.linkPayment.title')) useSetHeaderType(HeaderType.LeftArrow); useSetFooterMode(false); useSetOnBack(() => {