refactor: change locale key (#3838)

This commit is contained in:
Garfield Lee
2023-09-06 15:20:44 +08:00
committed by GitHub
parent b3d902e33f
commit 925c18300f
49 changed files with 2622 additions and 2324 deletions
@@ -41,7 +41,9 @@ export const Confirm = ({
}: ConfirmProps) => {
const t = useAFFiNEI18N();
const cancelText_ = useMemo<string>(() => {
return cancelText === 'Cancel' ? t['Cancel']() : cancelText;
return cancelText === 'Cancel'
? t['com.affine.confirmModal.button.cancel']()
: cancelText;
}, [cancelText, t]);
const handleCancel = useCallback(() => {
@@ -60,7 +60,7 @@ export const ConfirmModal = ({
<StyledModalContent>{content}</StyledModalContent>
<StyledModalFooter>
<Button onClick={onCancel} style={{ marginRight: 20 }}>
{t['Cancel']()}
{t['com.affine.confirmModal.button.cancel']()}
</Button>
<Button type={confirmType} onClick={onConfirm}>
{confirmText || t['Confirm']()}