diff options
| author | nb5p <[email protected]> | 2023-05-28 12:55:03 +0800 |
|---|---|---|
| committer | nb5p <[email protected]> | 2023-05-28 12:55:03 +0800 |
| commit | 02389b8b0c755991108a0d2b3a1e34dd72be4113 (patch) | |
| tree | dbb4b42245a98be6b1dce7475216da2501168d16 /src | |
| parent | 37bfd0681a8cbd9e399502f13878ed196f6a7077 (diff) | |
fix i18n
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/ModalCloseAllConnections.tsx | 9 | ||||
| -rw-r--r-- | src/i18n/en.ts | 3 | ||||
| -rw-r--r-- | src/i18n/zh-cn.ts | 3 | ||||
| -rw-r--r-- | src/i18n/zh-tw.ts | 5 |
4 files changed, 15 insertions, 5 deletions
diff --git a/src/components/ModalCloseAllConnections.tsx b/src/components/ModalCloseAllConnections.tsx index a2c4303..505c0cf 100644 --- a/src/components/ModalCloseAllConnections.tsx +++ b/src/components/ModalCloseAllConnections.tsx @@ -1,5 +1,6 @@ import cx from 'clsx'; import React from 'react'; +import { useTranslation } from 'react-i18next'; import Modal from 'react-modal'; import Button from './Button'; @@ -9,6 +10,7 @@ import s from './ModalCloseAllConnections.module.scss'; const { useRef, useCallback, useMemo } = React; export default function Comp({ isOpen, onRequestClose, primaryButtonOnTap }) { + const { t } = useTranslation(); const primaryButtonRef = useRef(null); const onAfterOpen = useCallback(() => { primaryButtonRef.current.focus(); @@ -29,14 +31,13 @@ export default function Comp({ isOpen, onRequestClose, primaryButtonOnTap }) { className={className} overlayClassName={cx(modalStyle.overlay, s.overlay)} > - <p>Are you sure you want to close all connections?</p> + <p>{t('close_all_confirm')}</p> <div className={s.btngrp}> <Button onClick={primaryButtonOnTap} ref={primaryButtonRef}> - I'm sure + {t('close_all_confirm_yes')} </Button> - {/* im lazy :) */} <div style={{ width: 20 }} /> - <Button onClick={onRequestClose}>No</Button> + <Button onClick={onRequestClose}>{t('close_all_confirm_no')}</Button> </div> </Modal> ); diff --git a/src/i18n/en.ts b/src/i18n/en.ts index f200e72..c5057cb 100644 --- a/src/i18n/en.ts +++ b/src/i18n/en.ts @@ -61,4 +61,7 @@ export const data = { c_source: 'Source', c_destination_ip: 'Destination IP', c_type: 'Type', + close_all_confirm: 'Are you sure you want to close all connections?', + close_all_confirm_yes: "I'm sure", + close_all_confirm_no: 'No', }; diff --git a/src/i18n/zh-cn.ts b/src/i18n/zh-cn.ts index c38c32b..8852d21 100644 --- a/src/i18n/zh-cn.ts +++ b/src/i18n/zh-cn.ts @@ -62,4 +62,7 @@ export const data = { c_type: '类型', restart_core: '重启 clash 核心', upgrade_core: '更新 Alpha 核心', + close_all_confirm: '确定关闭所有连接?', + close_all_confirm_yes: '确定', + close_all_confirm_no: '取消', }; diff --git a/src/i18n/zh-tw.ts b/src/i18n/zh-tw.ts index f778b7c..86085ed 100644 --- a/src/i18n/zh-tw.ts +++ b/src/i18n/zh-tw.ts @@ -62,4 +62,7 @@ export const data = { c_type: '類型', restart_core: '重新啟動 clash 核心', upgrade_core: '更新 Alpha 核心', -};
\ No newline at end of file + close_all_confirm: '確定關閉所有連接?', + close_all_confirm_yes: '確定', + close_all_confirm_no: '取消', +}; |
