From 0936836ac2db83cf934e5ff0137103151ecfee00 Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Thu, 17 Apr 2025 16:36:06 +0800 Subject: [PATCH 01/20] chore: bump version to 2.32.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 091418e1f01d..b12d894eb2cf 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "yarn": ">=999.0.0", "npm": ">=999.0.0" }, - "version": "2.32.2", + "version": "2.32.3", "private": true, "license": "AGPL-3.0-or-later", "scripts": { From 7fcd74d2ae6ee68993c4c0793f4234ed7c65d42b Mon Sep 17 00:00:00 2001 From: Wukong Sun Date: Wed, 2 Apr 2025 14:47:25 +0800 Subject: [PATCH 02/20] feat: mf-6641 integrate google drive (#12176) * feat: mf-6641 integrate google drive * feat: google drive * refactor: organize routes * refactor: add google drive client to manage file * feat: backup to google drive and download backup file * merge into browser * upload and merge * clean up * refactor: update google drive --- .gitignore | 1 + packages/backup-format/src/version-3/index.ts | 9 +- packages/icons/brands/GoogleDrive.svg | 14 + packages/icons/icon-generated-as-jsx.js | 5 + packages/icons/icon-generated-as-url.js | 1 + packages/icons/plugins/GoPlus.svg | 4 +- packages/icons/plugins/ScamSniffer.dark.svg | 20 +- packages/icons/plugins/ScamSniffer.light.svg | 20 +- packages/icons/utils/internal.d.ts | 2 +- packages/mask/.webpack/config.ts | 2 +- .../mask/.webpack/manifest/manifest-mv3.json | 6 +- packages/mask/.webpack/manifest/manifest.json | 10 +- .../services/backup/google_drive.ts | 28 ++ .../mask/background/services/backup/index.ts | 1 + .../tasks/NotCancellable/OnInstall.ts | 3 + .../CompositionDialog/Composition.tsx | 20 +- .../components/BackupPreview/index.tsx | 16 +- .../dashboard/components/MoreMenu/index.tsx | 43 ++ .../dashboard/components/SetupFrame/index.tsx | 6 +- .../contexts/CloudBackupFormContext.tsx | 9 +- .../dashboard/hooks/useBackupFormState.ts | 10 +- .../dashboard/hooks/useBackupPreviewInfo.ts | 11 + .../dashboard/hooks/useGoogleDriveFiles.ts | 23 ++ .../BackupPreviewDialog.tsx | 122 ++---- .../modals/BackupPreviewModal/index.tsx | 46 +-- .../MergeBackupModal/MergeBackupDialog.tsx | 171 +++----- .../modals/MergeBackupModal/index.tsx | 52 +-- .../CloudBackup/CloudBackupFormContext.ts | 67 ++++ .../Backup/CloudBackup/EmailForm.tsx | 109 ++++++ .../Backup/CloudBackup/GoogleDriveBackup.tsx | 369 ++++++++++++++++++ .../Backup/CloudBackup/MaskNetworkBackup.tsx | 138 +++++++ .../Backup/CloudBackup/PhoneForm.tsx | 106 +++++ .../Backup/CloudBackup/Preview.tsx | 201 ++++++++++ .../SetupPersona/Backup/CloudBackup/index.tsx | 82 ++++ .../pages/SetupPersona/Backup/LocalBackup.tsx | 130 ++++++ .../pages/SetupPersona/Backup/constants.ts | 8 + .../pages/SetupPersona/Backup/helpers.tsx | 94 +++++ .../pages/SetupPersona/Backup/index.tsx | 97 +++++ .../pages/SetupPersona/Backup/types.ts | 8 + .../SetupPersona/CloudBackupPreview/index.tsx | 18 +- .../pages/SetupPersona/LocalBackup/index.tsx | 28 +- .../dashboard/pages/SetupPersona/index.tsx | 61 ++- packages/mask/dashboard/utils/regexp.ts | 3 + packages/mask/popups/pages/Settings/index.tsx | 4 +- .../mask/shared-ui/hooks/useUserContext.ts | 8 +- .../mask/shared-ui/initialization/fetch.ts | 7 +- .../mask/shared-ui/initialization/storage.ts | 2 + packages/mask/shared-ui/locale/en-US.json | 22 ++ packages/mask/shared-ui/locale/en-US.po | 152 ++++++-- packages/mask/shared-ui/locale/ja-JP.json | 22 ++ packages/mask/shared-ui/locale/ja-JP.po | 154 ++++++-- packages/mask/shared-ui/locale/ko-KR.json | 22 ++ packages/mask/shared-ui/locale/ko-KR.po | 154 ++++++-- packages/mask/shared-ui/locale/zh-CN.json | 22 ++ packages/mask/shared-ui/locale/zh-CN.po | 154 ++++++-- packages/mask/shared-ui/locale/zh-TW.json | 22 ++ packages/mask/shared-ui/locale/zh-TW.po | 152 ++++++-- packages/polyfills/types/env.d.ts | 1 + packages/shared-base/src/KVStorage/index.ts | 4 + .../src/helpers/relativeRouteOf.ts | 4 + packages/shared-base/src/types/Routes.ts | 7 + .../shared/src/UI/components/Alert/index.tsx | 23 +- .../UI/components/CountryCodePicker/index.tsx | 10 +- .../UI/components/PhoneNumberField/index.tsx | 21 +- .../src/UI/modals/ConfirmDialog/index.tsx | 6 +- packages/shared/src/hooks/index.ts | 1 + packages/shared/src/hooks/useParamTab.ts | 9 +- packages/shared/src/hooks/usePathTab.ts | 21 + .../src/GoogleDriveClient/index.ts | 259 ++++++++++++ packages/web3-providers/src/entry.ts | 2 + .../web3-shared/evm/src/libs/EtherscanURL.ts | 2 +- 71 files changed, 2916 insertions(+), 525 deletions(-) create mode 100644 packages/icons/brands/GoogleDrive.svg create mode 100644 packages/mask/background/services/backup/google_drive.ts create mode 100644 packages/mask/dashboard/components/MoreMenu/index.tsx create mode 100644 packages/mask/dashboard/hooks/useBackupPreviewInfo.ts create mode 100644 packages/mask/dashboard/hooks/useGoogleDriveFiles.ts create mode 100644 packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts create mode 100644 packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx create mode 100644 packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx create mode 100644 packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx create mode 100644 packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx create mode 100644 packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx create mode 100644 packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/index.tsx create mode 100644 packages/mask/dashboard/pages/SetupPersona/Backup/LocalBackup.tsx create mode 100644 packages/mask/dashboard/pages/SetupPersona/Backup/constants.ts create mode 100644 packages/mask/dashboard/pages/SetupPersona/Backup/helpers.tsx create mode 100644 packages/mask/dashboard/pages/SetupPersona/Backup/index.tsx create mode 100644 packages/mask/dashboard/pages/SetupPersona/Backup/types.ts create mode 100644 packages/shared/src/hooks/usePathTab.ts create mode 100644 packages/web3-providers/src/GoogleDriveClient/index.ts diff --git a/.gitignore b/.gitignore index 7c68bc4670a5..1429728761ce 100644 --- a/.gitignore +++ b/.gitignore @@ -122,3 +122,4 @@ common/autoinstallers/*/.npmrc /package-lock.json /yarn.lock quick-lint-js.config +.aider* diff --git a/packages/backup-format/src/version-3/index.ts b/packages/backup-format/src/version-3/index.ts index 5dfac57fc913..2f50229a95bf 100644 --- a/packages/backup-format/src/version-3/index.ts +++ b/packages/backup-format/src/version-3/index.ts @@ -14,10 +14,11 @@ export async function encryptBackup(password: BufferSource, binaryBackup: Buffer export async function decryptBackup(password: BufferSource, data: ArrayBuffer | ArrayLike) { const container = await parseEncryptedJSONContainer(SupportedVersions.Version0, data) - const _ = decode(container) - if (!Array.isArray(_) || _.length !== 3) throw new TypeError(BackupErrors.UnknownFormat) - if (!_.every((x): x is Uint8Array => x instanceof Uint8Array)) throw new TypeError(BackupErrors.UnknownFormat) - const [pbkdf2IV, encryptIV, encrypted] = _ + const payloadTuple = decode(container) + if (!Array.isArray(payloadTuple) || payloadTuple.length !== 3) throw new TypeError(BackupErrors.UnknownFormat) + if (!payloadTuple.every((x): x is Uint8Array => x instanceof Uint8Array)) + throw new TypeError(BackupErrors.UnknownFormat) + const [pbkdf2IV, encryptIV, encrypted] = payloadTuple const aes = await getAESFromPassword(password, pbkdf2IV) diff --git a/packages/icons/brands/GoogleDrive.svg b/packages/icons/brands/GoogleDrive.svg new file mode 100644 index 000000000000..bef62df4b6ce --- /dev/null +++ b/packages/icons/brands/GoogleDrive.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/packages/icons/icon-generated-as-jsx.js b/packages/icons/icon-generated-as-jsx.js index 2045693a7a8b..e410ca933542 100644 --- a/packages/icons/icon-generated-as-jsx.js +++ b/packages/icons/icon-generated-as-jsx.js @@ -239,6 +239,11 @@ export const Gnosis = /*#__PURE__*/ __createIcon('Gnosis', [ u: () => new URL('./brands/Gnosis.svg', import.meta.url).href, }, ]) +export const GoogleDrive = /*#__PURE__*/ __createIcon('GoogleDrive', [ + { + u: () => new URL('./brands/GoogleDrive.svg', import.meta.url).href, + }, +]) export const Highlight = /*#__PURE__*/ __createIcon('Highlight', [ { u: () => new URL('./brands/Highlight.svg', import.meta.url).href, diff --git a/packages/icons/icon-generated-as-url.js b/packages/icons/icon-generated-as-url.js index a8498ee101db..e6553edb637a 100644 --- a/packages/icons/icon-generated-as-url.js +++ b/packages/icons/icon-generated-as-url.js @@ -39,6 +39,7 @@ export function git_hub_url() { return new URL("./brands/GitHub.svg", import.met export function github_dark_url() { return new URL("./brands/GithubDark.svg", import.meta.url).href } export function git_hub_gray_url() { return new URL("./brands/GitHubGray.svg", import.meta.url).href } export function gnosis_url() { return new URL("./brands/Gnosis.svg", import.meta.url).href } +export function google_drive_url() { return new URL("./brands/GoogleDrive.svg", import.meta.url).href } export function highlight_url() { return new URL("./brands/Highlight.svg", import.meta.url).href } export function instagram_url() { return new URL("./brands/Instagram.svg", import.meta.url).href } export function instagram_round_colored_url() { return new URL("./brands/InstagramRoundColored.svg", import.meta.url).href } diff --git a/packages/icons/plugins/GoPlus.svg b/packages/icons/plugins/GoPlus.svg index de636d7e89f9..770ce2c875e8 100644 --- a/packages/icons/plugins/GoPlus.svg +++ b/packages/icons/plugins/GoPlus.svg @@ -1,7 +1,7 @@ - + - + diff --git a/packages/icons/plugins/ScamSniffer.dark.svg b/packages/icons/plugins/ScamSniffer.dark.svg index fdca736c3267..ed1a2b941ff6 100644 --- a/packages/icons/plugins/ScamSniffer.dark.svg +++ b/packages/icons/plugins/ScamSniffer.dark.svg @@ -1,17 +1,15 @@ - - - - - - - - - + + + + + + + - - + + diff --git a/packages/icons/plugins/ScamSniffer.light.svg b/packages/icons/plugins/ScamSniffer.light.svg index 0664681e4498..6442efd8fb57 100644 --- a/packages/icons/plugins/ScamSniffer.light.svg +++ b/packages/icons/plugins/ScamSniffer.light.svg @@ -1,17 +1,15 @@ - - - - - - - - - + + + + + + + - - + + diff --git a/packages/icons/utils/internal.d.ts b/packages/icons/utils/internal.d.ts index 8628c7720774..07dbf9d12a13 100644 --- a/packages/icons/utils/internal.d.ts +++ b/packages/icons/utils/internal.d.ts @@ -20,7 +20,7 @@ export interface GeneratedIconProps export type GeneratedIcon = ComponentType | ComponentType> export interface GeneratedIconNonSquareProps - extends React.HTMLProps { + extends Omit, 'children'> { variant?: Variants[] | Variants height?: number | string width?: number | string diff --git a/packages/mask/.webpack/config.ts b/packages/mask/.webpack/config.ts index 80ac17d8617c..014094cae787 100644 --- a/packages/mask/.webpack/config.ts +++ b/packages/mask/.webpack/config.ts @@ -238,6 +238,7 @@ export async function createConfiguration( NEXT_PUBLIC_FIREFLY_API_URL: process.env.NEXT_PUBLIC_FIREFLY_API_URL || '', SOLANA_DEFAULT_RPC_URL: process.env.SOLANA_DEFAULT_RPC_URL || '', MASK_ENABLE_EXCHANGE: process.env.MASK_ENABLE_EXCHANGE || '', + GOOGLE_CLIENT_ID: JSON.stringify(process.env.GOOGLE_CLIENT_ID) || '', }), new (rspack?.DefinePlugin || webpack.default.DefinePlugin)({ 'process.browser': 'true', @@ -312,7 +313,6 @@ export async function createConfiguration( // Focus on performance optimization. Not for download size/cache stability optimization. optimization: { // we don't need deterministic, and we also don't have chunk request at init we don't need "size" - // @ts-expect-error chunkIds: productionLike ? rspack ? 'deterministic' diff --git a/packages/mask/.webpack/manifest/manifest-mv3.json b/packages/mask/.webpack/manifest/manifest-mv3.json index af0c5a6a1f07..d2f288b563f8 100644 --- a/packages/mask/.webpack/manifest/manifest-mv3.json +++ b/packages/mask/.webpack/manifest/manifest-mv3.json @@ -3,7 +3,7 @@ "version": "0", "manifest_version": 3, "permissions": ["storage", "webNavigation", "activeTab", "scripting"], - "optional_permissions": ["notifications", "clipboardRead"], + "optional_permissions": ["notifications", "clipboardRead", "identity", "tabs"], "optional_host_permissions": [""], "background": { "service_worker": "/manifest-v3.entry.js" }, "icons": { @@ -32,5 +32,9 @@ "gecko": { "id": "{0e57e2ae-3e13-4d5d-9243-6159219852a6}" } + }, + "oauth2": { + "client_id": "884348965548-npd1mffii0tbrr87eb2fm73ue022k3t3.apps.googleusercontent.com", + "scopes": ["https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/userinfo.email"] } } diff --git a/packages/mask/.webpack/manifest/manifest.json b/packages/mask/.webpack/manifest/manifest.json index 0c629071825b..4d6e1069c215 100644 --- a/packages/mask/.webpack/manifest/manifest.json +++ b/packages/mask/.webpack/manifest/manifest.json @@ -2,8 +2,8 @@ "name": "Mask Network", "version": "0", "manifest_version": 2, - "permissions": ["storage", "webNavigation", "activeTab"], - "optional_permissions": ["", "notifications", "clipboardRead"], + "permissions": ["storage", "webNavigation", "activeTab", "identity"], + "optional_permissions": ["", "notifications", "clipboardRead", "tabs"], "background": { "page": "background.html" }, "icons": { "16": "assets/16x16.png", @@ -14,5 +14,9 @@ "browser_action": { "default_popup": "popups.html" }, "homepage_url": "https://mask.io", "description": "The portal to the new & open Internet. Send encrypted message and decentralized Apps right on top of social networks.", - "web_accessible_resources": ["js/*", "bundled/*", "entry/*", "*.svg", "*.png", "*.jpg", "*.css", "build-info.json"] + "web_accessible_resources": ["js/*", "bundled/*", "entry/*", "*.svg", "*.png", "*.jpg", "*.css", "build-info.json"], + "oauth2": { + "client_id": "884348965548-npd1mffii0tbrr87eb2fm73ue022k3t3.apps.googleusercontent.com", + "scopes": ["https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/userinfo.email"] + } } diff --git a/packages/mask/background/services/backup/google_drive.ts b/packages/mask/background/services/backup/google_drive.ts new file mode 100644 index 000000000000..0f0bcdcab6ac --- /dev/null +++ b/packages/mask/background/services/backup/google_drive.ts @@ -0,0 +1,28 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +export async function getAccessToken() { + const contained = await browser.permissions.contains({ permissions: ['identity'] }) + if (!contained) { + const granted = await browser.permissions.request({ origins: ['identity'] }) + if (!granted) return + } + return new Promise((resolve, reject) => { + // @ts-expect-error + chrome.identity.getAuthToken({ interactive: true }, (token, error) => { + // @ts-expect-error + if (chrome.runtime.lastError) { + // @ts-expect-error + reject(new Error(chrome.runtime.lastError.message)) + return + } + resolve(token) + }) + }) +} + +export async function clearAccessToken() { + const token = await getAccessToken() + return new Promise((resolve) => { + // @ts-expect-error + chrome.identity.removeCachedAuthToken({ token }, () => resolve()) + }) +} diff --git a/packages/mask/background/services/backup/index.ts b/packages/mask/background/services/backup/index.ts index f76aa6aed5b6..b384616dee4e 100644 --- a/packages/mask/background/services/backup/index.ts +++ b/packages/mask/background/services/backup/index.ts @@ -1,3 +1,4 @@ export { generateBackupPreviewInfo, createBackupFile, type BackupOptions } from './create.js' export { generateBackupSummary, restoreBackup } from './restore.js' export { backupPersonaPrivateKey } from './persona.js' +export { getAccessToken, clearAccessToken } from './google_drive.js' diff --git a/packages/mask/background/tasks/NotCancellable/OnInstall.ts b/packages/mask/background/tasks/NotCancellable/OnInstall.ts index 290f8c7ca1b2..31acb91a330e 100644 --- a/packages/mask/background/tasks/NotCancellable/OnInstall.ts +++ b/packages/mask/background/tasks/NotCancellable/OnInstall.ts @@ -28,6 +28,7 @@ browser.runtime.onInstalled.addListener(async (detail) => { const localStorage = (globalThis as any).localStorage if (localStorage) { const backupPassword = localStorage.getItem('backupPassword') + // Migration if (backupPassword) { const backupMethod = localStorage.getItem('backupMethod') base.PersistentStorages.Settings.storage.backupConfig.setValue({ @@ -37,6 +38,8 @@ browser.runtime.onInstalled.addListener(async (detail) => { cloudBackupAt: backupMethod && backupMethod === 'cloud' ? localStorage.getItem('backupAt') : null, localBackupAt: backupMethod && backupMethod === 'local' ? localStorage.getItem('backupAt') : null, cloudBackupMethod: null, + googleToken: null, + googleAccount: null, }) } // remove old data after migrate diff --git a/packages/mask/content-script/components/CompositionDialog/Composition.tsx b/packages/mask/content-script/components/CompositionDialog/Composition.tsx index 81eeacc2ed86..a66d5a4d66e5 100644 --- a/packages/mask/content-script/components/CompositionDialog/Composition.tsx +++ b/packages/mask/content-script/components/CompositionDialog/Composition.tsx @@ -1,8 +1,7 @@ -import { useCallback, useEffect, useRef, useState } from 'react' -import { useAsync } from 'react-use' -import { DialogContent, alpha } from '@mui/material' -import { makeStyles } from '@masknet/theme' -import { useCurrentPersonaConnectStatus, InjectedDialog, PersonaAction } from '@masknet/shared' +import Services from '#services' +import { Trans } from '@lingui/react/macro' +import type { CompositionType } from '@masknet/plugin-infra/content-script' +import { InjectedDialog, PersonaAction, useCurrentPersonaConnectStatus } from '@masknet/shared' import { CrossIsolationMessages, EMPTY_OBJECT, @@ -12,19 +11,20 @@ import { currentPersonaIdentifier, } from '@masknet/shared-base' import { useValueRef } from '@masknet/shared-base-ui' +import { makeStyles } from '@masknet/theme' import { Telemetry } from '@masknet/web3-telemetry' import { EventID, EventType } from '@masknet/web3-telemetry/types' -import type { CompositionType } from '@masknet/plugin-infra/content-script' -import Services from '#services' +import { DialogContent, alpha } from '@mui/material' +import { useCallback, useEffect, useRef, useState } from 'react' +import { useAsync } from 'react-use' +import { useCurrentPersona, usePersonasFromDB } from '../../../shared-ui/hooks/index.js' import { activatedSiteAdaptorUI } from '../../site-adaptor-infra/index.js' import { useCurrentIdentity, useLastRecognizedIdentity } from '../DataSource/useActivatedUI.js' import { CompositionDialogUI, type CompositionRef, E2EUnavailableReason } from './CompositionUI.js' +import { EncryptionMethodType } from './EncryptionMethodSelector.js' import { useCompositionClipboardRequest } from './useCompositionClipboardRequest.js' import { useRecipientsList } from './useRecipientsList.js' import { useSubmit } from './useSubmit.js' -import { usePersonasFromDB, useCurrentPersona } from '../../../shared-ui/hooks/index.js' -import { EncryptionMethodType } from './EncryptionMethodSelector.js' -import { Trans } from '@lingui/react/macro' const useStyles = makeStyles()((theme) => ({ dialogRoot: { diff --git a/packages/mask/dashboard/components/BackupPreview/index.tsx b/packages/mask/dashboard/components/BackupPreview/index.tsx index 7a9db487d147..d07a33d04b9d 100644 --- a/packages/mask/dashboard/components/BackupPreview/index.tsx +++ b/packages/mask/dashboard/components/BackupPreview/index.tsx @@ -83,18 +83,25 @@ const useStyles = makeStyles()((theme) => ({ list: { padding: 0, }, + grid: { + display: 'grid', + gridTemplateColumns: 'repeat(2, 1fr)', + }, walletHeaderIcon: { backgroundColor: '#1C68F3', boxShadow: '0px 6px 12px rgba(28, 104, 243, 0.2)', }, wallets: { margin: 0, - display: 'grid', - gridTemplateColumns: 'repeat(3, 1fr)', + display: 'flex', + flexWrap: 'wrap', + gap: 8, }, wallet: { + gap: 10, width: 'auto', flexWrap: 'nowrap', + paddingRight: 0, }, listItemIcon: { marginRight: theme.spacing(1), @@ -103,12 +110,12 @@ const useStyles = makeStyles()((theme) => ({ minWidth: 'unset', }, walletIcon: { - marginRight: theme.spacing(1), color: theme.palette.maskColor.second, minWidth: 'unset', }, listText: { fontSize: 14, + color: theme.palette.maskColor.main, }, link: { color: theme.palette.maskColor.main, @@ -167,7 +174,7 @@ export const PersonasBackupPreview = memo(function P } /> - + {info.accounts}}> @@ -253,6 +260,7 @@ export const WalletsBackupPreview = memo(function Wal pluginID={NetworkPluginID.PLUGIN_EVM} address={wallet} mr="10px" + fontWeight={400} /> diff --git a/packages/mask/dashboard/components/MoreMenu/index.tsx b/packages/mask/dashboard/components/MoreMenu/index.tsx new file mode 100644 index 000000000000..71692372e1cc --- /dev/null +++ b/packages/mask/dashboard/components/MoreMenu/index.tsx @@ -0,0 +1,43 @@ +import { Icons, type GeneratedIconProps } from '@masknet/icons' +import { makeStyles } from '@masknet/theme' +import { Popover } from '@mui/material' +import { memo, useState, type ReactNode } from 'react' + +const useStyles = makeStyles()((theme) => ({ + paper: { + padding: theme.spacing(2), + borderRadius: 24, + background: theme.palette.maskColor.bottom, + boxShadow: + theme.palette.mode === 'dark' ? + '0px 4px 30px 0px rgba(255, 255, 255, 0.15)' + : '0px 4px 30px 0px rgba(0, 0, 0, 0.10)', + }, +})) + +interface Props extends GeneratedIconProps { + children?: ReactNode | ((props: { close: () => void }) => ReactNode) +} + +export const MoreMenu = memo(function MoreMenu({ children, ...rest }) { + const { classes } = useStyles() + const [anchorEl, setAnchorEl] = useState(null) + return ( + <> + setAnchorEl(e.currentTarget)} /> + setAnchorEl(null)} + classes={{ paper: classes.paper }} + anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }} + transformOrigin={{ + vertical: 'top', + horizontal: 'right', + }}> + {typeof children === 'function' ? children({ close: () => setAnchorEl(null) }) : children} + + + ) +}) diff --git a/packages/mask/dashboard/components/SetupFrame/index.tsx b/packages/mask/dashboard/components/SetupFrame/index.tsx index b7e4cd3cc5da..4077a1e605c6 100644 --- a/packages/mask/dashboard/components/SetupFrame/index.tsx +++ b/packages/mask/dashboard/components/SetupFrame/index.tsx @@ -1,9 +1,9 @@ -import { lazy, memo, Suspense, useState, type PropsWithChildren } from 'react' -import { Box, Typography } from '@mui/material' import { Icons } from '@masknet/icons' -import { Welcome } from '../../assets/index.js' import { LoadingBase, makeStyles } from '@masknet/theme' +import { Box, Typography } from '@mui/material' +import { lazy, memo, Suspense, useState, type PropsWithChildren } from 'react' import { Outlet } from 'react-router-dom' +import { Welcome } from '../../assets/index.js' const Spline = lazy(() => import('./spline.js')) interface SetupFrameProps { diff --git a/packages/mask/dashboard/contexts/CloudBackupFormContext.tsx b/packages/mask/dashboard/contexts/CloudBackupFormContext.tsx index 6b7c686ab5b1..15d881b63dce 100644 --- a/packages/mask/dashboard/contexts/CloudBackupFormContext.tsx +++ b/packages/mask/dashboard/contexts/CloudBackupFormContext.tsx @@ -1,11 +1,11 @@ +import { zodResolver } from '@hookform/resolvers/zod' +import { useLingui } from '@lingui/react/macro' import { createContainer } from '@masknet/shared-base-ui' +import { useTabs } from '@masknet/theme' +import guessCallingCode from 'guess-calling-code' import { useForm } from 'react-hook-form' -import { zodResolver } from '@hookform/resolvers/zod' import { z } from 'zod' -import { useTabs } from '@masknet/theme' import { emailRegexp, phoneRegexp } from '../utils/regexp.js' -import guessCallingCode from 'guess-calling-code' -import { useLingui } from '@lingui/react/macro' export interface CloudBackupFormInputs { email: string @@ -70,4 +70,5 @@ function useCloudBackupFormContext() { } } +/** @deprecated */ export const CloudBackupFormContext = createContainer(useCloudBackupFormContext) diff --git a/packages/mask/dashboard/hooks/useBackupFormState.ts b/packages/mask/dashboard/hooks/useBackupFormState.ts index f5e08a412ccb..aa1fa092e0e7 100644 --- a/packages/mask/dashboard/hooks/useBackupFormState.ts +++ b/packages/mask/dashboard/hooks/useBackupFormState.ts @@ -1,12 +1,12 @@ +import Services from '#services' import { zodResolver } from '@hookform/resolvers/zod' +import { useLingui } from '@lingui/react/macro' import { useState } from 'react' import { useForm } from 'react-hook-form' import { useAsync } from 'react-use' import { z } from 'zod' import { UserContext } from '../../shared-ui/index.js' -import Services from '#services' import { passwordRegexp } from '../utils/regexp.js' -import { useLingui } from '@lingui/react/macro' export type BackupFormInputs = { backupPassword: string @@ -16,7 +16,6 @@ export type BackupFormInputs = { export function useBackupFormState() { const { t } = useLingui() const { value: hasPassword } = useAsync(Services.Wallet.hasPassword, []) - const { value: previewInfo, loading } = useAsync(Services.Backup.generateBackupPreviewInfo, []) const { user } = UserContext.useContainer() const [backupWallets, setBackupWallets] = useState(false) @@ -24,7 +23,6 @@ export function useBackupFormState() { mode: 'onBlur', context: { user, - backupWallets, hasPassword, }, @@ -38,7 +36,7 @@ export function useBackupFormState() { .string() .min(8, t`Incorrect Password`) .max(20, t`Incorrect Password`) - .refine((password) => password === user.backupPassword, t`Incorrect Password`) + .refine((password) => password === user.backupPassword, t`Incorrect Backup Password`) .refine((password) => passwordRegexp.test(password), t`Incorrect Password`), paymentPassword: backupWallets && hasPassword ? @@ -55,8 +53,6 @@ export function useBackupFormState() { return { hasPassword, - previewInfo, - loading, backupWallets, setBackupWallets, formState, diff --git a/packages/mask/dashboard/hooks/useBackupPreviewInfo.ts b/packages/mask/dashboard/hooks/useBackupPreviewInfo.ts new file mode 100644 index 000000000000..524ad737c5c3 --- /dev/null +++ b/packages/mask/dashboard/hooks/useBackupPreviewInfo.ts @@ -0,0 +1,11 @@ +import { useQuery } from '@tanstack/react-query' +import Services from '#services' + +export function useBackupPreviewInfo() { + return useQuery({ + queryKey: ['backup', 'preview-info'], + queryFn: () => Services.Backup.generateBackupPreviewInfo(), + refetchInterval: 60_0000, + refetchOnWindowFocus: true, + }) +} diff --git a/packages/mask/dashboard/hooks/useGoogleDriveFiles.ts b/packages/mask/dashboard/hooks/useGoogleDriveFiles.ts new file mode 100644 index 000000000000..aa7437b0a393 --- /dev/null +++ b/packages/mask/dashboard/hooks/useGoogleDriveFiles.ts @@ -0,0 +1,23 @@ +import { useInfiniteQuery } from '@tanstack/react-query' +import { GoogleDriveClient } from '@masknet/web3-providers' +import { compact } from 'lodash-es' +import { clearGoogleDriveAccessToken, getGoogleDriveAccessToken } from '../pages/SetupPersona/Backup/helpers.js' + +const defaultClient = new GoogleDriveClient(getGoogleDriveAccessToken, clearGoogleDriveAccessToken) +export function useGoogleDriveFiles(client: GoogleDriveClient = defaultClient) { + return useInfiniteQuery({ + enabled: client.hasLogin, + queryKey: ['google-drive', 'files'], + initialPageParam: '', + queryFn: (param) => { + return client.listBackupFiles({ + pageSize: '100', + pageToken: param.pageParam, + }) + }, + getNextPageParam: () => '', + select(data) { + return compact(data.pages.flatMap((x) => x)) + }, + }) +} diff --git a/packages/mask/dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx b/packages/mask/dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx index 239c540a82da..f2f6047e55ad 100644 --- a/packages/mask/dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx +++ b/packages/mask/dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx @@ -1,25 +1,24 @@ -import { InjectedDialog, LoadingStatus } from '@masknet/shared' -import { memo, useCallback, useMemo, useRef } from 'react' -import { Box, DialogActions, DialogContent, Typography } from '@mui/material' -import { useBackupFormState, type BackupFormInputs } from '../../hooks/useBackupFormState.js' -import { ActionButton, makeStyles, useCustomSnackbar } from '@masknet/theme' -import { Icons } from '@masknet/icons' -import { useAsyncFn, useUpdateEffect } from 'react-use' import Services from '#services' -import type { BackupAccountType } from '@masknet/shared-base' -import { fetchDownloadLink, fetchUploadLink, uploadBackupValue } from '../../utils/api.js' +import { msg } from '@lingui/core/macro' +import { useLingui } from '@lingui/react' +import { Trans } from '@lingui/react/macro' import { encryptBackup } from '@masknet/backup-format' +import { Icons } from '@masknet/icons' +import { InjectedDialog, LoadingStatus } from '@masknet/shared' +import type { BackupAccountType } from '@masknet/shared-base' +import { DashboardRoutes } from '@masknet/shared-base' +import { ActionButton, makeStyles, useCustomSnackbar } from '@masknet/theme' import { encode } from '@msgpack/msgpack' +import { Box, DialogActions, DialogContent, Typography } from '@mui/material' +import { memo, useCallback, useMemo, useRef } from 'react' import { Controller } from 'react-hook-form' +import { useNavigate } from 'react-router-dom' +import { useAsyncFn, useUpdateEffect } from 'react-use' +import { UserContext } from '../../../shared-ui/index.js' import { PersonasBackupPreview, WalletsBackupPreview } from '../../components/BackupPreview/index.js' import PasswordField from '../../components/PasswordField/index.js' -import { useNavigate, useSearchParams } from 'react-router-dom' -import { DashboardRoutes } from '@masknet/shared-base' -import { format as formatDateTime } from 'date-fns' -import { UserContext } from '../../../shared-ui/index.js' -import { msg } from '@lingui/core/macro' -import { Trans } from '@lingui/react/macro' -import { useLingui } from '@lingui/react' +import { useBackupFormState, type BackupFormInputs } from '../../hooks/useBackupFormState.js' +import { useBackupPreviewInfo } from '../../hooks/useBackupPreviewInfo.js' const useStyles = makeStyles()((theme) => ({ container: { @@ -57,34 +56,35 @@ const useStyles = makeStyles()((theme) => ({ }, })) -interface BackupPreviewDialogProps { +export interface BackupPreviewDialogProps { open: boolean - onClose: () => void - isOverwrite: boolean + isUpload?: boolean code: string type: BackupAccountType account: string abstract?: string + onClose: () => void + uploadButtonLabel?: React.ReactNode | string + onUpload?: (content: ArrayBuffer, signal: AbortSignal) => Promise } export const BackupPreviewDialog = memo(function BackupPreviewDialog({ open, - onClose, - isOverwrite, + isUpload, code, type, account, abstract, + onClose, + uploadButtonLabel, + onUpload, }) { const { _ } = useLingui() const controllerRef = useRef(null) const { classes, theme } = useStyles() - const [params, setParams] = useSearchParams() const navigate = useNavigate() const { updateUser } = UserContext.useContainer() const { hasPassword, - previewInfo, - loading, backupWallets, setBackupWallets, formState: { @@ -96,6 +96,7 @@ export const BackupPreviewDialog = memo(function Backu formState: { errors, isDirty, isValid }, }, } = useBackupFormState() + const { data: previewInfo, isLoading: loading } = useBackupPreviewInfo() const { showSnackbar } = useCustomSnackbar() const [{ loading: uploadLoading, value }, handleUploadBackup] = useAsyncFn( @@ -114,44 +115,22 @@ export const BackupPreviewDialog = memo(function Backu excludeWallet: !backupWallets, }) - const name = `mask-network-keystore-backup-${formatDateTime(new Date(), 'yyyy-MM-dd')}` - const uploadUrl = await fetchUploadLink({ - code, - account, - type, - abstract: name, - }) const encrypted = await encryptBackup(encode(account + data.backupPassword), encode(file)) const controller = new AbortController() controllerRef.current = controller - const response = await uploadBackupValue(uploadUrl, encrypted, controller.signal) - - if (response.ok) { - const now = formatDateTime(new Date(), 'yyyy-MM-dd HH:mm') - const downloadLinkResponse = await fetchDownloadLink({ - account, - type, - code, - }) - showSnackbar(You have backed up your data., { variant: 'success' }) - updateUser({ cloudBackupAt: now, cloudBackupMethod: type }) - setParams((params) => { - params.set('size', downloadLinkResponse.size.toString()) - params.set('abstract', downloadLinkResponse.abstract) - params.set('uploadedAt', downloadLinkResponse.uploadedAt.toString()) - params.set('downloadURL', downloadLinkResponse.downloadURL) - return params.toString() - }) - } - return true + await onUpload?.(encrypted, controller.signal) + showSnackbar(Backup Successful, { + variant: 'success', + message: Data backed up successfully!, + }) + onClose() } catch (error) { showSnackbar(Backup Failed, { variant: 'error' }) onClose() - if ((error as any).status === 400) navigate(DashboardRoutes.CloudBackup, { replace: true }) - return false + if ((error as any).status === 400) navigate(DashboardRoutes.BackupCloud, { replace: true }) } }, - [code, hasPassword, backupWallets, abstract, code, account, type, _, navigate, updateUser, params], + [code, hasPassword, backupWallets, abstract, code, account, type, _, navigate, updateUser], ) const handleClose = useCallback(() => { @@ -165,23 +144,6 @@ export const BackupPreviewDialog = memo(function Backu }, [backupWallets, resetField]) const content = useMemo(() => { - if (value) - return ( - - 🎉 - - Congratulations - - - Backup is saved to Mask Cloud Service. - - - ) if (uploadLoading) return ( @@ -233,7 +195,7 @@ export const BackupPreviewDialog = memo(function Backu name="paymentPassword" /> : null} - {isOverwrite ? + {isUpload ? This will overwrite the existing cloud backup with the local data, this cannot be undo. @@ -247,11 +209,11 @@ export const BackupPreviewDialog = memo(function Backu previewInfo, control, _, - // eslint-disable-next-line react-compiler/react-compiler - JSON.stringify(errors), + errors.backupPassword?.message, + errors.paymentPassword?.message, backupWallets, setBackupWallets, - isOverwrite, + isUpload, theme, value, uploadLoading, @@ -275,17 +237,15 @@ export const BackupPreviewDialog = memo(function Backu : } - color={isOverwrite ? 'error' : 'primary'} + startIcon={isUpload ? : } + color="primary" disabled={!isDirty || !isValid}> - {isOverwrite ? - Overwrite Backup - : Backup to the Cloud} + {isUpload ? (uploadButtonLabel ?? Backup) : Backup to the Cloud} ) }, [ backupWallets, - isOverwrite, + isUpload, isDirty, isValid, hasPassword, diff --git a/packages/mask/dashboard/modals/BackupPreviewModal/index.tsx b/packages/mask/dashboard/modals/BackupPreviewModal/index.tsx index 50efe5c71f64..41e5f45ae7c0 100644 --- a/packages/mask/dashboard/modals/BackupPreviewModal/index.tsx +++ b/packages/mask/dashboard/modals/BackupPreviewModal/index.tsx @@ -1,50 +1,22 @@ -import type { BackupAccountType, SingletonModalProps } from '@masknet/shared-base' +import type { SingletonModalProps } from '@masknet/shared-base' import { useSingletonModal } from '@masknet/shared-base-ui' import { useState } from 'react' -import { BackupPreviewDialog } from './BackupPreviewDialog.js' +import { BackupPreviewDialog, type BackupPreviewDialogProps } from './BackupPreviewDialog.js' -export interface BackupPreviewModalOpenProps { - isOverwrite?: boolean - code: string - type: BackupAccountType - account: string - abstract?: string -} +export interface BackupPreviewModalOpenProps extends Omit {} export function BackupPreviewModal({ ref }: SingletonModalProps) { - const [isOverwrite, setIsOverwrite] = useState(false) - const [code, setCode] = useState('') - const [type, setType] = useState() - const [account, setAccount] = useState('') - const [abstract, setAbstract] = useState('') + const [props, setProps] = useState(null) const [open, dispatch] = useSingletonModal(ref, { onOpen(props) { - if (props.isOverwrite) setIsOverwrite(props.isOverwrite) - if (props.abstract) setAbstract(props.abstract) - setCode(props.code) - setType(props.type) - setAccount(props.account) + setProps(props) }, - onClose(props) { - setIsOverwrite(false) - setAbstract('') - setCode('') - setType(undefined) - setAccount('') + onClose() { + setProps(null) }, }) - if (!open || !type) return null - return ( - dispatch?.close()} - isOverwrite={isOverwrite} - code={code} - type={type} - account={account} - abstract={abstract} - /> - ) + if (!props || !open) return null + return dispatch?.close()} {...props} /> } diff --git a/packages/mask/dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx b/packages/mask/dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx index 42b77845b71d..5ca5115cc1cb 100644 --- a/packages/mask/dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +++ b/packages/mask/dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx @@ -3,21 +3,20 @@ import { Trans, useLingui } from '@lingui/react/macro' import { decryptBackup } from '@masknet/backup-format' import { Icons } from '@masknet/icons' import { formatFileSize, InjectedDialog } from '@masknet/shared' -import type { BackupAccountType } from '@masknet/shared-base' -import { DashboardRoutes } from '@masknet/shared-base' import { ActionButton, makeStyles, useCustomSnackbar } from '@masknet/theme' import { decode, encode } from '@msgpack/msgpack' import { Box, DialogActions, DialogContent, LinearProgress, Typography } from '@mui/material' import { format as formatDateTime, fromUnixTime } from 'date-fns' -import { last } from 'lodash-es' -import { memo, useCallback, useMemo, useState, type ReactNode } from 'react' -import { useNavigate } from 'react-router-dom' +import { memo, useCallback, useState, type ReactNode } from 'react' import { useAsync, useAsyncFn } from 'react-use' import PasswordField from '../../components/PasswordField/index.js' import { passwordRegexp } from '../../utils/regexp.js' -import { BackupPreviewModal } from '../modals.js' const useStyles = makeStyles()((theme) => ({ + dialog: { + height: 620, + width: 600, + }, account: { padding: theme.spacing(0.5, 2), fontSize: 14, @@ -38,95 +37,60 @@ const useStyles = makeStyles()((theme) => ({ fontSize: 14, lineHeight: '18px', }, - container: { - display: 'flex', - flexDirection: 'column', - justifyContent: 'center', - alignItems: 'center', - minHeight: 276, - }, })) -interface MergeBackupDialogProps { - open: boolean - onClose: () => void - downloadLink: string +export interface MergeBackupDialogProps { account: string - uploadedAt: string + /** + * A generator that yield progress of download, + * and return the content of the downloaded file at the end + */ + download: () => AsyncGenerator + fileName: string + onClose: () => void + open: boolean size: string - type?: BackupAccountType - abstract?: string - code: string + /** unix time */ + uploadedAt: string | number } export const MergeBackupDialog = memo(function MergeBackupDialog({ open, onClose, - downloadLink, + fileName, + download, account, uploadedAt, size, - type, - code, - abstract, }) { const { t } = useLingui() const { classes, theme } = useStyles() - const [process, setProcess] = useState(0) + const [progress, setProgress] = useState(0) const [backupPassword, setBackupPassword] = useState('') const [backupPasswordError, setBackupPasswordError] = useState() - const [showCongratulation, setShowCongratulation] = useState(false) - const navigate = useNavigate() const { showSnackbar } = useCustomSnackbar() const handleClose = useCallback(() => { setBackupPassword('') setBackupPasswordError('') - setShowCongratulation(false) onClose() }, [onClose]) const { value: encrypted } = useAsync(async () => { - if (!downloadLink || !open) return - - const response = await fetch(downloadLink, { method: 'GET', cache: 'no-store' }) - - if (!response.ok || response.status !== 200) { - showSnackbar(The download link is expired, { variant: 'error' }) - handleClose() - navigate(DashboardRoutes.CloudBackup, { replace: true }) - return - } - const reader = response.body?.getReader() - const contentLength = response.headers.get('Content-Length') - - if (!contentLength || !reader) return - let received = 0 - const chunks: number[] = [] - while (true) { - const { done, value } = await reader.read() - - if (done || !value) { - setProcess(100) - break - } - chunks.push(...value) - received += value.length - - setProcess((received / Number(contentLength)) * 100) - } - return Uint8Array.from(chunks).buffer - }, [downloadLink, handleClose, open]) - - const fileName = useMemo(() => { + if (!open) return + const generator = download() try { - if (!downloadLink) return '' - const url = new URL(downloadLink) - return last(url.pathname.split('/')) - } catch { - return '' + let step: IteratorResult + while (!(step = await generator.next()).done) { + setProgress(step.value) + } + return step.value + } catch (err) { + showSnackbar((err as Error).message, { variant: 'error' }) + handleClose() + throw err } - }, [downloadLink]) + }, [handleClose, open, download]) const [{ loading }, handleClickMerge] = useAsyncFn(async () => { try { @@ -145,76 +109,44 @@ export const MergeBackupDialog = memo(function MergeBack if (!hasPassword) await Services.Wallet.setDefaultPassword() } await Services.Backup.restoreBackup(backupText) - showSnackbar(Download backup, { + showSnackbar(Merge Completed, { variant: 'success', - message: Backup downloaded and merged to local successfully., + message: Your file has been successfully merged into the browser data., }) - setShowCongratulation(true) - } catch { - showSnackbar(Failed to download and merge the backup.) + } catch (err) { + showSnackbar(Failed to download and merge the backup: {(err as Error).message}) } }, [encrypted, backupPassword, account]) - const handleClickBackup = useCallback(async () => { - if (!type) return - BackupPreviewModal.open({ - isOverwrite: true, - code, - abstract, - type, - account, - }) - handleClose() - }, [code, abstract, type, account, handleClose]) - - if (showCongratulation) - return ( - Merge data to local database} open={open} onClose={handleClose}> - - - 🎉 - - Congratulations - - - - Data merged from Mask Cloud Service to local successfully. Re-enter your password to - encrypt and upload the new backup to Mask Cloud Service. - - - - - - - Backup to Mask Cloud Service - - - - ) - return ( - Merge data to local database} open={open} onClose={onClose}> + Merge data to local database} + open={open} + onClose={onClose}> {account} {fileName} - + - {process !== 100 ? + {progress !== 100 ? Downloading : <> - + {formatFileSize(Number(size))} (function MergeBack } onClick={handleClickMerge} loading={loading} disabled={!!backupPasswordError || !backupPassword || !encrypted}> - Merge to local + Merge to Browser diff --git a/packages/mask/dashboard/modals/MergeBackupModal/index.tsx b/packages/mask/dashboard/modals/MergeBackupModal/index.tsx index ffdc3dbb0906..857b3714f8eb 100644 --- a/packages/mask/dashboard/modals/MergeBackupModal/index.tsx +++ b/packages/mask/dashboard/modals/MergeBackupModal/index.tsx @@ -1,57 +1,21 @@ -import type { BackupAccountType, SingletonModalProps } from '@masknet/shared-base' +import type { SingletonModalProps } from '@masknet/shared-base' import { useSingletonModal } from '@masknet/shared-base-ui' import { useState } from 'react' -import { MergeBackupDialog } from './MergeBackupDialog.js' +import { MergeBackupDialog, type MergeBackupDialogProps } from './MergeBackupDialog.js' -export interface MergeBackupModalOpenProps { - downloadLink: string - account: string - uploadedAt: string - size: string - code: string - abstract?: string - type: BackupAccountType -} +export interface MergeBackupModalOpenProps extends Omit {} export function MergeBackupModal({ ref }: SingletonModalProps) { - const [downloadLink, setDownloadLink] = useState('') - const [code, setCode] = useState('') - const [type, setType] = useState() - const [account, setAccount] = useState('') - const [abstract, setAbstract] = useState('') - const [uploadedAt, setUploadedAt] = useState('') - const [size, setSize] = useState('') + const [props, setProps] = useState(null) const [open, dispatch] = useSingletonModal(ref, { onOpen(props) { - if (props.abstract) setAbstract(props.abstract) - setCode(props.code) - setType(props.type) - setDownloadLink(props.downloadLink) - setAccount(props.account) - setUploadedAt(props.uploadedAt) - setSize(props.size) + setProps(props) }, onClose(props) { - setCode('') - setType(undefined) - setDownloadLink('') - setAccount('') - setSize('') - setUploadedAt('') + setProps(null) }, }) + if (!props) return null - return ( - dispatch?.close()} - account={account} - downloadLink={downloadLink} - size={size} - uploadedAt={uploadedAt} - /> - ) + return dispatch?.close()} {...props} /> } diff --git a/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts b/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts new file mode 100644 index 000000000000..6494465c13d2 --- /dev/null +++ b/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts @@ -0,0 +1,67 @@ +import { zodResolver } from '@hookform/resolvers/zod' +import { useLingui } from '@lingui/react/macro' +import { BackupAccountType } from '@masknet/shared-base' +import { createContainer } from '@masknet/shared-base-ui' +import guessCallingCode from 'guess-calling-code' +import { useState } from 'react' +import { useForm } from 'react-hook-form' +import { z } from 'zod' +import { phoneRegexp } from '../../../../utils/regexp.js' + +export interface CloudBackupFormInputs { + email: string + phone: string + code: string + countryCode: string +} + +export function useCloudBackupForm() { + const { t } = useLingui() + + const [backupType, setBackupType] = useState(BackupAccountType.Email) + const isEmail = backupType === BackupAccountType.Email + + const form = useForm({ + mode: 'onSubmit', + context: { + backupType, + }, + defaultValues: { + email: '', + phone: '', + code: '', + countryCode: (guessCallingCode.default || guessCallingCode)(), + }, + resolver: zodResolver( + z + .object({ + email: isEmail ? z.string().email(t`Invalid email address format.`) : z.string().optional(), + countryCode: isEmail ? z.string().optional() : z.string(), + phone: isEmail ? z.string().optional() : z.string().regex(phoneRegexp), + code: z + .string() + .min(1, t`The code is incorrect.`) + .max(6, t`The code is incorrect.`), + }) + .refine( + (data) => { + if (isEmail) return true + if (!data.countryCode || !data.phone) return false + return phoneRegexp.test(`+${data.countryCode} ${data.phone}`) + }, + { + message: t`The phone number is incorrect.`, + path: ['phone'], + }, + ), + ), + }) + + return { + form, + backupType, + setBackupType, + } +} + +export const CloudBackupFormContext = createContainer(useCloudBackupForm) diff --git a/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx b/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx new file mode 100644 index 000000000000..768e02af6158 --- /dev/null +++ b/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx @@ -0,0 +1,109 @@ +import { Trans, useLingui } from '@lingui/react/macro' +import { BackupAccountType } from '@masknet/shared-base' +import { CountdownButton, makeStyles, useCustomSnackbar } from '@masknet/theme' +import { Box, TextField } from '@mui/material' +import { memo, useCallback } from 'react' +import { Controller } from 'react-hook-form' +import { UserContext, useLanguage } from '../../../../../shared-ui/index.js' +import { sendCode } from '../../../../utils/api.js' +import { Locale, Scenario } from '../../../../utils/type.js' +import { CloudBackupFormContext } from './CloudBackupFormContext.js' + +const useStyles = makeStyles()((theme) => ({ + send: { + color: theme.palette.maskColor.main, + fontSize: 14, + }, +})) + +export const EmailForm = memo(function EmailForm() { + const { t } = useLingui() + const language = useLanguage() + const { classes } = useStyles() + const { user } = UserContext.useContainer() + const { showSnackbar } = useCustomSnackbar() + const { + form: { + clearErrors, + control, + watch, + trigger, + formState: { errors }, + }, + } = CloudBackupFormContext.useContainer() + + const email = watch('email') + + const handleSendVerificationCode = useCallback(async () => { + const response = await sendCode({ + account: email, + type: BackupAccountType.Email, + scenario: user.email ? Scenario.change : Scenario.create, + locale: language.includes('zh') ? Locale.zh : Locale.en, + }).catch((error) => { + showSnackbar( + error.message.includes('SendTemplatedEmail') ? + Invalid email address format. + : error.message, + { variant: 'error' }, + ) + }) + + if (response) { + showSnackbar(Verification code sent, { variant: 'success' }) + } + }, [email, user, language]) + + return ( + + ( + clearErrors('email')} + onBlur={() => trigger('email')} + fullWidth + placeholder={t`Email`} + type="email" + error={!!errors.email?.message} + helperText={errors.email?.message} + /> + )} + /> + ( + clearErrors('code')} + fullWidth + placeholder={t`Email verification code`} + error={!!errors.code?.message} + helperText={errors.code?.message} + InputProps={{ + disableUnderline: true, + endAdornment: ( + Resend}> + Send + + ), + }} + /> + )} + /> + + ) +}) diff --git a/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx b/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx new file mode 100644 index 000000000000..2d30815c02b3 --- /dev/null +++ b/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx @@ -0,0 +1,369 @@ +import { t } from '@lingui/core/macro' +import { formatFileSize } from '@masknet/shared' +import { Trans } from '@lingui/react/macro' +import { Icons } from '@masknet/icons' +import { BackupAccountType, EMPTY_LIST } from '@masknet/shared-base' +import { format } from 'date-fns' +import { makeStyles, useCustomSnackbar } from '@masknet/theme' +import { GoogleDriveClient, type DriveFile } from '@masknet/web3-providers' +import { + Box, + Button, + Paper, + Portal, + Table, + TableBody, + TableCell, + TableContainer, + TableHead, + Tooltip, + TableRow, + Typography, + Skeleton, +} from '@mui/material' +import { compact, range, uniqBy } from 'lodash-es' +import { memo, useMemo, useState } from 'react' +import { useOutletContext } from 'react-router-dom' +import { useAsyncFn } from 'react-use' +import { UserContext } from '../../../../../shared-ui/index.js' +import { PrimaryButton } from '../../../../components/PrimaryButton/index.js' +import { useGoogleDriveFiles } from '../../../../hooks/useGoogleDriveFiles.js' +import type { PortalContainerProps } from '../types.js' +import { BackupPreviewModal, MergeBackupModal } from '../../../../modals/modals.js' +import { + clearGoogleDriveAccessToken, + createBackupName, + downloadBackup, + getGoogleDriveAccessToken, + progressDownload, +} from '../helpers.js' +import { MoreMenu } from '../../../../components/MoreMenu/index.js' + +const useStyles = makeStyles()((theme) => ({ + container: { + display: 'flex', + flexDirection: 'column', + gap: theme.spacing(1.5), + paddingBottom: theme.spacing(6), + }, + header: { + display: 'flex', + justifyContent: 'space-between', + alignItems: 'center', + }, + user: { + display: 'flex', + flexDirection: 'column', + gap: theme.spacing(1), + }, + providerName: { + fontWeight: 400, + fontSize: 14, + lineHeight: '18px', + height: 18, + color: theme.palette.maskColor.second, + }, + userAccount: { + fontWeight: 700, + fontSize: 14, + lineHeight: '18px', + height: 18, + color: theme.palette.maskColor.main, + }, + title: { + fontSize: 16, + fontWeight: 700, + lineHeight: '20px', + }, + subtitle: { + fontSize: 14, + fontWeight: 400, + lineHeight: '18px', + }, + folder: { + fontSize: 14, + fontWeight: 700, + lineHeight: '18px', + }, + tableContainer: { + border: `1px solid ${theme.palette.maskColor.line}`, + borderRadius: 8, + overflow: 'hidden', + height: 340, + marginTop: theme.spacing(2), + }, + table: { + borderRadius: 8, + borderCollapse: 'collapse', + borderSpacing: 0, + }, + tableHeadCell: { + borderBottom: `1px solid ${theme.palette.maskColor.line}`, + fontSize: 14, + fontWeight: 700, + lineHeight: '18px', + padding: theme.spacing(1.5), + height: 18, + }, + bodyCell: { + padding: theme.spacing(0, 1.5), + fontSize: 14, + height: 42, + lineHeight: '18px', + fontWeight: 400, + color: theme.palette.maskColor.main, + verticalAlign: 'middle', + }, + cellText: { + fontSize: 14, + }, + actionButton: { + color: theme.palette.maskColor.second, + '&:hover': { + color: theme.palette.maskColor.main, + }, + }, + actions: { + display: 'flex', + flexDirection: 'column', + gap: theme.spacing(1.5), + }, + action: { + padding: 6, + height: 30, + display: 'flex', + gap: 4, + alignItems: 'center', + cursor: 'pointer', + borderRadius: 8, + '&:hover': { + backgroundColor: theme.palette.maskColor.bg, + }, + }, + actionLabel: { + fontSize: 14, + fontWeight: 700, + lineHeight: '18px', + color: theme.palette.maskColor.main, + }, +})) + +export const Component = memo(function GoogleDriveBackup() { + const { classes } = useStyles() + const { user, updateUser } = UserContext.useContainer() + const { showSnackbar } = useCustomSnackbar() + const { portalContainerRef } = useOutletContext() + const googleDriveClient = useMemo( + () => new GoogleDriveClient(getGoogleDriveAccessToken, clearGoogleDriveAccessToken), + [], + ) + const { data: files = EMPTY_LIST, refetch, isLoading } = useGoogleDriveFiles(googleDriveClient) + + const login = async () => { + try { + const userInfo = await googleDriveClient.getUserInfo() + updateUser({ + googleAccount: userInfo.email || '', + }) + } catch (err) { + showSnackbar(t`Failed to login: ${(err as Error).message}`, { variant: 'error' }) + } + } + + const [uploadedFile, setUploadedFile] = useState(null) + + const [{ loading }, uploadFile] = useAsyncFn( + async (content: ArrayBuffer) => { + const name = createBackupName() + const file = new File([content], name, { type: 'application/octet-stream' }) + const result = await googleDriveClient.uploadFile(file) + const date = new Date() + setUploadedFile({ + ...result, + name, + size: file.size.toString(), + createdTime: date.toISOString(), + modifiedTime: date.toISOString(), + }) + refetch() + }, + [googleDriveClient], + ) + + const mergedFiles = useMemo(() => uniqBy(compact([...files, uploadedFile]), (x) => x.id), [files, uploadedFile]) + + if (!user.googleAccount) { + return ( + + + Add google Drive + + + + when you click Add Google Drive button,you will be forwarded to Google authorization pages. + + + + + + + ) + } + + const downloadAndMerge = async (file: DriveFile) => { + await MergeBackupModal.openAndWaitForClose({ + download: () => { + return progressDownload(() => googleDriveClient.requestFile(file.id), file.size ? +file.size : 0) + }, + fileName: file.name, + account: user.googleAccount!, + size: file.size || '0', + uploadedAt: new Date(file.modifiedTime).getTime(), + }) + } + return ( + + + + + Google Drive + + {user.googleAccount} + + + + + MaskBackup file + + + + + + File name + + + Size + + + Date & Time + + + Actions + + + + {isLoading ? + + {range(3).map((index) => ( + + + + + + + + + + + + + + + ))} + + : + {mergedFiles.map((file, index) => ( + + {file.name} + + {file.size ? formatFileSize(+file.size) : '--'} + + + + + {format(file.modifiedTime, 'LLL d, yyyy')} + + + + + + {({ close }) => ( +
+
{ + close() + downloadAndMerge(file) + }}> + + + Merge to Browser + +
+
{ + const blob = await googleDriveClient.downloadFile( + file.id, + ) + const url = URL.createObjectURL(blob) + downloadBackup(url, file.name) + URL.revokeObjectURL(url) + close() + }}> + + + Download + +
+
+ )} +
+
+
+ ))} +
+ } +
+ + + portalContainerRef.current}> + } + size="large" + color="primary" + loading={loading} + disabled={loading} + onClick={() => { + if (!user.googleAccount) return + BackupPreviewModal.open({ + code: 'google-drive', + type: BackupAccountType.Email, + account: user.googleAccount!, + isUpload: true, + onUpload: uploadFile, + uploadButtonLabel: Back Up to Google Drive, + }) + }}> + Back Up to Google Drive + + + + ) +}) diff --git a/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx b/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx new file mode 100644 index 000000000000..c4b90b7b5700 --- /dev/null +++ b/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx @@ -0,0 +1,138 @@ +import { t } from '@lingui/core/macro' +import { Trans } from '@lingui/react/macro' +import { Alert, useParamTab } from '@masknet/shared' +import { BackupAccountType, DashboardRoutes } from '@masknet/shared-base' +import { makeStyles } from '@masknet/theme' +import { Box, Portal, Radio, RadioGroup, Typography } from '@mui/material' +import { memo, useState } from 'react' +import { useNavigate, useOutletContext } from 'react-router-dom' +import { useAsyncFn } from 'react-use' +import urlcat from 'urlcat' +import { UserContext } from '../../../../../shared-ui/index.js' +import { PrimaryButton } from '../../../../components/PrimaryButton/index.js' +import { fetchDownloadLink } from '../../../../utils/api.js' +import type { PortalContainerProps } from '../types.js' +import { CloudBackupFormContext, type CloudBackupFormInputs } from './CloudBackupFormContext.js' +import { EmailForm } from './EmailForm.js' +import { PhoneForm } from './PhoneForm.js' + +const useStyles = makeStyles()((theme) => ({ + container: { + display: 'flex', + flexDirection: 'column', + gap: theme.spacing(2), + }, + radios: { + flexDirection: 'row', + display: 'flex', + flexWrap: 'nowrap', + justifyContent: 'space-evenly', + }, + radioContainer: { + flexGrow: 1, + '& label': { + cursor: 'pointer', + }, + }, +})) + +export const Component = memo(function MaskNetworkBackup() { + const { classes } = useStyles() + const { portalContainerRef } = useOutletContext() + const { user, updateUser } = UserContext.useContainer() + const navigate = useNavigate() + const [showAlert, setShowAlert] = useState(true) + + const [accountType, setAccountType] = useParamTab(BackupAccountType.Email, 'account-type') + const { form } = CloudBackupFormContext.useContainer() + const { setError, formState, reset } = form + + const isEmail = accountType === BackupAccountType.Email + const incorrectCodeMsg = t`The code is incorrect.` + const [{ loading }, handleSubmit] = useAsyncFn( + async (data: CloudBackupFormInputs) => { + const response = await fetchDownloadLink({ + account: isEmail ? data.email : `+${data.countryCode} ${data.phone}`, + type: isEmail ? BackupAccountType.Email : BackupAccountType.Phone, + code: data.code, + }).catch((error) => { + if (error.status === 400) { + setError('code', { + type: 'custom', + message: incorrectCodeMsg, + }) + } else if (error.status === 404) { + reset() + // No cloud backup file + navigate( + urlcat(DashboardRoutes.BackupPreview, { + type: isEmail ? BackupAccountType.Email : BackupAccountType.Phone, + account: isEmail ? data.email : `+${data.countryCode} ${data.phone}`, + code: data.code, + }), + ) + } + }) + + if (!response) return + + updateUser({ + email: data.email || user.email, + phone: data.phone ? `${data.countryCode} ${data.phone}` : user.phone, + }) + reset() + navigate( + urlcat(DashboardRoutes.BackupPreview, { + ...response, + type: isEmail ? BackupAccountType.Email : BackupAccountType.Phone, + account: isEmail ? data.email : `+${data.countryCode} ${data.phone}`, + code: data.code, + }), + ) + }, + [isEmail, setError, reset, navigate, updateUser, user], + ) + + return ( + + { + setAccountType(undefined, isEmail ? BackupAccountType.Phone : BackupAccountType.Email) + }}> +
+ +
+
+ +
+
+ {isEmail ? + + : } + setShowAlert(false)}> + + The Mask Network Cloud Backup feature will be deactivated on April 30, 2025. Please use alternative + cloud backup services or local backup solutions. + + + portalContainerRef.current}> + + Continue + + +
+ ) +}) diff --git a/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx b/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx new file mode 100644 index 000000000000..530cd6572f6c --- /dev/null +++ b/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx @@ -0,0 +1,106 @@ +import { Trans, useLingui } from '@lingui/react/macro' +import { PhoneNumberField } from '@masknet/shared' +import { BackupAccountType } from '@masknet/shared-base' +import { CountdownButton, makeStyles, useCustomSnackbar } from '@masknet/theme' +import { Box, TextField } from '@mui/material' +import { memo, useCallback } from 'react' +import { Controller } from 'react-hook-form' +import { UserContext, useLanguage } from '../../../../../shared-ui/index.js' +import { sendCode } from '../../../../utils/api.js' +import { Locale, Scenario } from '../../../../utils/type.js' +import { CloudBackupFormContext } from './CloudBackupFormContext.js' + +const useStyles = makeStyles()((theme) => ({ + send: { + color: theme.palette.maskColor.main, + fontSize: 14, + }, +})) + +export const PhoneForm = memo(function PhoneForm() { + const { t } = useLingui() + const { classes } = useStyles() + const { user } = UserContext.useContainer() + const lang = useLanguage() + const { showSnackbar } = useCustomSnackbar() + + const { + form: { + control, + clearErrors, + watch, + setValue, + formState: { errors }, + }, + } = CloudBackupFormContext.useContainer() + + const [countryCode, phone] = watch(['countryCode', 'phone']) + + const handleSendVerificationCode = useCallback(async () => { + const response = await sendCode({ + account: `+${countryCode}${phone}`, + type: BackupAccountType.Phone, + scenario: user.phone ? Scenario.change : Scenario.create, + locale: lang.includes('zh') ? Locale.zh : Locale.en, + }).catch((error) => { + showSnackbar(error.message, { variant: 'error' }) + }) + + if (response) { + showSnackbar(Verification code sent, { variant: 'success' }) + } + }, [phone, user, lang, countryCode]) + + return ( + + ( + setValue('countryCode', code)} + onFocus={() => clearErrors('phone')} + fullWidth + placeholder={t`Mobile number`} + error={!!errors.phone?.message} + helperText={errors.phone?.message} + /> + )} + /> + ( + clearErrors('code')} + fullWidth + placeholder={t`Phone verification code`} + error={!!errors.code?.message} + helperText={errors.code?.message} + InputProps={{ + disableUnderline: true, + endAdornment: ( + Resend}> + Send + + ), + }} + /> + )} + /> + + ) +}) diff --git a/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx b/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx new file mode 100644 index 000000000000..f036fc163db9 --- /dev/null +++ b/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx @@ -0,0 +1,201 @@ +import { Trans } from '@lingui/react/macro' +import { Icons } from '@masknet/icons' +import { EmptyStatus, formatFileSize } from '@masknet/shared' +import type { BackupAccountType } from '@masknet/shared-base' +import { DashboardRoutes } from '@masknet/shared-base' +import { ActionButton, TextOverflowTooltip, makeStyles } from '@masknet/theme' +import { Box, Button, Portal, Typography } from '@mui/material' +import { format as formatDateTime, fromUnixTime } from 'date-fns' +import { memo, useCallback, useMemo } from 'react' +import { useNavigate, useOutletContext, useSearchParams } from 'react-router-dom' +import { useAsyncFn } from 'react-use' +import { BackupPreviewModal, MergeBackupModal } from '../../../../modals/modals.js' +import { createBackupName, downloadBackup, getFileName, progressDownload } from '../helpers.js' +import type { PortalContainerProps } from '../types.js' + +const useStyles = makeStyles()((theme) => ({ + header: { + display: 'flex', + justifyContent: 'space-between', + alignItems: 'center', + }, + user: { + display: 'flex', + flexDirection: 'column', + gap: theme.spacing(1), + }, + providerName: { + fontWeight: 400, + fontSize: 14, + lineHeight: '18px', + height: 18, + color: theme.palette.maskColor.second, + }, + userAccount: { + fontWeight: 700, + fontSize: 14, + lineHeight: '18px', + height: 18, + color: theme.palette.maskColor.main, + }, + text: { + fontSize: 14, + lineHeight: '18px', + fontWeight: 700, + }, + content: { + borderRadius: 8, + border: `1px solid ${theme.palette.maskColor.line}`, + padding: theme.spacing(2), + marginTop: theme.spacing(3), + display: 'flex', + columnGap: 8, + alignItems: 'center', + }, + container: { + padding: theme.spacing(2), + borderRadius: 8, + border: `1px solid ${theme.palette.maskColor.line}`, + marginTop: theme.spacing(3), + }, + button: { + whiteSpace: 'nowrap', + }, +})) + +export const Component = memo(function CloudBackupPreview() { + const { classes, theme } = useStyles() + const [params] = useSearchParams() + const { portalContainerRef } = useOutletContext() + + const navigate = useNavigate() + + const previewInfo = useMemo(() => { + return { + account: params.get('account'), + downloadLink: params.get('downloadURL'), + abstract: params.get('abstract'), + uploadedAt: params.get('uploadedAt'), + size: params.get('size'), + type: params.get('type'), + code: params.get('code'), + } + }, [params]) + + const [{ loading: mergeLoading }, handleMergeClick] = useAsyncFn(async () => { + if (!previewInfo.downloadLink || !previewInfo.account || !previewInfo.size || !previewInfo.uploadedAt) return + await MergeBackupModal.openAndWaitForClose({ + download: () => progressDownload(previewInfo.downloadLink), + fileName: getFileName(previewInfo.downloadLink) || createBackupName(), + account: previewInfo.account, + size: previewInfo.size, + uploadedAt: previewInfo.uploadedAt, + }) + }, [previewInfo]) + + const handleBackupClick = useCallback(() => { + if (!previewInfo.type || !previewInfo.account || !previewInfo.code) return + BackupPreviewModal.open({ + isUpload: false, + code: previewInfo.code, + abstract: previewInfo.abstract ? previewInfo.abstract : undefined, + type: previewInfo.type as BackupAccountType, + account: previewInfo.account, + }) + }, [previewInfo]) + + return ( + <> + + {previewInfo.downloadLink ? + <> + + + + Mask Network Cloud + + {previewInfo.account} + + + + + + + + + {previewInfo.abstract} + + + + + + {formatFileSize(Number(previewInfo.size))} + + + {formatDateTime( + fromUnixTime(Number(previewInfo.uploadedAt)), + 'yyyy-MM-dd HH:mm', + )} + + + + + + } + color="primary" + variant="roundedContained" + loading={mergeLoading} + onClick={handleMergeClick}> + Merge data to local database + + { + downloadBackup(previewInfo.downloadLink!) + }} + startIcon={} + color="primary" + variant="roundedContained"> + Download + + + + + : + + {previewInfo.account} + navigate(DashboardRoutes.BackupCloud, { replace: true })}> + Switch other account + + + + No backups found + + + } + + {!previewInfo.downloadLink ? + portalContainerRef.current}> + + Back + + + : null} + + ) +}) diff --git a/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/index.tsx b/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/index.tsx new file mode 100644 index 000000000000..11747dd10c30 --- /dev/null +++ b/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/index.tsx @@ -0,0 +1,82 @@ +import { Trans } from '@lingui/react/macro' +import { Icons } from '@masknet/icons' +import { DashboardRoutes } from '@masknet/shared-base' +import { makeStyles } from '@masknet/theme' +import { Box, Typography } from '@mui/material' +import { memo } from 'react' +import { Outlet, useMatch, useNavigate, useOutletContext } from 'react-router-dom' +import type { PortalContainerProps } from '../types.js' +import { CloudBackupFormContext } from './CloudBackupFormContext.js' + +const useStyles = makeStyles()((theme, _, refs) => ({ + container: { + display: 'flex', + flexDirection: 'column', + gap: theme.spacing(2), + }, + providers: { + display: 'flex', + gap: theme.spacing(1.5), + }, + providerName: { + fontWeight: 700, + fontSize: 14, + lineHeight: '18px', + height: 18, + color: theme.palette.maskColor.main, + }, + activeButton: { + backgroundColor: theme.palette.maskColor.input, + }, + toggleButton: { + backgroundColor: theme.palette.maskColor.bottom, + cursor: 'pointer', + boxSizing: 'border-box', + borderRadius: 18, + height: 34, + gap: theme.spacing(1), + border: `1px solid ${theme.palette.maskColor.line}`, + display: 'inline-flex', + padding: theme.spacing(1, 1.5), + [`&.${refs.activeButton}`]: { + backgroundColor: theme.palette.maskColor.input, + }, + }, +})) + +export const Component = memo(function CloudBackup() { + const outletContext = useOutletContext() + const { classes, cx } = useStyles() + + const navigate = useNavigate() + const match = useMatch(DashboardRoutes.BackupCloudGoogleDrive) // MaskBook is index + const isGoogleDrive = !!match + + return ( + + + + + + + + + + ) +}) diff --git a/packages/mask/dashboard/pages/SetupPersona/Backup/LocalBackup.tsx b/packages/mask/dashboard/pages/SetupPersona/Backup/LocalBackup.tsx new file mode 100644 index 000000000000..10d0c10351ca --- /dev/null +++ b/packages/mask/dashboard/pages/SetupPersona/Backup/LocalBackup.tsx @@ -0,0 +1,130 @@ +import Services from '#services' +import { Trans, useLingui } from '@lingui/react/macro' +import { encryptBackup } from '@masknet/backup-format' +import { Icons } from '@masknet/icons' +import { LoadingStatus } from '@masknet/shared' +import { MimeType } from '@masknet/shared-base' +import { encode } from '@msgpack/msgpack' +import { Box, Portal } from '@mui/material' +import { format as formatDateTime } from 'date-fns' +import { memo } from 'react' +import { Controller } from 'react-hook-form' +import { useOutletContext } from 'react-router-dom' +import { useAsyncFn } from 'react-use' +import { UserContext } from '../../../../shared-ui/index.js' +import { PersonasBackupPreview, WalletsBackupPreview } from '../../../components/BackupPreview/index.js' +import PasswordField from '../../../components/PasswordField/index.js' +import { PrimaryButton } from '../../../components/PrimaryButton/index.js' +import { useBackupFormState, type BackupFormInputs } from '../../../hooks/useBackupFormState.js' +import { useBackupPreviewInfo } from '../../../hooks/useBackupPreviewInfo.js' +import type { PortalContainerProps } from './types.js' +import { downloadBackup } from './helpers.js' + +export const Component = memo(function LocalBackup() { + const { portalContainerRef } = useOutletContext() + const { t } = useLingui() + const { user, updateUser } = UserContext.useContainer() + const { + hasPassword, + backupWallets, + setBackupWallets, + formState: { + setError, + control, + handleSubmit, + clearErrors, + formState: { errors, isDirty, isValid }, + }, + } = useBackupFormState() + const { data: previewInfo, isLoading: loading } = useBackupPreviewInfo() + + const [{ loading: downloadLoading }, handleFormSubmit] = useAsyncFn( + async (data: BackupFormInputs) => { + if (backupWallets && hasPassword) { + const verified = await Services.Wallet.verifyPassword(data.paymentPassword || '') + if (!verified) { + setError('paymentPassword', { type: 'custom', message: t`Incorrect Password` }) + return + } + } + const { file } = await Services.Backup.createBackupFile({ + excludeBase: false, + excludeWallet: !backupWallets, + }) + + const encrypted = await encryptBackup(encode(data.backupPassword), encode(file)) + const now = formatDateTime(new Date(), 'yyyy-MM-dd HH:mm') + const blob = new Blob([encrypted], { type: MimeType.Binary }) + const url = URL.createObjectURL(blob) + downloadBackup(url, `mask-network-keystore-backup-${now}.bin`) + + await updateUser({ + localBackupAt: now, + }) + + window.close() + }, + [backupWallets, hasPassword, setError, updateUser, user], + ) + + return ( +
+ {!loading && previewInfo ? + + + + ( + clearErrors()} + sx={{ mb: 2 }} + placeholder={t`Backup Password`} + error={!!errors.backupPassword?.message} + helperText={errors.backupPassword?.message} + /> + )} + name="backupPassword" + /> + + + + {backupWallets ? + ( + clearErrors()} + sx={{ mb: 2 }} + placeholder={t`Payment Password`} + error={!!errors.paymentPassword?.message} + helperText={errors.paymentPassword?.message} + /> + )} + name="paymentPassword" + /> + : null} + + : } + portalContainerRef.current}> + } + size="large" + color="primary" + variant="roundedContained" + loading={downloadLoading} + disabled={!isDirty || !isValid} + onClick={handleSubmit(handleFormSubmit)}> + Download Backup + + + + ) +}) diff --git a/packages/mask/dashboard/pages/SetupPersona/Backup/constants.ts b/packages/mask/dashboard/pages/SetupPersona/Backup/constants.ts new file mode 100644 index 000000000000..293c44bc10a6 --- /dev/null +++ b/packages/mask/dashboard/pages/SetupPersona/Backup/constants.ts @@ -0,0 +1,8 @@ +import { DashboardRoutes } from '@masknet/shared-base' + +export const CloudBackupRoutes: string[] = [ + DashboardRoutes.BackupCloud, + DashboardRoutes.BackupCloudGoogleDrive, + DashboardRoutes.BackupCloudMaskNetwork, + DashboardRoutes.BackupPreview, +] diff --git a/packages/mask/dashboard/pages/SetupPersona/Backup/helpers.tsx b/packages/mask/dashboard/pages/SetupPersona/Backup/helpers.tsx new file mode 100644 index 000000000000..460fdac9e33e --- /dev/null +++ b/packages/mask/dashboard/pages/SetupPersona/Backup/helpers.tsx @@ -0,0 +1,94 @@ +import Services from '#services' +import { t } from '@lingui/core/macro' +import { fetchJSON } from '@masknet/web3-providers/helpers' +import { format as formatDateTime } from 'date-fns' + +interface Options { + code: string + clientId: string + redirectUri: string +} + +interface TokenResponse { + access_token: string + error_description: string +} + +export async function requestGoogleDriveAccessToken(options: Options) { + return fetchJSON('https://oauth2.googleapis.com/token', { + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + body: new URLSearchParams({ + code: options.code, + client_id: options.clientId, + redirect_uri: options.redirectUri, + grant_type: 'authorization_code', + }), + }) +} + +export function downloadBackup(url: string, name?: string) { + const a = document.createElement('a') + a.href = url + if (name) a.download = name + a.click() +} + +export function getGoogleDriveAccessToken() { + return Services.Backup.getAccessToken() +} +export function clearGoogleDriveAccessToken() { + return Services.Backup.clearAccessToken() +} + +export function createBackupName() { + return `mask-network-keystore-backup-${formatDateTime(new Date(), 'yyyy-MM-dd')}.bin` +} + +export function getFileName(url: string) { + try { + const urlObj = new URL(url) + return urlObj.pathname.split('/').pop() + } catch { + return '' + } +} + +/** + * Download general backup file (no need to authenticate) + */ +export async function* progressDownload(request: string | null | (() => Promise), size?: number) { + if (!request) return + const response = + typeof request === 'function' ? + await request() + : await fetch(request, { + method: 'GET', + cache: 'no-store', + }) + + if (!response.ok || response.status !== 200) { + throw new Error(t`The download link is expired`) + } + if (!response.body) return + const reader = response.body.getReader() + const contentLength = response.headers.get('Content-Length') || size + + if (!contentLength || !reader) return + + let received = 0 + const chunks: number[] = [] + while (true) { + const { done, value } = await reader.read() + + if (done || !value) { + yield 100 + break + } + chunks.push(...value) + received += value.length + + yield (received / Number(contentLength)) * 100 + } + return Uint8Array.from(chunks).buffer +} diff --git a/packages/mask/dashboard/pages/SetupPersona/Backup/index.tsx b/packages/mask/dashboard/pages/SetupPersona/Backup/index.tsx new file mode 100644 index 000000000000..6bd737cbb996 --- /dev/null +++ b/packages/mask/dashboard/pages/SetupPersona/Backup/index.tsx @@ -0,0 +1,97 @@ +import { Trans } from '@lingui/react/macro' +import { MaskTabList, makeStyles } from '@masknet/theme' +import { TabContext } from '@mui/lab' +import { Box, Tab, Typography } from '@mui/material' +import { memo, useRef } from 'react' +import { Outlet, useLocation, useNavigate } from 'react-router-dom' +import { CloudBackupRoutes } from './constants.js' +import { StorageType } from './types.js' + +const useStyles = makeStyles()((theme) => ({ + title: { + fontSize: 36, + lineHeight: 1.2, + fontWeight: 700, + }, + description: { + color: theme.palette.maskColor.second, + fontSize: 14, + marginTop: theme.spacing(1.5), + }, + tabContainer: { + border: `1px solid ${theme.palette.maskColor.line}`, + marginTop: theme.spacing(3), + borderRadius: theme.spacing(1, 1, 0, 0), + overflow: 'hidden', + }, + tabList: { + background: + theme.palette.mode === 'light' ? + 'linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 100%), linear-gradient(90deg, rgba(98, 152, 234, 0.2) 1.03%, rgba(98, 152, 234, 0.2) 1.04%, rgba(98, 126, 234, 0.2) 100%)' + : 'linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.06) 100%)', + padding: theme.spacing('14px', 2, 0), + }, + tab: { + fontSize: 16, + fontWeight: 700, + }, + panelContainer: { + padding: theme.spacing(2), + }, + exclaveActions: { + marginTop: 136, + }, +})) + +export const Backup = memo(function Backup() { + const { classes } = useStyles() + + const location = useLocation() + const { pathname } = location + const isCloud = CloudBackupRoutes.includes(pathname) + const tab = isCloud ? StorageType.Cloud : StorageType.Local + const navigate = useNavigate() + + const portalContainerRef = useRef(null) + + return ( + + + Back Up Your Data Your Way + + + + Choose from multiple backup options, now including encrypted storage via your authorized Google + Drive for added security and flexibility. + + + +
+ + { + navigate(value === StorageType.Cloud ? '/setup/backup/cloud' : '/setup/backup/local') + }} + aria-label="Cloud Backup Methods"> + Locale Backup} + value={StorageType.Local} + /> + Cloud Backup} + value={StorageType.Cloud} + /> + + +
+
+ +
+
+ +
+ ) +}) diff --git a/packages/mask/dashboard/pages/SetupPersona/Backup/types.ts b/packages/mask/dashboard/pages/SetupPersona/Backup/types.ts new file mode 100644 index 000000000000..ae301402a683 --- /dev/null +++ b/packages/mask/dashboard/pages/SetupPersona/Backup/types.ts @@ -0,0 +1,8 @@ +export interface PortalContainerProps { + portalContainerRef: React.RefObject +} + +export enum StorageType { + Local = 'local', + Cloud = 'cloud', +} diff --git a/packages/mask/dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx b/packages/mask/dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx index 3166edb410e1..5be0bab4e62f 100644 --- a/packages/mask/dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx @@ -11,6 +11,7 @@ import { useNavigate, useSearchParams } from 'react-router-dom' import { useAsyncFn } from 'react-use' import { SetupFrameController } from '../../../components/SetupFrame/index.js' import { BackupPreviewModal, ConfirmDialog, MergeBackupModal } from '../../../modals/modals.js' +import { createBackupName, getFileName, progressDownload } from '../Backup/helpers.js' const useStyles = makeStyles()((theme) => ({ title: { @@ -78,20 +79,18 @@ export const Component = memo(function CloudBackupPreview() { ) return await MergeBackupModal.openAndWaitForClose({ - downloadLink: previewInfo.downloadLink, + download: () => progressDownload(previewInfo.downloadLink), + fileName: getFileName(previewInfo.downloadLink) || createBackupName(), account: previewInfo.account, size: previewInfo.size, uploadedAt: previewInfo.uploadedAt, - code: previewInfo.code, - abstract: previewInfo.abstract ? previewInfo.abstract : undefined, - type: previewInfo.type as BackupAccountType, }) }, [previewInfo]) const handleBackupClick = useCallback(() => { if (!previewInfo.type || !previewInfo.account || !previewInfo.code) return BackupPreviewModal.open({ - isOverwrite: false, + isUpload: false, code: previewInfo.code, abstract: previewInfo.abstract ? previewInfo.abstract : undefined, type: previewInfo.type as BackupAccountType, @@ -113,7 +112,7 @@ export const Component = memo(function CloudBackupPreview() { if (!previewInfo.type || !previewInfo.account || !previewInfo.code) return BackupPreviewModal.open({ - isOverwrite: true, + isUpload: true, code: previewInfo.code, abstract: previewInfo.abstract ? previewInfo.abstract : undefined, type: previewInfo.type as BackupAccountType, @@ -127,10 +126,13 @@ export const Component = memo(function CloudBackupPreview() { <> - Welcome to Mask Cloud Services + Back Up Your Data Your Way - Please select the appropriate method to restore your personal data. + + Choose from multiple backup options, now including encrypted storage via your authorized Google + Drive for added security and flexibility. + {previewInfo.downloadLink ? <> diff --git a/packages/mask/dashboard/pages/SetupPersona/LocalBackup/index.tsx b/packages/mask/dashboard/pages/SetupPersona/LocalBackup/index.tsx index e8f46ca65270..c4fe949a69ba 100644 --- a/packages/mask/dashboard/pages/SetupPersona/LocalBackup/index.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/LocalBackup/index.tsx @@ -1,22 +1,23 @@ +import Services from '#services' +import { Trans, useLingui } from '@lingui/react/macro' +import { encryptBackup } from '@masknet/backup-format' +import { Icons } from '@masknet/icons' +import { LoadingStatus } from '@masknet/shared' +import { MimeType } from '@masknet/shared-base' import { makeStyles } from '@masknet/theme' +import { encode } from '@msgpack/msgpack' import { Box, Typography } from '@mui/material' +import { format as formatDateTime } from 'date-fns' import { memo } from 'react' +import { Controller } from 'react-hook-form' import { useAsyncFn } from 'react-use' -import Services from '#services' -import { LoadingStatus } from '@masknet/shared' -import PasswordField from '../../../components/PasswordField/index.js' +import { UserContext } from '../../../../shared-ui/index.js' import { PersonasBackupPreview, WalletsBackupPreview } from '../../../components/BackupPreview/index.js' -import { Controller } from 'react-hook-form' -import { SetupFrameController } from '../../../components/SetupFrame/index.js' +import PasswordField from '../../../components/PasswordField/index.js' import { PrimaryButton } from '../../../components/PrimaryButton/index.js' -import { Icons } from '@masknet/icons' -import { encryptBackup } from '@masknet/backup-format' -import { encode } from '@msgpack/msgpack' -import { format as formatDateTime } from 'date-fns' -import { MimeType } from '@masknet/shared-base' +import { SetupFrameController } from '../../../components/SetupFrame/index.js' import { useBackupFormState, type BackupFormInputs } from '../../../hooks/useBackupFormState.js' -import { UserContext } from '../../../../shared-ui/index.js' -import { Trans, useLingui } from '@lingui/react/macro' +import { useBackupPreviewInfo } from '../../../hooks/useBackupPreviewInfo.js' const useStyles = makeStyles()((theme) => ({ title: { @@ -38,8 +39,6 @@ export const Component = memo(function LocalBackup() { const { user, updateUser } = UserContext.useContainer() const { hasPassword, - previewInfo, - loading, backupWallets, setBackupWallets, formState: { @@ -50,6 +49,7 @@ export const Component = memo(function LocalBackup() { formState: { errors, isDirty, isValid }, }, } = useBackupFormState() + const { data: previewInfo, isLoading: loading } = useBackupPreviewInfo() const [{ loading: downloadLoading }, handleFormSubmit] = useAsyncFn( async (data: BackupFormInputs) => { diff --git a/packages/mask/dashboard/pages/SetupPersona/index.tsx b/packages/mask/dashboard/pages/SetupPersona/index.tsx index 46a9612124ca..aca0fa84e8bf 100644 --- a/packages/mask/dashboard/pages/SetupPersona/index.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/index.tsx @@ -1,19 +1,58 @@ import { useMatch, type RouteObject } from 'react-router-dom' -import { DashboardRoutes, relativeRouteOf } from '@masknet/shared-base' +import { DashboardRoutes, relativeRoute as rr, relativeRouteOf } from '@masknet/shared-base' import { SetupFrame } from '../../components/SetupFrame/index.js' +import { Backup } from './Backup/index.js' const r = relativeRouteOf(DashboardRoutes.Setup) +const Routes = DashboardRoutes export const personaRoutes: RouteObject[] = [ - { path: r(DashboardRoutes.Welcome), lazy: () => import('./Welcome/index.js') }, - { path: r(DashboardRoutes.Permissions), lazy: () => import('./Permissions/index.js') }, - { path: r(DashboardRoutes.PermissionsOnboarding), lazy: () => import('./PermissionOnboarding/index.js') }, - { path: r(DashboardRoutes.SignUpPersona), lazy: () => import('./SignUp/index.js') }, - { path: r(DashboardRoutes.RecoveryPersona), lazy: () => import('./Recovery/index.js') }, - { path: r(DashboardRoutes.SignUpPersonaMnemonic), lazy: () => import('./Mnemonic/index.js') }, - { path: r(DashboardRoutes.SignUpPersonaOnboarding), lazy: () => import('./Onboarding/index.js') }, - { path: r(DashboardRoutes.LocalBackup), lazy: () => import('./LocalBackup/index.js') }, - { path: r(DashboardRoutes.CloudBackup), lazy: () => import('./CloudBackup/index.js') }, - { path: r(DashboardRoutes.CloudBackupPreview), lazy: () => import('./CloudBackupPreview/index.js') }, + { path: r(Routes.Welcome), lazy: () => import('./Welcome/index.js') }, + { path: r(Routes.Permissions), lazy: () => import('./Permissions/index.js') }, + { path: r(Routes.PermissionsOnboarding), lazy: () => import('./PermissionOnboarding/index.js') }, + { path: r(Routes.SignUpPersona), lazy: () => import('./SignUp/index.js') }, + { path: r(Routes.RecoveryPersona), lazy: () => import('./Recovery/index.js') }, + { path: r(Routes.SignUpPersonaMnemonic), lazy: () => import('./Mnemonic/index.js') }, + { path: r(Routes.SignUpPersonaOnboarding), lazy: () => import('./Onboarding/index.js') }, + { + path: r(Routes.Backup), + element: , + children: [ + { + index: true, + lazy: () => import('./Backup/LocalBackup.js'), + }, + { + path: rr(Routes.Backup, Routes.BackupLocal), + lazy: () => import('./Backup/LocalBackup.js'), + index: true, + }, + { + path: rr(Routes.Backup, Routes.BackupCloud), + lazy: () => import('./Backup/CloudBackup/index.js'), + children: [ + { + index: true, + lazy: () => import('./Backup/CloudBackup/MaskNetworkBackup.js'), + }, + { + path: rr(Routes.BackupCloud, Routes.BackupCloudMaskNetwork), + lazy: () => import('./Backup/CloudBackup/MaskNetworkBackup.js'), + }, + { + path: rr(Routes.BackupCloud, Routes.BackupCloudGoogleDrive), + lazy: () => import('./Backup/CloudBackup/GoogleDriveBackup.js'), + }, + { + path: rr(Routes.BackupCloud, Routes.BackupPreview), + lazy: () => import('./Backup/CloudBackup/Preview.js'), + }, + ], + }, + ], + }, + { path: r(Routes.LocalBackup), lazy: () => import('./LocalBackup/index.js') }, + { path: r(Routes.CloudBackup), lazy: () => import('./CloudBackup/index.js') }, + { path: r(Routes.CloudBackupPreview), lazy: () => import('./CloudBackupPreview/index.js') }, ] export function PersonaFrame() { const matchPersonaOnboarding = useMatch(DashboardRoutes.SignUpPersonaOnboarding) diff --git a/packages/mask/dashboard/utils/regexp.ts b/packages/mask/dashboard/utils/regexp.ts index 6dc401584d23..e0dbc6c212a3 100644 --- a/packages/mask/dashboard/utils/regexp.ts +++ b/packages/mask/dashboard/utils/regexp.ts @@ -1,5 +1,8 @@ export const passwordRegexp = /^(?=.{8,20}$)(?=.*[A-Z])(?=.*[a-z])(?=.*\d)(?=.*[^\dA-Za-z]).*/ +/** + * @deprecated use z.string().email() instead + */ export const emailRegexp = /^([\w!#$%&*+./=?^`{|}~’-]{1,64}@([\dA-Za-z-]{1,255}.[\dA-Za-z-]{2,}))$/ export const phoneRegexp = /^(\+?([ .-])?\d{1,2}([ .-])?)?(\(?\d{3}\)?|\d{3})([ .-])?(\d{3}([ .-])?\d{4})/ diff --git a/packages/mask/popups/pages/Settings/index.tsx b/packages/mask/popups/pages/Settings/index.tsx index 3b21d61efe98..fa0ba35994b1 100644 --- a/packages/mask/popups/pages/Settings/index.tsx +++ b/packages/mask/popups/pages/Settings/index.tsx @@ -245,7 +245,7 @@ export const Component = memo(function SettingsPage() { if (!user.backupPassword) { modalNavigate(PopupModalRoutes.SetBackupPassword) } else { - handleOpenDashboard(DashboardRoutes.CloudBackup) + handleOpenDashboard(DashboardRoutes.BackupCloud) } }}> ) => { + async (userConfig: Partial) => { await PersistentStorages.Settings.storage.backupConfig.setValue({ ...user, - ...obj, - backupPassword: obj.backupPassword ? btoa(obj.backupPassword) : user.backupPassword, + ...userConfig, + backupPassword: userConfig.backupPassword ? btoa(userConfig.backupPassword) : user.backupPassword, }) }, [user], @@ -30,7 +30,7 @@ function useUserContext() { // Maybe `backupPassword` is not base64-encoded. return user } - }, [user, updateUser]) + }, [user]) return { user: result, diff --git a/packages/mask/shared-ui/initialization/fetch.ts b/packages/mask/shared-ui/initialization/fetch.ts index 393375f9cc78..64e3073e0560 100644 --- a/packages/mask/shared-ui/initialization/fetch.ts +++ b/packages/mask/shared-ui/initialization/fetch.ts @@ -51,9 +51,14 @@ function fetchingInsResource(target: URL) { return location.origin.endsWith('instagram.com') && target.origin.match(/(fbcdn\.net|cdninstagram\.com)$/) } +function fetchingGoogleDriveResource(target: URL) { + return target.origin === 'https://www.googleapis.com' +} + function canAccessAsContent(url: string) { const target = new URL(url, location.href) - if (fetchingTwitterResource(target) || fetchingInsResource(target)) return true + if (fetchingTwitterResource(target) || fetchingInsResource(target) || fetchingGoogleDriveResource(target)) + return true // eg: https://maskbook-backup-server-staging.s3.ap-east-1.amazonaws.com/backups/xxx.zip // The content-length needs to be used in the client request in order to realize the progress of the download. diff --git a/packages/mask/shared-ui/initialization/storage.ts b/packages/mask/shared-ui/initialization/storage.ts index d3bc387f97a8..5b2563a0a605 100644 --- a/packages/mask/shared-ui/initialization/storage.ts +++ b/packages/mask/shared-ui/initialization/storage.ts @@ -25,3 +25,5 @@ const indexedDB: KVStorageBackend = { } setupMaskKVStorageBackend(indexedDB, memory) setupLegacySettingsAtNonBackground(Services.Settings.getLegacySettingsInitialValue) + +indexedDB diff --git a/packages/mask/shared-ui/locale/en-US.json b/packages/mask/shared-ui/locale/en-US.json index 7cc6ffaef207..69b623c7f48d 100644 --- a/packages/mask/shared-ui/locale/en-US.json +++ b/packages/mask/shared-ui/locale/en-US.json @@ -61,6 +61,7 @@ "5YfW3S": ["Add an encrypted comment..."], "aTzTyw": ["Add Assets"], "M0FgOk": ["Add Contact"], + "FAKSZG": ["Add google Drive"], "LP+1Z7": ["Add Network"], "68m9Nl": ["Add new address to an existing group"], "1LkMSp": ["Add Suggested Token"], @@ -100,6 +101,8 @@ "7QptC5": ["Auto-lock Time"], "nTFx7o": ["Avatar set successfully"], "iH8pgl": ["Back"], + "npsHM5": ["Back Up to Google Drive"], + "V+1pjj": ["Back Up Your Data Your Way"], "rLgPvm": ["Backup"], "h7+V7K": ["Backup & Recovery"], "QrHM/A": ["Backup downloaded and merged to local successfully."], @@ -113,6 +116,7 @@ ], "hUF4dG": ["Backup password set successfully"], "UtKGok": ["Backup Persona"], + "+m7x4e": ["Backup Successful"], "7Ry254": ["Backup to Mask Cloud Service"], "6IHgRq": ["Backup to the Cloud"], "QQPCqQ": ["Backup Wallet"], @@ -140,6 +144,9 @@ "tcHpvG": ["Change Owner"], "fDP2k4": ["Change Payment Password"], "IXbRbM": ["Choose another wallet"], + "lU6uRb": [ + "Choose from multiple backup options, now including encrypted storage via your authorized Google Drive for added security and flexibility." + ], "xH6cn+": ["Choose Token"], "+adBn3": ["Chrome - external extension"], "EsKgLS": ["Click here to have a quick start."], @@ -211,6 +218,7 @@ "pvnfJD": ["Dark"], "Sp/me1": ["data"], "HKH+W+": ["Data"], + "K8jCIB": ["Data backed up successfully!"], "3B4jmY": ["Data correlation"], "rAcOY1": [ "Data merged from Mask Cloud Service to local successfully. Re-enter your password to encrypt and upload the new backup to Mask Cloud Service." @@ -286,7 +294,9 @@ "SLEDBF": ["Failed to add the wallet, please try again."], "09vHB+": ["Failed to decrypt."], "jK7nvW": ["Failed to disconnect wallet"], + "9hzYBR": ["Failed to download and merge the backup: ", ["0"]], "0tkvsz": ["Failed to download and merge the backup."], + "etATpN": ["Failed to login: ", ["0"]], "mrAv9J": ["Failed to save network"], "ZsjtYe": ["Failed to set Avatar."], "RWoEqV": ["Failed to transfer token: ", ["message"]], @@ -323,6 +333,7 @@ "tdZPpe": ["Generating your"], "CiU2m/": ["Generating your "], "2p7WMm": ["Give permission to access <0/> your ", ["0"], "?"], + "w9Xmw/": ["Google Drive"], "76gPWk": ["Got it"], "HqiAyF": ["Gwei"], "pu3rTn": ["GWEI"], @@ -354,6 +365,7 @@ "fza4cg": ["Import Wallets"], "HvDfH/": ["Imported"], "m3XvO+": ["Imported Wallets"], + "ANk/Zy": ["Incorrect Backup Password"], "a23gJr": ["Incorrect backup password."], "bapItf": ["Incorrect Backup Password."], "bassMa": ["Incorrect cloud backup password, please try again."], @@ -394,9 +406,11 @@ "jygqM9": ["Loading account information..."], "EBC6hj": ["Local Backup"], "shPV5O": ["Local persona or wallet only"], + "crVIc7": ["Locale Backup"], "KGHnSc": ["Lock Wallet"], "FgAxTj": ["Log out"], "kC3Q3d": ["Login to Mask Cloud"], + "nOhz3x": ["Logout"], "NkgvWN": ["Logout failed"], "o4Iu2W": ["Logout successfully"], "nTWWCZ": ["Low"], @@ -406,6 +420,7 @@ ], "lET9my": ["Mask needs the following permissions"], "siroPf": ["Mask Network"], + "jhoAzY": ["Mask Network Cloud"], "lWOC+h": ["Mask Network requires you to authorize the following websites before using it."], "HsoakN": ["masknetwork"], "CK1KXz": ["Max"], @@ -422,7 +437,9 @@ "sQJ3RN": ["Max priority fee is too low for network conditions."], "ITBQO3": ["Max priority fee must be greater than 0 GWEI"], "agPptk": ["Medium"], + "lPsa94": ["Merge Completed"], "RH8jSA": ["Merge data to local database"], + "E6YUtc": ["Merge to Browser"], "QTomF0": ["Merge to local"], "xDAtGP": ["Message"], "pGElS5": ["Mnemonic"], @@ -655,6 +672,9 @@ "VdhBp2": ["The chainID is not equal to the currently connected one."], "h3Vpnw": ["The code is incorrect."], "7w1rTm": ["The download link is expired"], + "oYkran": [ + "The Mask Network Cloud Backup feature will be deactivated on April 30, 2025. Please use alternative cloud backup services or local backup solutions." + ], "o+zDNQ": ["The mnemonic word has been copied, please keep it in a safe place."], "yRuvmU": ["The mnemonic words has been copied, please keep it in a safe place."], "thX7xs": [ @@ -793,6 +813,7 @@ "m74yjp": ["Welcome to Mask Cloud Services"], "hEpXzO": ["Welcome to Mask Network"], "fFYJ8f": ["Welcome to use Mask Network"], + "OLUEnY": ["when you click Add Google Drive button,you will be forwarded to Google authorization pages."], "Qbo7Ev": ["Write down mnemonic words"], "f5AidZ": ["Write down recovery phrase"], "yGyJ1l": [ @@ -810,6 +831,7 @@ "FnQek5": [ "Your connection to this site is not encrypted which can be modified by a hostile third party, we strongly suggest you reject this request." ], + "UDKbPj": ["Your file has been successfully merged into the browser data."], "Q68Nuc": [ "Your payment password encrypts wallet data and is needed to unlocking the wallet, transaction confirmations and signing. The password is never stored, and there is no way to recover it if you forget it." ], diff --git a/packages/mask/shared-ui/locale/en-US.po b/packages/mask/shared-ui/locale/en-US.po index 1daa31d66fa2..197632f803e1 100644 --- a/packages/mask/shared-ui/locale/en-US.po +++ b/packages/mask/shared-ui/locale/en-US.po @@ -157,6 +157,10 @@ msgstr "" msgid "Add Contact" msgstr "" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +msgid "Add google Drive" +msgstr "" + #: popups/pages/Wallet/NetworkManagement/index.tsx #: popups/pages/Wallet/EditNetwork/index.tsx msgid "Add Network" @@ -300,13 +304,25 @@ msgid "Avatar set successfully" msgstr "" #: content-script/components/shared/SelectRecipients/SelectRecipientsDialog.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx #: dashboard/pages/CreateMaskWallet/CreateMnemonic/index.tsx #: popups/pages/Personas/ExportPrivateKey/index.tsx #: popups/pages/Personas/AccountDetail/UI.tsx msgid "Back" msgstr "" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +msgid "Back Up to Google Drive" +msgstr "" + #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/index.tsx +msgid "Back Up Your Data Your Way" +msgstr "" + +#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Personas/Logout/index.tsx #: popups/modals/SwitchPersonaModal/index.tsx msgid "Backup" @@ -317,16 +333,16 @@ msgid "Backup & Recovery" msgstr "" #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Backup downloaded and merged to local successfully." -msgstr "" +#~ msgid "Backup downloaded and merged to local successfully." +#~ msgstr "" #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx msgid "Backup Failed" msgstr "" #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx -msgid "Backup is saved to Mask Cloud Service." -msgstr "" +#~ msgid "Backup is saved to Mask Cloud Service." +#~ msgstr "" #. placeholder {0}: user.localBackupAt #. placeholder {0}: user.cloudBackupAt @@ -341,6 +357,7 @@ msgid "Backup password" msgstr "" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Settings/index.tsx @@ -363,10 +380,14 @@ msgstr "" msgid "Backup Persona" msgstr "" -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Backup to Mask Cloud Service" +#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx +msgid "Backup Successful" msgstr "" +#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +#~ msgid "Backup to Mask Cloud Service" +#~ msgstr "" + #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx msgid "Backup to the Cloud" msgstr "" @@ -505,6 +526,11 @@ msgstr "" msgid "Choose another wallet" msgstr "" +#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/index.tsx +msgid "Choose from multiple backup options, now including encrypted storage via your authorized Google Drive for added security and flexibility." +msgstr "" + #: popups/modals/ChooseToken/index.tsx msgid "Choose Token" msgstr "" @@ -530,6 +556,7 @@ msgid "Close" msgstr "" #: dashboard/pages/SetupPersona/Recovery/index.tsx +#: dashboard/pages/SetupPersona/Backup/index.tsx #: dashboard/components/Restore/ConfirmSynchronizePasswordDialog.tsx #: popups/pages/Settings/index.tsx msgid "Cloud Backup" @@ -602,8 +629,6 @@ msgstr "" msgid "Confirm to hide {name}? You can redisplay it by re-adding this NFT at any time." msgstr "" -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Personas/ConnectWallet/index.tsx msgid "Congratulations" msgstr "" @@ -706,6 +731,7 @@ msgstr "" #: dashboard/pages/SetupPersona/SignUp/index.tsx #: dashboard/pages/SetupPersona/Mnemonic/index.tsx #: dashboard/pages/SetupPersona/CloudBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx #: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx #: dashboard/pages/CreateMaskWallet/AddDeriveWallet/index.tsx #: dashboard/components/Restore/RestoreWalletFromLocal.tsx @@ -832,13 +858,17 @@ msgstr "" msgid "Data" msgstr "" +#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx +msgid "Data backed up successfully!" +msgstr "" + #: popups/pages/Settings/index.tsx msgid "Data correlation" msgstr "" #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Data merged from Mask Cloud Service to local successfully. Re-enter your password to encrypt and upload the new backup to Mask Cloud Service." -msgstr "" +#~ msgid "Data merged from Mask Cloud Service to local successfully. Re-enter your password to encrypt and upload the new backup to Mask Cloud Service." +#~ msgstr "" #: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx #: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx @@ -946,14 +976,17 @@ msgid "Done" msgstr "" #: content-script/components/InjectedComponents/AutoPasteFailedDialog.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx msgid "Download" msgstr "" #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Download backup" -msgstr "" +#~ msgid "Download backup" +#~ msgstr "" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx msgid "Download Backup" msgstr "" @@ -983,11 +1016,14 @@ msgid "eg: X accounts, persona public keys, wallet addresses or ENS" msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx #: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx msgid "Email" msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx #: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx msgid "Email verification code" msgstr "" @@ -1113,8 +1149,18 @@ msgstr "" msgid "Failed to disconnect wallet" msgstr "" +#. placeholder {0}: (err as Error).message +#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +msgid "Failed to download and merge the backup: {0}" +msgstr "" + #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Failed to download and merge the backup." +#~ msgid "Failed to download and merge the backup." +#~ msgstr "" + +#. placeholder {0}: (err as Error).message +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +msgid "Failed to login: {0}" msgstr "" #: popups/pages/Wallet/EditNetwork/index.tsx @@ -1274,6 +1320,11 @@ msgstr "" msgid "Give permission to access <0/> your {0}?" msgstr "" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +msgid "Google Drive" +msgstr "" + #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx msgid "Got it" msgstr "" @@ -1384,6 +1435,10 @@ msgstr "" msgid "Imported Wallets" msgstr "" +#: dashboard/hooks/useBackupFormState.ts +msgid "Incorrect Backup Password" +msgstr "" + #: popups/modals/VerifyBackupPasswordModal/index.tsx #: popups/modals/ChangeBackupPasswordModal/index.tsx msgid "Incorrect backup password." @@ -1413,6 +1468,7 @@ msgid "Incorrect password" msgstr "" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: dashboard/hooks/useBackupFormState.ts #: dashboard/hooks/useBackupFormState.ts @@ -1420,7 +1476,6 @@ msgstr "" #: dashboard/hooks/useBackupFormState.ts #: dashboard/hooks/useBackupFormState.ts #: dashboard/hooks/useBackupFormState.ts -#: dashboard/hooks/useBackupFormState.ts msgid "Incorrect Password" msgstr "" @@ -1469,6 +1524,8 @@ msgid "Invalid Block Explorer URL." msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx msgid "Invalid email address format." msgstr "" @@ -1571,6 +1628,10 @@ msgstr "" msgid "Local persona or wallet only" msgstr "" +#: dashboard/pages/SetupPersona/Backup/index.tsx +msgid "Locale Backup" +msgstr "" + #: popups/pages/Wallet/SwitchWallet/index.tsx msgid "Lock Wallet" msgstr "" @@ -1585,6 +1646,11 @@ msgstr "" msgid "Login to Mask Cloud" msgstr "" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +msgid "Logout" +msgstr "" + #: popups/pages/Personas/Logout/index.tsx msgid "Logout failed" msgstr "" @@ -1613,9 +1679,14 @@ msgstr "" #: content-script/components/InjectedComponents/ToolboxUnstyled.tsx #: content-script/components/InjectedComponents/PostDialogHint.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/index.tsx msgid "Mask Network" msgstr "" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +msgid "Mask Network Cloud" +msgstr "" + #: content-script/components/InjectedComponents/PermissionBoundary.tsx msgid "Mask Network requires you to authorize the following websites before using it." msgstr "" @@ -1687,16 +1758,25 @@ msgstr "" msgid "Medium" msgstr "" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +msgid "Merge Completed" +msgstr "" + +#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Merge data to local database" msgstr "" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Merge to local" +msgid "Merge to Browser" msgstr "" +#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +#~ msgid "Merge to local" +#~ msgstr "" + #: popups/components/SignRequestInfo/index.tsx msgid "Message" msgstr "" @@ -1711,10 +1791,12 @@ msgid "Mnemonic word" msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx msgid "Mobile" msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx msgid "Mobile number" msgstr "" @@ -1832,6 +1914,7 @@ msgid "No back up" msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx msgid "No backups found" msgstr "" @@ -1944,7 +2027,6 @@ msgid "Other social networking platforms, such as <0>Instagram, <1>Facebook, msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx msgid "Overwrite Backup" msgstr "" @@ -1963,6 +2045,7 @@ msgid "Paste manually" msgstr "" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Wallet/SetPaymentPassword/index.tsx #: popups/modals/WalletRemoveModal/index.tsx @@ -2044,6 +2127,7 @@ msgid "Personas" msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx msgid "Phone verification code" msgstr "" @@ -2099,7 +2183,6 @@ msgstr "" #: dashboard/pages/SetupPersona/Recovery/index.tsx #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx msgid "Please select the appropriate method to restore your personal data." msgstr "" @@ -2294,6 +2377,8 @@ msgstr "" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx msgid "Resend" msgstr "" @@ -2408,6 +2493,8 @@ msgstr "" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx #: popups/pages/Wallet/components/ActivityList/ActivityItem.tsx #: popups/pages/Wallet/components/ActionGroup/index.tsx #: popups/pages/Wallet/Transfer/index.tsx @@ -2611,6 +2698,7 @@ msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx msgid "Switch other account" msgstr "" @@ -2648,15 +2736,22 @@ msgid "The chainID is not equal to the currently connected one." msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts +#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx #: dashboard/contexts/CloudBackupFormContext.tsx msgid "The code is incorrect." msgstr "" -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +#: dashboard/pages/SetupPersona/Backup/helpers.tsx msgid "The download link is expired" msgstr "" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx +msgid "The Mask Network Cloud Backup feature will be deactivated on April 30, 2025. Please use alternative cloud backup services or local backup solutions." +msgstr "" + #: dashboard/pages/CreateMaskWallet/CreateMnemonic/index.tsx msgid "The mnemonic word has been copied, please keep it in a safe place." msgstr "" @@ -2695,6 +2790,7 @@ msgstr "" msgid "The persona name already exists." msgstr "" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx msgid "The phone number is incorrect." msgstr "" @@ -2981,6 +3077,8 @@ msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx msgid "Verification code sent" msgstr "" @@ -3091,8 +3189,8 @@ msgid "Welcome Back" msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -msgid "Welcome to Mask Cloud Services" -msgstr "" +#~ msgid "Welcome to Mask Cloud Services" +#~ msgstr "" #: popups/pages/Personas/Home/UI.tsx msgid "Welcome to Mask Network" @@ -3102,6 +3200,10 @@ msgstr "" msgid "Welcome to use Mask Network" msgstr "" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +msgid "when you click Add Google Drive button,you will be forwarded to Google authorization pages." +msgstr "" + #: popups/pages/Wallet/ExportPrivateKey/index.tsx msgid "Write down mnemonic words" msgstr "" @@ -3115,8 +3217,8 @@ msgid "You could check the verification result on Mask Pop-up after few minutes. msgstr "" #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx -msgid "You have backed up your data." -msgstr "" +#~ msgid "You have backed up your data." +#~ msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #~ msgid "You have recovered" @@ -3148,6 +3250,10 @@ msgstr "" msgid "Your connection to this site is not encrypted which can be modified by a hostile third party, we strongly suggest you reject this request." msgstr "" +#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +msgid "Your file has been successfully merged into the browser data." +msgstr "" + #: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx msgid "Your payment password encrypts wallet data and is needed to unlocking the wallet, transaction confirmations and signing. The password is never stored, and there is no way to recover it if you forget it." msgstr "" diff --git a/packages/mask/shared-ui/locale/ja-JP.json b/packages/mask/shared-ui/locale/ja-JP.json index 30f542f10f27..11f6c207f7d0 100644 --- a/packages/mask/shared-ui/locale/ja-JP.json +++ b/packages/mask/shared-ui/locale/ja-JP.json @@ -61,6 +61,7 @@ "5YfW3S": ["Add an encrypted comment..."], "aTzTyw": ["資産を追加"], "M0FgOk": ["連絡先を追加する"], + "FAKSZG": ["Add google Drive"], "LP+1Z7": ["ネットワークを追加"], "68m9Nl": ["既存のグループに新しいアドレスを追加"], "1LkMSp": ["提案されたトークンを追加"], @@ -100,6 +101,8 @@ "7QptC5": ["自動ロック時間"], "nTFx7o": ["アバターを設定しました"], "iH8pgl": ["Back"], + "npsHM5": ["Back Up to Google Drive"], + "V+1pjj": ["Back Up Your Data Your Way"], "rLgPvm": ["バックアップ"], "h7+V7K": ["バックアップと復元"], "QrHM/A": ["バックアップがダウンロードされ、ローカルに正常に統合されました。"], @@ -111,6 +114,7 @@ "ERYJcj": ["バックアップパスワードは、大文字、小文字、特殊文字および数字を含む8-20文字でなければなりません。"], "hUF4dG": ["バックアップパスワードの設定が完了しました"], "UtKGok": ["ペルソナをバックアップする"], + "+m7x4e": ["Backup Successful"], "7Ry254": ["マスククラウドサービスにバックアップ"], "6IHgRq": ["Backup to the Cloud"], "QQPCqQ": ["ウォレットをバックアップする"], @@ -138,6 +142,9 @@ "tcHpvG": ["所有者変更"], "fDP2k4": ["支払いパスワードを変更する"], "IXbRbM": ["他のウォレットを選択してください"], + "lU6uRb": [ + "Choose from multiple backup options, now including encrypted storage via your authorized Google Drive for added security and flexibility." + ], "xH6cn+": ["トークンを選択"], "+adBn3": ["Chrome - external extension"], "EsKgLS": ["ここをクリックしてクイックスタートを切りましょう。"], @@ -209,6 +216,7 @@ "pvnfJD": ["ダーク"], "Sp/me1": ["データ"], "HKH+W+": ["データ"], + "K8jCIB": ["Data backed up successfully!"], "3B4jmY": ["データの相関値"], "rAcOY1": [ "Data merged from Mask Cloud Service to local successfully. Re-enter your password to encrypt and upload the new backup to Mask Cloud Service." @@ -284,7 +292,9 @@ "SLEDBF": ["ウォレットを追加できませんでした。もう一度やり直してください。"], "09vHB+": ["Failed to decrypt."], "jK7nvW": ["Failed to disconnect wallet"], + "9hzYBR": ["Failed to download and merge the backup: ", ["0"]], "0tkvsz": ["Failed to download and merge the backup."], + "etATpN": ["Failed to login: ", ["0"]], "mrAv9J": ["ネットワークを保存できませんでした"], "ZsjtYe": ["アバターを設定できませんでした。"], "RWoEqV": ["Failed to transfer token: ", ["message"]], @@ -321,6 +331,7 @@ "tdZPpe": ["Generating your"], "CiU2m/": ["Generating your "], "2p7WMm": ["Give permission to access <0/> your ", ["0"], "?"], + "w9Xmw/": ["Google Drive"], "76gPWk": ["了解"], "HqiAyF": ["Gwei(グワイ)"], "pu3rTn": ["GWEI"], @@ -352,6 +363,7 @@ "fza4cg": ["ウォレットをインポート"], "HvDfH/": ["インポートされました"], "m3XvO+": ["インポートされたウォレット"], + "ANk/Zy": ["Incorrect Backup Password"], "a23gJr": ["バックアップパスワードが正しくありません。"], "bapItf": ["バックアップパスワードが正しくありません。"], "bassMa": ["クラウドバックアップのパスワードが正しくありません。もう一度やり直してください。"], @@ -392,9 +404,11 @@ "jygqM9": ["Loading account information..."], "EBC6hj": ["ローカルバックアップ"], "shPV5O": ["ローカルペルソナまたはウォレットのみ"], + "crVIc7": ["Locale Backup"], "KGHnSc": ["ウォレットをロックする"], "FgAxTj": ["ログアウト"], "kC3Q3d": ["Login to Mask Cloud"], + "nOhz3x": ["Logout"], "NkgvWN": ["ログアウトに失敗しました。"], "o4Iu2W": ["ログアウト完了"], "nTWWCZ": ["低い"], @@ -404,6 +418,7 @@ ], "lET9my": ["マスクには次の権限が必要です"], "siroPf": ["Mask Network"], + "jhoAzY": ["Mask Network Cloud"], "lWOC+h": ["Mask Network requires you to authorize the following websites before using it."], "HsoakN": ["masknetwork"], "CK1KXz": ["最大"], @@ -420,7 +435,9 @@ "sQJ3RN": ["最大優先料金がネットワーク状況に対して低すぎます。"], "ITBQO3": ["最大優先手数料は0GWEIより大きくなければなりません"], "agPptk": ["中間"], + "lPsa94": ["Merge Completed"], "RH8jSA": ["ローカルデータベースにデータを統合"], + "E6YUtc": ["Merge to Browser"], "QTomF0": ["ローカルに統合"], "xDAtGP": ["メッセージ"], "pGElS5": ["ニーモニック"], @@ -653,6 +670,9 @@ "VdhBp2": ["chainIDは現在接続されているものと等しくありません。"], "h3Vpnw": ["このコードは正しくありません"], "7w1rTm": ["The download link is expired"], + "oYkran": [ + "The Mask Network Cloud Backup feature will be deactivated on April 30, 2025. Please use alternative cloud backup services or local backup solutions." + ], "o+zDNQ": ["The mnemonic word has been copied, please keep it in a safe place."], "yRuvmU": ["The mnemonic words has been copied, please keep it in a safe place."], "thX7xs": [ @@ -793,6 +813,7 @@ "m74yjp": ["マスククラウドサービスへようこそ"], "hEpXzO": ["Mask Networkへようこそ"], "fFYJ8f": ["Mask Networkへようこそ"], + "OLUEnY": ["when you click Add Google Drive button,you will be forwarded to Google authorization pages."], "Qbo7Ev": ["ニーモニックワードを書き留めてください"], "f5AidZ": ["Write down recovery phrase"], "yGyJ1l": [ @@ -810,6 +831,7 @@ "FnQek5": [ "このサイトへの接続は暗号化されていないため、敵対的な第三者によって変更されます。このリクエストを拒否することを強くお勧めします。" ], + "UDKbPj": ["Your file has been successfully merged into the browser data."], "Q68Nuc": [ "Your payment password encrypts wallet data and is needed to unlocking the wallet, transaction confirmations and signing. The password is never stored, and there is no way to recover it if you forget it." ], diff --git a/packages/mask/shared-ui/locale/ja-JP.po b/packages/mask/shared-ui/locale/ja-JP.po index 5c070b9bbbe4..2bc19234edb9 100644 --- a/packages/mask/shared-ui/locale/ja-JP.po +++ b/packages/mask/shared-ui/locale/ja-JP.po @@ -162,6 +162,10 @@ msgstr "資産を追加" msgid "Add Contact" msgstr "連絡先を追加する" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +msgid "Add google Drive" +msgstr "" + #: popups/pages/Wallet/NetworkManagement/index.tsx #: popups/pages/Wallet/EditNetwork/index.tsx msgid "Add Network" @@ -305,13 +309,25 @@ msgid "Avatar set successfully" msgstr "アバターを設定しました" #: content-script/components/shared/SelectRecipients/SelectRecipientsDialog.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx #: dashboard/pages/CreateMaskWallet/CreateMnemonic/index.tsx #: popups/pages/Personas/ExportPrivateKey/index.tsx #: popups/pages/Personas/AccountDetail/UI.tsx msgid "Back" msgstr "" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +msgid "Back Up to Google Drive" +msgstr "" + #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/index.tsx +msgid "Back Up Your Data Your Way" +msgstr "" + +#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Personas/Logout/index.tsx #: popups/modals/SwitchPersonaModal/index.tsx msgid "Backup" @@ -322,16 +338,16 @@ msgid "Backup & Recovery" msgstr "バックアップと復元" #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Backup downloaded and merged to local successfully." -msgstr "バックアップがダウンロードされ、ローカルに正常に統合されました。" +#~ msgid "Backup downloaded and merged to local successfully." +#~ msgstr "バックアップがダウンロードされ、ローカルに正常に統合されました。" #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx msgid "Backup Failed" msgstr "バックアップ失敗" #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx -msgid "Backup is saved to Mask Cloud Service." -msgstr "" +#~ msgid "Backup is saved to Mask Cloud Service." +#~ msgstr "" #. placeholder {0}: user.localBackupAt #. placeholder {0}: user.cloudBackupAt @@ -346,6 +362,7 @@ msgid "Backup password" msgstr "バックアップパスワード" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Settings/index.tsx @@ -368,9 +385,13 @@ msgstr "バックアップパスワードの設定が完了しました" msgid "Backup Persona" msgstr "ペルソナをバックアップする" +#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx +msgid "Backup Successful" +msgstr "" + #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Backup to Mask Cloud Service" -msgstr "マスククラウドサービスにバックアップ" +#~ msgid "Backup to Mask Cloud Service" +#~ msgstr "マスククラウドサービスにバックアップ" #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx msgid "Backup to the Cloud" @@ -510,6 +531,11 @@ msgstr "支払いパスワードを変更する" msgid "Choose another wallet" msgstr "他のウォレットを選択してください" +#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/index.tsx +msgid "Choose from multiple backup options, now including encrypted storage via your authorized Google Drive for added security and flexibility." +msgstr "" + #: popups/modals/ChooseToken/index.tsx msgid "Choose Token" msgstr "トークンを選択" @@ -535,6 +561,7 @@ msgid "Close" msgstr "閉じる" #: dashboard/pages/SetupPersona/Recovery/index.tsx +#: dashboard/pages/SetupPersona/Backup/index.tsx #: dashboard/components/Restore/ConfirmSynchronizePasswordDialog.tsx #: popups/pages/Settings/index.tsx msgid "Cloud Backup" @@ -607,8 +634,6 @@ msgstr "" msgid "Confirm to hide {name}? You can redisplay it by re-adding this NFT at any time." msgstr "" -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Personas/ConnectWallet/index.tsx msgid "Congratulations" msgstr "おめでとうございます!" @@ -711,6 +736,7 @@ msgstr "コンタクト" #: dashboard/pages/SetupPersona/SignUp/index.tsx #: dashboard/pages/SetupPersona/Mnemonic/index.tsx #: dashboard/pages/SetupPersona/CloudBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx #: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx #: dashboard/pages/CreateMaskWallet/AddDeriveWallet/index.tsx #: dashboard/components/Restore/RestoreWalletFromLocal.tsx @@ -837,13 +863,17 @@ msgstr "データ" msgid "Data" msgstr "データ" +#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx +msgid "Data backed up successfully!" +msgstr "" + #: popups/pages/Settings/index.tsx msgid "Data correlation" msgstr "データの相関値" #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Data merged from Mask Cloud Service to local successfully. Re-enter your password to encrypt and upload the new backup to Mask Cloud Service." -msgstr "" +#~ msgid "Data merged from Mask Cloud Service to local successfully. Re-enter your password to encrypt and upload the new backup to Mask Cloud Service." +#~ msgstr "" #: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx #: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx @@ -951,14 +981,17 @@ msgid "Done" msgstr "完了!" #: content-script/components/InjectedComponents/AutoPasteFailedDialog.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx msgid "Download" msgstr "ダウンロード" #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Download backup" -msgstr "バックアップをダウンロード" +#~ msgid "Download backup" +#~ msgstr "バックアップをダウンロード" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx msgid "Download Backup" msgstr "バックアップのダウンロード" @@ -988,11 +1021,14 @@ msgid "eg: X accounts, persona public keys, wallet addresses or ENS" msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx #: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx msgid "Email" msgstr "メールアドレス" #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx #: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx msgid "Email verification code" msgstr "電子メール検証コード" @@ -1118,8 +1154,18 @@ msgstr "" msgid "Failed to disconnect wallet" msgstr "" +#. placeholder {0}: (err as Error).message #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Failed to download and merge the backup." +msgid "Failed to download and merge the backup: {0}" +msgstr "" + +#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +#~ msgid "Failed to download and merge the backup." +#~ msgstr "" + +#. placeholder {0}: (err as Error).message +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +msgid "Failed to login: {0}" msgstr "" #: popups/pages/Wallet/EditNetwork/index.tsx @@ -1279,6 +1325,11 @@ msgstr "" msgid "Give permission to access <0/> your {0}?" msgstr "" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +msgid "Google Drive" +msgstr "" + #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx msgid "Got it" msgstr "了解" @@ -1389,6 +1440,10 @@ msgstr "インポートされました" msgid "Imported Wallets" msgstr "インポートされたウォレット" +#: dashboard/hooks/useBackupFormState.ts +msgid "Incorrect Backup Password" +msgstr "" + #: popups/modals/VerifyBackupPasswordModal/index.tsx #: popups/modals/ChangeBackupPasswordModal/index.tsx msgid "Incorrect backup password." @@ -1418,6 +1473,7 @@ msgid "Incorrect password" msgstr "パスワードが間違っています" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: dashboard/hooks/useBackupFormState.ts #: dashboard/hooks/useBackupFormState.ts @@ -1425,7 +1481,6 @@ msgstr "パスワードが間違っています" #: dashboard/hooks/useBackupFormState.ts #: dashboard/hooks/useBackupFormState.ts #: dashboard/hooks/useBackupFormState.ts -#: dashboard/hooks/useBackupFormState.ts msgid "Incorrect Password" msgstr "パスワードが間違っています" @@ -1474,6 +1529,8 @@ msgid "Invalid Block Explorer URL." msgstr "無効なブロックエクスプローラのURLです。" #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx msgid "Invalid email address format." msgstr "メールアドレスが正しくありません。" @@ -1576,6 +1633,10 @@ msgstr "ローカルバックアップ" msgid "Local persona or wallet only" msgstr "ローカルペルソナまたはウォレットのみ" +#: dashboard/pages/SetupPersona/Backup/index.tsx +msgid "Locale Backup" +msgstr "" + #: popups/pages/Wallet/SwitchWallet/index.tsx msgid "Lock Wallet" msgstr "ウォレットをロックする" @@ -1590,6 +1651,11 @@ msgstr "ログアウト" msgid "Login to Mask Cloud" msgstr "" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +msgid "Logout" +msgstr "" + #: popups/pages/Personas/Logout/index.tsx msgid "Logout failed" msgstr "ログアウトに失敗しました。" @@ -1618,9 +1684,14 @@ msgstr "マスクには次の権限が必要です" #: content-script/components/InjectedComponents/ToolboxUnstyled.tsx #: content-script/components/InjectedComponents/PostDialogHint.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/index.tsx msgid "Mask Network" msgstr "" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +msgid "Mask Network Cloud" +msgstr "" + #: content-script/components/InjectedComponents/PermissionBoundary.tsx msgid "Mask Network requires you to authorize the following websites before using it." msgstr "" @@ -1692,15 +1763,24 @@ msgstr "最大優先手数料は0GWEIより大きくなければなりません" msgid "Medium" msgstr "中間" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +msgid "Merge Completed" +msgstr "" + +#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Merge data to local database" msgstr "ローカルデータベースにデータを統合" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Merge to local" -msgstr "ローカルに統合" +msgid "Merge to Browser" +msgstr "" + +#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +#~ msgid "Merge to local" +#~ msgstr "ローカルに統合" #: popups/components/SignRequestInfo/index.tsx msgid "Message" @@ -1716,10 +1796,12 @@ msgid "Mnemonic word" msgstr "ニーモニック単語" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx msgid "Mobile" msgstr "モバイル" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx msgid "Mobile number" msgstr "携帯番号" @@ -1837,6 +1919,7 @@ msgid "No back up" msgstr "バックアップはありません" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx msgid "No backups found" msgstr "バックアップが見つかりません" @@ -1949,7 +2032,6 @@ msgid "Other social networking platforms, such as <0>Instagram, <1>Facebook, msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx msgid "Overwrite Backup" msgstr "バックアップを上書き" @@ -1968,6 +2050,7 @@ msgid "Paste manually" msgstr "手動でペーストする" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Wallet/SetPaymentPassword/index.tsx #: popups/modals/WalletRemoveModal/index.tsx @@ -2049,6 +2132,7 @@ msgid "Personas" msgstr "ペルソナ" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx msgid "Phone verification code" msgstr "モバイル認証コード" @@ -2104,7 +2188,6 @@ msgstr "" #: dashboard/pages/SetupPersona/Recovery/index.tsx #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx msgid "Please select the appropriate method to restore your personal data." msgstr "12単語の復元フレーズは、ペルソナデータを回復するために使用されます。" @@ -2299,6 +2382,8 @@ msgstr "選びなおす" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx msgid "Resend" msgstr "再送信" @@ -2413,6 +2498,8 @@ msgstr "ウォレットを選択" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx #: popups/pages/Wallet/components/ActivityList/ActivityItem.tsx #: popups/pages/Wallet/components/ActionGroup/index.tsx #: popups/pages/Wallet/Transfer/index.tsx @@ -2616,6 +2703,7 @@ msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx msgid "Switch other account" msgstr "他のアカウントを切り替え" @@ -2653,15 +2741,22 @@ msgid "The chainID is not equal to the currently connected one." msgstr "chainIDは現在接続されているものと等しくありません。" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts +#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx #: dashboard/contexts/CloudBackupFormContext.tsx msgid "The code is incorrect." msgstr "このコードは正しくありません" -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +#: dashboard/pages/SetupPersona/Backup/helpers.tsx msgid "The download link is expired" msgstr "" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx +msgid "The Mask Network Cloud Backup feature will be deactivated on April 30, 2025. Please use alternative cloud backup services or local backup solutions." +msgstr "" + #: dashboard/pages/CreateMaskWallet/CreateMnemonic/index.tsx msgid "The mnemonic word has been copied, please keep it in a safe place." msgstr "" @@ -2700,6 +2795,7 @@ msgstr "" msgid "The persona name already exists." msgstr "このペルソナ名は既に存在しています." +#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx msgid "The phone number is incorrect." msgstr "電話番号が間違っています。" @@ -2986,6 +3082,8 @@ msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx msgid "Verification code sent" msgstr "認証コードを送信しました" @@ -3096,8 +3194,8 @@ msgid "Welcome Back" msgstr "おかえりなさい" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -msgid "Welcome to Mask Cloud Services" -msgstr "マスククラウドサービスへようこそ" +#~ msgid "Welcome to Mask Cloud Services" +#~ msgstr "マスククラウドサービスへようこそ" #: popups/pages/Personas/Home/UI.tsx msgid "Welcome to Mask Network" @@ -3107,6 +3205,10 @@ msgstr "Mask Networkへようこそ" msgid "Welcome to use Mask Network" msgstr "Mask Networkへようこそ" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +msgid "when you click Add Google Drive button,you will be forwarded to Google authorization pages." +msgstr "" + #: popups/pages/Wallet/ExportPrivateKey/index.tsx msgid "Write down mnemonic words" msgstr "ニーモニックワードを書き留めてください" @@ -3120,8 +3222,8 @@ msgid "You could check the verification result on Mask Pop-up after few minutes. msgstr "" #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx -msgid "You have backed up your data." -msgstr "" +#~ msgid "You have backed up your data." +#~ msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #~ msgid "You have recovered" @@ -3153,6 +3255,10 @@ msgstr "" msgid "Your connection to this site is not encrypted which can be modified by a hostile third party, we strongly suggest you reject this request." msgstr "このサイトへの接続は暗号化されていないため、敵対的な第三者によって変更されます。このリクエストを拒否することを強くお勧めします。" +#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +msgid "Your file has been successfully merged into the browser data." +msgstr "" + #: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx msgid "Your payment password encrypts wallet data and is needed to unlocking the wallet, transaction confirmations and signing. The password is never stored, and there is no way to recover it if you forget it." msgstr "" diff --git a/packages/mask/shared-ui/locale/ko-KR.json b/packages/mask/shared-ui/locale/ko-KR.json index 261484d2096f..01ff9f3c2d71 100644 --- a/packages/mask/shared-ui/locale/ko-KR.json +++ b/packages/mask/shared-ui/locale/ko-KR.json @@ -61,6 +61,7 @@ "5YfW3S": ["Add an encrypted comment..."], "aTzTyw": ["자산 추가"], "M0FgOk": ["연락처 추가"], + "FAKSZG": ["Add google Drive"], "LP+1Z7": ["네트워크 추가"], "68m9Nl": ["현존 그룹에 새로운 주소 추가"], "1LkMSp": ["Add Suggested Token"], @@ -100,6 +101,8 @@ "7QptC5": ["Auto-lock 시간"], "nTFx7o": ["아바타 설정 성공"], "iH8pgl": ["뒤로"], + "npsHM5": ["Back Up to Google Drive"], + "V+1pjj": ["Back Up Your Data Your Way"], "rLgPvm": ["백업"], "h7+V7K": ["백업 맟 복구"], "QrHM/A": ["백업을 다운로드하여 로컬로 병합했습니다."], @@ -111,6 +114,7 @@ "ERYJcj": ["백업 비밀번호는 대문자, 소문자, 특수 문자 및 숫자를 포함하여 8-20자여야 합니다."], "hUF4dG": ["백업 비밀번호가 설정되었습니다."], "UtKGok": ["페르소나 백업"], + "+m7x4e": ["Backup Successful"], "7Ry254": ["Mask Cloud Service 백업"], "6IHgRq": ["Backup to the Cloud"], "QQPCqQ": ["지갑 백업"], @@ -138,6 +142,9 @@ "tcHpvG": ["소유자 변경"], "fDP2k4": ["결제 비밀번호 변경"], "IXbRbM": ["다른 월렛을 선택하세요"], + "lU6uRb": [ + "Choose from multiple backup options, now including encrypted storage via your authorized Google Drive for added security and flexibility." + ], "xH6cn+": ["토큰 선택"], "+adBn3": ["Chrome - external extension"], "EsKgLS": ["퀵 스타트"], @@ -209,6 +216,7 @@ "pvnfJD": ["다크"], "Sp/me1": ["데이터"], "HKH+W+": ["데이터"], + "K8jCIB": ["Data backed up successfully!"], "3B4jmY": ["데이터 수정"], "rAcOY1": [ "Data merged from Mask Cloud Service to local successfully. Re-enter your password to encrypt and upload the new backup to Mask Cloud Service." @@ -284,7 +292,9 @@ "SLEDBF": ["월렛 추가 실패, 다시 시도하기"], "09vHB+": ["Failed to decrypt."], "jK7nvW": ["Failed to disconnect wallet"], + "9hzYBR": ["Failed to download and merge the backup: ", ["0"]], "0tkvsz": ["Failed to download and merge the backup."], + "etATpN": ["Failed to login: ", ["0"]], "mrAv9J": ["네트워크 저장 실패"], "ZsjtYe": ["아바타 설정 실패"], "RWoEqV": ["Failed to transfer token: ", ["message"]], @@ -321,6 +331,7 @@ "tdZPpe": ["Generating your"], "CiU2m/": ["Generating your "], "2p7WMm": ["Give permission to access <0/> your ", ["0"], "?"], + "w9Xmw/": ["Google Drive"], "76gPWk": ["알겠습니다"], "HqiAyF": ["Gwei"], "pu3rTn": ["GWEI"], @@ -352,6 +363,7 @@ "fza4cg": ["월렛 불러오기"], "HvDfH/": ["불러오기 완료됨"], "m3XvO+": ["월렛 불러오기"], + "ANk/Zy": ["Incorrect Backup Password"], "a23gJr": ["잘못된 비밀번호."], "bapItf": ["잘못된 백업 비밀번호."], "bassMa": ["잘못된 클라우드 백업 비밀번호입니다. 다시 시도하세요."], @@ -392,9 +404,11 @@ "jygqM9": ["Loading account information..."], "EBC6hj": ["로컬 백업"], "shPV5O": ["로컬 페르소나나 월렛만 가능합니다."], + "crVIc7": ["Locale Backup"], "KGHnSc": ["로컬 월렛"], "FgAxTj": ["로그아웃"], "kC3Q3d": ["Login to Mask Cloud"], + "nOhz3x": ["Logout"], "NkgvWN": ["로그아웃 실패"], "o4Iu2W": ["로그아웃 성공"], "nTWWCZ": ["낮음"], @@ -404,6 +418,7 @@ ], "lET9my": ["Mask가 아래 권한을 요청합니다."], "siroPf": ["Mask Network"], + "jhoAzY": ["Mask Network Cloud"], "lWOC+h": ["Mask Network requires you to authorize the following websites before using it."], "HsoakN": ["masknetwork"], "CK1KXz": ["최대치"], @@ -420,7 +435,9 @@ "sQJ3RN": ["네트워크 컨디션에 대한 최대 우선 가스비는 매우 낮습니다."], "ITBQO3": ["최대 우선 가스비는 0 GWEI보다 높아야 합니다"], "agPptk": ["보통"], + "lPsa94": ["Merge Completed"], "RH8jSA": ["데이터를 로컬 데이터베이스에 병합하기"], + "E6YUtc": ["Merge to Browser"], "QTomF0": ["로컬로 합병하기"], "xDAtGP": ["메시지"], "pGElS5": ["니모닉"], @@ -651,6 +668,9 @@ "VdhBp2": ["The chainID is not equal to the currently connected one."], "h3Vpnw": ["코드가 잘못되었습니다."], "7w1rTm": ["The download link is expired"], + "oYkran": [ + "The Mask Network Cloud Backup feature will be deactivated on April 30, 2025. Please use alternative cloud backup services or local backup solutions." + ], "o+zDNQ": ["The mnemonic word has been copied, please keep it in a safe place."], "yRuvmU": ["The mnemonic words has been copied, please keep it in a safe place."], "thX7xs": [ @@ -789,6 +809,7 @@ "m74yjp": ["Welcome to Mask Cloud Services"], "hEpXzO": ["환영합니다"], "fFYJ8f": ["환영합니다"], + "OLUEnY": ["when you click Add Google Drive button,you will be forwarded to Google authorization pages."], "Qbo7Ev": ["니모닉 단어를 적어두세요"], "f5AidZ": ["Write down recovery phrase"], "yGyJ1l": [ @@ -806,6 +827,7 @@ "FnQek5": [ "Your connection to this site is not encrypted which can be modified by a hostile third party, we strongly suggest you reject this request." ], + "UDKbPj": ["Your file has been successfully merged into the browser data."], "Q68Nuc": [ "Your payment password encrypts wallet data and is needed to unlocking the wallet, transaction confirmations and signing. The password is never stored, and there is no way to recover it if you forget it." ], diff --git a/packages/mask/shared-ui/locale/ko-KR.po b/packages/mask/shared-ui/locale/ko-KR.po index 9def83f290ec..40fc919406c1 100644 --- a/packages/mask/shared-ui/locale/ko-KR.po +++ b/packages/mask/shared-ui/locale/ko-KR.po @@ -162,6 +162,10 @@ msgstr "자산 추가" msgid "Add Contact" msgstr "연락처 추가" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +msgid "Add google Drive" +msgstr "" + #: popups/pages/Wallet/NetworkManagement/index.tsx #: popups/pages/Wallet/EditNetwork/index.tsx msgid "Add Network" @@ -305,13 +309,25 @@ msgid "Avatar set successfully" msgstr "아바타 설정 성공" #: content-script/components/shared/SelectRecipients/SelectRecipientsDialog.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx #: dashboard/pages/CreateMaskWallet/CreateMnemonic/index.tsx #: popups/pages/Personas/ExportPrivateKey/index.tsx #: popups/pages/Personas/AccountDetail/UI.tsx msgid "Back" msgstr "뒤로" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +msgid "Back Up to Google Drive" +msgstr "" + #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/index.tsx +msgid "Back Up Your Data Your Way" +msgstr "" + +#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Personas/Logout/index.tsx #: popups/modals/SwitchPersonaModal/index.tsx msgid "Backup" @@ -322,16 +338,16 @@ msgid "Backup & Recovery" msgstr "백업 맟 복구" #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Backup downloaded and merged to local successfully." -msgstr "백업을 다운로드하여 로컬로 병합했습니다." +#~ msgid "Backup downloaded and merged to local successfully." +#~ msgstr "백업을 다운로드하여 로컬로 병합했습니다." #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx msgid "Backup Failed" msgstr "백업 실패" #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx -msgid "Backup is saved to Mask Cloud Service." -msgstr "" +#~ msgid "Backup is saved to Mask Cloud Service." +#~ msgstr "" #. placeholder {0}: user.localBackupAt #. placeholder {0}: user.cloudBackupAt @@ -346,6 +362,7 @@ msgid "Backup password" msgstr "비밀번호 백업" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Settings/index.tsx @@ -368,9 +385,13 @@ msgstr "백업 비밀번호가 설정되었습니다." msgid "Backup Persona" msgstr "페르소나 백업" +#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx +msgid "Backup Successful" +msgstr "" + #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Backup to Mask Cloud Service" -msgstr "Mask Cloud Service 백업" +#~ msgid "Backup to Mask Cloud Service" +#~ msgstr "Mask Cloud Service 백업" #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx msgid "Backup to the Cloud" @@ -510,6 +531,11 @@ msgstr "결제 비밀번호 변경" msgid "Choose another wallet" msgstr "다른 월렛을 선택하세요" +#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/index.tsx +msgid "Choose from multiple backup options, now including encrypted storage via your authorized Google Drive for added security and flexibility." +msgstr "" + #: popups/modals/ChooseToken/index.tsx msgid "Choose Token" msgstr "토큰 선택" @@ -535,6 +561,7 @@ msgid "Close" msgstr "닫기" #: dashboard/pages/SetupPersona/Recovery/index.tsx +#: dashboard/pages/SetupPersona/Backup/index.tsx #: dashboard/components/Restore/ConfirmSynchronizePasswordDialog.tsx #: popups/pages/Settings/index.tsx msgid "Cloud Backup" @@ -607,8 +634,6 @@ msgstr "" msgid "Confirm to hide {name}? You can redisplay it by re-adding this NFT at any time." msgstr "" -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Personas/ConnectWallet/index.tsx msgid "Congratulations" msgstr "축하합니다" @@ -711,6 +736,7 @@ msgstr "연락처" #: dashboard/pages/SetupPersona/SignUp/index.tsx #: dashboard/pages/SetupPersona/Mnemonic/index.tsx #: dashboard/pages/SetupPersona/CloudBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx #: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx #: dashboard/pages/CreateMaskWallet/AddDeriveWallet/index.tsx #: dashboard/components/Restore/RestoreWalletFromLocal.tsx @@ -837,13 +863,17 @@ msgstr "데이터" msgid "Data" msgstr "데이터" +#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx +msgid "Data backed up successfully!" +msgstr "" + #: popups/pages/Settings/index.tsx msgid "Data correlation" msgstr "데이터 수정" #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Data merged from Mask Cloud Service to local successfully. Re-enter your password to encrypt and upload the new backup to Mask Cloud Service." -msgstr "" +#~ msgid "Data merged from Mask Cloud Service to local successfully. Re-enter your password to encrypt and upload the new backup to Mask Cloud Service." +#~ msgstr "" #: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx #: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx @@ -951,14 +981,17 @@ msgid "Done" msgstr "완료" #: content-script/components/InjectedComponents/AutoPasteFailedDialog.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx msgid "Download" msgstr "다운로드" #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Download backup" -msgstr "백업 다운로드" +#~ msgid "Download backup" +#~ msgstr "백업 다운로드" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx msgid "Download Backup" msgstr "백업 다운로드" @@ -988,11 +1021,14 @@ msgid "eg: X accounts, persona public keys, wallet addresses or ENS" msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx #: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx msgid "Email" msgstr "이메일" #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx #: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx msgid "Email verification code" msgstr "메일 인증번호" @@ -1118,8 +1154,18 @@ msgstr "" msgid "Failed to disconnect wallet" msgstr "" +#. placeholder {0}: (err as Error).message #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Failed to download and merge the backup." +msgid "Failed to download and merge the backup: {0}" +msgstr "" + +#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +#~ msgid "Failed to download and merge the backup." +#~ msgstr "" + +#. placeholder {0}: (err as Error).message +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +msgid "Failed to login: {0}" msgstr "" #: popups/pages/Wallet/EditNetwork/index.tsx @@ -1279,6 +1325,11 @@ msgstr "" msgid "Give permission to access <0/> your {0}?" msgstr "" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +msgid "Google Drive" +msgstr "" + #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx msgid "Got it" msgstr "알겠습니다" @@ -1389,6 +1440,10 @@ msgstr "불러오기 완료됨" msgid "Imported Wallets" msgstr "월렛 불러오기" +#: dashboard/hooks/useBackupFormState.ts +msgid "Incorrect Backup Password" +msgstr "" + #: popups/modals/VerifyBackupPasswordModal/index.tsx #: popups/modals/ChangeBackupPasswordModal/index.tsx msgid "Incorrect backup password." @@ -1418,6 +1473,7 @@ msgid "Incorrect password" msgstr "잘못된 비밀번호" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: dashboard/hooks/useBackupFormState.ts #: dashboard/hooks/useBackupFormState.ts @@ -1425,7 +1481,6 @@ msgstr "잘못된 비밀번호" #: dashboard/hooks/useBackupFormState.ts #: dashboard/hooks/useBackupFormState.ts #: dashboard/hooks/useBackupFormState.ts -#: dashboard/hooks/useBackupFormState.ts msgid "Incorrect Password" msgstr "잘못된 비밀번호" @@ -1474,6 +1529,8 @@ msgid "Invalid Block Explorer URL." msgstr "무효한 Block Explorer URL." #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx msgid "Invalid email address format." msgstr "이메일 주소가 잘못되었습니다." @@ -1576,6 +1633,10 @@ msgstr "로컬 백업" msgid "Local persona or wallet only" msgstr "로컬 페르소나나 월렛만 가능합니다." +#: dashboard/pages/SetupPersona/Backup/index.tsx +msgid "Locale Backup" +msgstr "" + #: popups/pages/Wallet/SwitchWallet/index.tsx msgid "Lock Wallet" msgstr "로컬 월렛" @@ -1590,6 +1651,11 @@ msgstr "로그아웃" msgid "Login to Mask Cloud" msgstr "" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +msgid "Logout" +msgstr "" + #: popups/pages/Personas/Logout/index.tsx msgid "Logout failed" msgstr "로그아웃 실패" @@ -1618,9 +1684,14 @@ msgstr "Mask가 아래 권한을 요청합니다." #: content-script/components/InjectedComponents/ToolboxUnstyled.tsx #: content-script/components/InjectedComponents/PostDialogHint.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/index.tsx msgid "Mask Network" msgstr "" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +msgid "Mask Network Cloud" +msgstr "" + #: content-script/components/InjectedComponents/PermissionBoundary.tsx msgid "Mask Network requires you to authorize the following websites before using it." msgstr "" @@ -1692,15 +1763,24 @@ msgstr "최대 우선 가스비는 0 GWEI보다 높아야 합니다" msgid "Medium" msgstr "보통" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +msgid "Merge Completed" +msgstr "" + +#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Merge data to local database" msgstr "데이터를 로컬 데이터베이스에 병합하기" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Merge to local" -msgstr "로컬로 합병하기" +msgid "Merge to Browser" +msgstr "" + +#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +#~ msgid "Merge to local" +#~ msgstr "로컬로 합병하기" #: popups/components/SignRequestInfo/index.tsx msgid "Message" @@ -1716,10 +1796,12 @@ msgid "Mnemonic word" msgstr "니모닉 단어" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx msgid "Mobile" msgstr "모바일" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx msgid "Mobile number" msgstr "휴대폰 번호" @@ -1837,6 +1919,7 @@ msgid "No back up" msgstr "백업 없음" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx msgid "No backups found" msgstr "백업 없음" @@ -1949,7 +2032,6 @@ msgid "Other social networking platforms, such as <0>Instagram, <1>Facebook, msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx msgid "Overwrite Backup" msgstr "백업 덮어쓰기" @@ -1968,6 +2050,7 @@ msgid "Paste manually" msgstr "수동으로 붙여넣기" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Wallet/SetPaymentPassword/index.tsx #: popups/modals/WalletRemoveModal/index.tsx @@ -2049,6 +2132,7 @@ msgid "Personas" msgstr "나의 페르소나" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx msgid "Phone verification code" msgstr "" @@ -2104,7 +2188,6 @@ msgstr "" #: dashboard/pages/SetupPersona/Recovery/index.tsx #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx msgid "Please select the appropriate method to restore your personal data." msgstr "12개 복구 문구로 페르소나 데어터를 복구할 수 있습니다." @@ -2299,6 +2382,8 @@ msgstr "다시 선택" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx msgid "Resend" msgstr "다시 보내기" @@ -2413,6 +2498,8 @@ msgstr "월렛 선택" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx #: popups/pages/Wallet/components/ActivityList/ActivityItem.tsx #: popups/pages/Wallet/components/ActionGroup/index.tsx #: popups/pages/Wallet/Transfer/index.tsx @@ -2616,6 +2703,7 @@ msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx msgid "Switch other account" msgstr "사용자 계정 전환" @@ -2653,15 +2741,22 @@ msgid "The chainID is not equal to the currently connected one." msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts +#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx #: dashboard/contexts/CloudBackupFormContext.tsx msgid "The code is incorrect." msgstr "코드가 잘못되었습니다." -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +#: dashboard/pages/SetupPersona/Backup/helpers.tsx msgid "The download link is expired" msgstr "" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx +msgid "The Mask Network Cloud Backup feature will be deactivated on April 30, 2025. Please use alternative cloud backup services or local backup solutions." +msgstr "" + #: dashboard/pages/CreateMaskWallet/CreateMnemonic/index.tsx msgid "The mnemonic word has been copied, please keep it in a safe place." msgstr "" @@ -2700,6 +2795,7 @@ msgstr "" msgid "The persona name already exists." msgstr "이미 존재된 페르소나입니다" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx msgid "The phone number is incorrect." msgstr "전화번호가 잘못되었습니다." @@ -2986,6 +3082,8 @@ msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx msgid "Verification code sent" msgstr "인증 코드가 발송되었습니다" @@ -3096,8 +3194,8 @@ msgid "Welcome Back" msgstr "환영합니다" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -msgid "Welcome to Mask Cloud Services" -msgstr "" +#~ msgid "Welcome to Mask Cloud Services" +#~ msgstr "" #: popups/pages/Personas/Home/UI.tsx msgid "Welcome to Mask Network" @@ -3107,6 +3205,10 @@ msgstr "환영합니다" msgid "Welcome to use Mask Network" msgstr "환영합니다" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +msgid "when you click Add Google Drive button,you will be forwarded to Google authorization pages." +msgstr "" + #: popups/pages/Wallet/ExportPrivateKey/index.tsx msgid "Write down mnemonic words" msgstr "니모닉 단어를 적어두세요" @@ -3120,8 +3222,8 @@ msgid "You could check the verification result on Mask Pop-up after few minutes. msgstr "" #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx -msgid "You have backed up your data." -msgstr "" +#~ msgid "You have backed up your data." +#~ msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #~ msgid "You have recovered" @@ -3153,6 +3255,10 @@ msgstr "" msgid "Your connection to this site is not encrypted which can be modified by a hostile third party, we strongly suggest you reject this request." msgstr "" +#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +msgid "Your file has been successfully merged into the browser data." +msgstr "" + #: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx msgid "Your payment password encrypts wallet data and is needed to unlocking the wallet, transaction confirmations and signing. The password is never stored, and there is no way to recover it if you forget it." msgstr "" diff --git a/packages/mask/shared-ui/locale/zh-CN.json b/packages/mask/shared-ui/locale/zh-CN.json index 7183669cfce1..939507ae5abd 100644 --- a/packages/mask/shared-ui/locale/zh-CN.json +++ b/packages/mask/shared-ui/locale/zh-CN.json @@ -61,6 +61,7 @@ "5YfW3S": ["Add an encrypted comment..."], "aTzTyw": ["添加资产"], "M0FgOk": ["添加联系人"], + "FAKSZG": ["Add google Drive"], "LP+1Z7": ["添加网络"], "68m9Nl": ["向现有组添加新地址"], "1LkMSp": ["Add Suggested Token"], @@ -98,6 +99,8 @@ "7QptC5": ["自动锁定时间"], "nTFx7o": ["新头像设置成功"], "iH8pgl": ["返回"], + "npsHM5": ["Back Up to Google Drive"], + "V+1pjj": ["Back Up Your Data Your Way"], "rLgPvm": ["备份"], "h7+V7K": ["备份恢复"], "QrHM/A": ["备份下载并成功合并到本地。"], @@ -109,6 +112,7 @@ "ERYJcj": ["备份密码必须是 8-20 个字符,包括大写、小写、特殊字符和数字。"], "hUF4dG": ["备份密码设置成功。"], "UtKGok": ["备份身份"], + "+m7x4e": ["Backup Successful"], "7Ry254": ["备份到 Mask 云服务"], "6IHgRq": ["Backup to the Cloud"], "QQPCqQ": ["备份钱包"], @@ -136,6 +140,9 @@ "tcHpvG": ["更改管理账户"], "fDP2k4": ["修改支付密码"], "IXbRbM": ["切换钱包"], + "lU6uRb": [ + "Choose from multiple backup options, now including encrypted storage via your authorized Google Drive for added security and flexibility." + ], "xH6cn+": ["选择代币"], "+adBn3": ["Chrome - external extension"], "EsKgLS": ["点击这里快速开始。"], @@ -207,6 +214,7 @@ "pvnfJD": ["深色"], "Sp/me1": ["数据"], "HKH+W+": ["数据"], + "K8jCIB": ["Data backed up successfully!"], "3B4jmY": ["数据关联"], "rAcOY1": [ "Data merged from Mask Cloud Service to local successfully. Re-enter your password to encrypt and upload the new backup to Mask Cloud Service." @@ -282,7 +290,9 @@ "SLEDBF": ["添加钱包失败,请重试。"], "09vHB+": ["Failed to decrypt."], "jK7nvW": ["Failed to disconnect wallet"], + "9hzYBR": ["Failed to download and merge the backup: ", ["0"]], "0tkvsz": ["Failed to download and merge the backup."], + "etATpN": ["Failed to login: ", ["0"]], "mrAv9J": ["无法保存网络"], "ZsjtYe": ["加载头像失败。"], "RWoEqV": ["Failed to transfer token: ", ["message"]], @@ -319,6 +329,7 @@ "tdZPpe": ["Generating your"], "CiU2m/": ["Generating your "], "2p7WMm": ["Give permission to access <0/> your ", ["0"], "?"], + "w9Xmw/": ["Google Drive"], "76gPWk": ["好的"], "HqiAyF": ["Gwei"], "pu3rTn": ["GWEI"], @@ -350,6 +361,7 @@ "fza4cg": ["导入钱包"], "HvDfH/": ["已导入"], "m3XvO+": ["导入钱包"], + "ANk/Zy": ["Incorrect Backup Password"], "a23gJr": ["密码不正确。"], "bapItf": ["备份密码错误。"], "bassMa": ["云备份密码不正确,请重试。"], @@ -390,9 +402,11 @@ "jygqM9": ["Loading account information..."], "EBC6hj": ["本地备份"], "shPV5O": ["仅限本地身份或钱包"], + "crVIc7": ["Locale Backup"], "KGHnSc": ["锁定钱包"], "FgAxTj": ["登出"], "kC3Q3d": ["Login to Mask Cloud"], + "nOhz3x": ["Logout"], "NkgvWN": ["登出失败"], "o4Iu2W": ["退出成功"], "nTWWCZ": ["低"], @@ -402,6 +416,7 @@ ], "lET9my": ["Mask Network需要以下权限"], "siroPf": ["Mask Network"], + "jhoAzY": ["Mask Network Cloud"], "lWOC+h": ["Mask Network requires you to authorize the following websites before using it."], "HsoakN": ["masknetwork"], "CK1KXz": ["最大"], @@ -418,7 +433,9 @@ "sQJ3RN": ["最大优先费用在当前网络环境下过低。"], "ITBQO3": ["Max priority fee必须大于 0 GWEI"], "agPptk": ["中等"], + "lPsa94": ["Merge Completed"], "RH8jSA": ["合并数据到本地数据库"], + "E6YUtc": ["Merge to Browser"], "QTomF0": ["合并至本地数据"], "xDAtGP": ["信息"], "pGElS5": ["助记词"], @@ -647,6 +664,9 @@ "VdhBp2": ["The chainID is not equal to the currently connected one."], "h3Vpnw": ["验证码不正确"], "7w1rTm": ["The download link is expired"], + "oYkran": [ + "The Mask Network Cloud Backup feature will be deactivated on April 30, 2025. Please use alternative cloud backup services or local backup solutions." + ], "o+zDNQ": ["The mnemonic word has been copied, please keep it in a safe place."], "yRuvmU": ["The mnemonic words has been copied, please keep it in a safe place."], "thX7xs": [ @@ -783,6 +803,7 @@ "m74yjp": ["欢迎使用 Mask 云服务"], "hEpXzO": ["欢迎来到 Mask Network!"], "fFYJ8f": ["欢迎来到 Mask Network!"], + "OLUEnY": ["when you click Add Google Drive button,you will be forwarded to Google authorization pages."], "Qbo7Ev": ["写下助记词"], "f5AidZ": ["Write down recovery phrase"], "yGyJ1l": [ @@ -800,6 +821,7 @@ "FnQek5": [ "Your connection to this site is not encrypted which can be modified by a hostile third party, we strongly suggest you reject this request." ], + "UDKbPj": ["Your file has been successfully merged into the browser data."], "Q68Nuc": [ "Your payment password encrypts wallet data and is needed to unlocking the wallet, transaction confirmations and signing. The password is never stored, and there is no way to recover it if you forget it." ], diff --git a/packages/mask/shared-ui/locale/zh-CN.po b/packages/mask/shared-ui/locale/zh-CN.po index 61b4a085ad81..149cf850227b 100644 --- a/packages/mask/shared-ui/locale/zh-CN.po +++ b/packages/mask/shared-ui/locale/zh-CN.po @@ -162,6 +162,10 @@ msgstr "添加资产" msgid "Add Contact" msgstr "添加联系人" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +msgid "Add google Drive" +msgstr "" + #: popups/pages/Wallet/NetworkManagement/index.tsx #: popups/pages/Wallet/EditNetwork/index.tsx msgid "Add Network" @@ -305,13 +309,25 @@ msgid "Avatar set successfully" msgstr "新头像设置成功" #: content-script/components/shared/SelectRecipients/SelectRecipientsDialog.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx #: dashboard/pages/CreateMaskWallet/CreateMnemonic/index.tsx #: popups/pages/Personas/ExportPrivateKey/index.tsx #: popups/pages/Personas/AccountDetail/UI.tsx msgid "Back" msgstr "返回" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +msgid "Back Up to Google Drive" +msgstr "" + #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/index.tsx +msgid "Back Up Your Data Your Way" +msgstr "" + +#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Personas/Logout/index.tsx #: popups/modals/SwitchPersonaModal/index.tsx msgid "Backup" @@ -322,16 +338,16 @@ msgid "Backup & Recovery" msgstr "备份恢复" #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Backup downloaded and merged to local successfully." -msgstr "备份下载并成功合并到本地。" +#~ msgid "Backup downloaded and merged to local successfully." +#~ msgstr "备份下载并成功合并到本地。" #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx msgid "Backup Failed" msgstr "备份失败" #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx -msgid "Backup is saved to Mask Cloud Service." -msgstr "" +#~ msgid "Backup is saved to Mask Cloud Service." +#~ msgstr "" #. placeholder {0}: user.localBackupAt #. placeholder {0}: user.cloudBackupAt @@ -346,6 +362,7 @@ msgid "Backup password" msgstr "备份密码" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Settings/index.tsx @@ -368,9 +385,13 @@ msgstr "备份密码设置成功。" msgid "Backup Persona" msgstr "备份身份" +#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx +msgid "Backup Successful" +msgstr "" + #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Backup to Mask Cloud Service" -msgstr "备份到 Mask 云服务" +#~ msgid "Backup to Mask Cloud Service" +#~ msgstr "备份到 Mask 云服务" #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx msgid "Backup to the Cloud" @@ -510,6 +531,11 @@ msgstr "修改支付密码" msgid "Choose another wallet" msgstr "切换钱包" +#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/index.tsx +msgid "Choose from multiple backup options, now including encrypted storage via your authorized Google Drive for added security and flexibility." +msgstr "" + #: popups/modals/ChooseToken/index.tsx msgid "Choose Token" msgstr "选择代币" @@ -535,6 +561,7 @@ msgid "Close" msgstr "关闭" #: dashboard/pages/SetupPersona/Recovery/index.tsx +#: dashboard/pages/SetupPersona/Backup/index.tsx #: dashboard/components/Restore/ConfirmSynchronizePasswordDialog.tsx #: popups/pages/Settings/index.tsx msgid "Cloud Backup" @@ -607,8 +634,6 @@ msgstr "" msgid "Confirm to hide {name}? You can redisplay it by re-adding this NFT at any time." msgstr "" -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Personas/ConnectWallet/index.tsx msgid "Congratulations" msgstr "恭喜您!" @@ -711,6 +736,7 @@ msgstr "联系人" #: dashboard/pages/SetupPersona/SignUp/index.tsx #: dashboard/pages/SetupPersona/Mnemonic/index.tsx #: dashboard/pages/SetupPersona/CloudBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx #: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx #: dashboard/pages/CreateMaskWallet/AddDeriveWallet/index.tsx #: dashboard/components/Restore/RestoreWalletFromLocal.tsx @@ -837,13 +863,17 @@ msgstr "数据" msgid "Data" msgstr "数据" +#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx +msgid "Data backed up successfully!" +msgstr "" + #: popups/pages/Settings/index.tsx msgid "Data correlation" msgstr "数据关联" #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Data merged from Mask Cloud Service to local successfully. Re-enter your password to encrypt and upload the new backup to Mask Cloud Service." -msgstr "" +#~ msgid "Data merged from Mask Cloud Service to local successfully. Re-enter your password to encrypt and upload the new backup to Mask Cloud Service." +#~ msgstr "" #: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx #: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx @@ -951,14 +981,17 @@ msgid "Done" msgstr "完成" #: content-script/components/InjectedComponents/AutoPasteFailedDialog.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx msgid "Download" msgstr "下载" #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Download backup" -msgstr "下载备份" +#~ msgid "Download backup" +#~ msgstr "下载备份" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx msgid "Download Backup" msgstr "下载备份" @@ -988,11 +1021,14 @@ msgid "eg: X accounts, persona public keys, wallet addresses or ENS" msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx #: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx msgid "Email" msgstr "电子邮箱" #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx #: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx msgid "Email verification code" msgstr "邮箱验证码" @@ -1118,8 +1154,18 @@ msgstr "" msgid "Failed to disconnect wallet" msgstr "" +#. placeholder {0}: (err as Error).message #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Failed to download and merge the backup." +msgid "Failed to download and merge the backup: {0}" +msgstr "" + +#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +#~ msgid "Failed to download and merge the backup." +#~ msgstr "" + +#. placeholder {0}: (err as Error).message +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +msgid "Failed to login: {0}" msgstr "" #: popups/pages/Wallet/EditNetwork/index.tsx @@ -1279,6 +1325,11 @@ msgstr "" msgid "Give permission to access <0/> your {0}?" msgstr "" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +msgid "Google Drive" +msgstr "" + #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx msgid "Got it" msgstr "好的" @@ -1389,6 +1440,10 @@ msgstr "已导入" msgid "Imported Wallets" msgstr "导入钱包" +#: dashboard/hooks/useBackupFormState.ts +msgid "Incorrect Backup Password" +msgstr "" + #: popups/modals/VerifyBackupPasswordModal/index.tsx #: popups/modals/ChangeBackupPasswordModal/index.tsx msgid "Incorrect backup password." @@ -1418,6 +1473,7 @@ msgid "Incorrect password" msgstr "密码不正确" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: dashboard/hooks/useBackupFormState.ts #: dashboard/hooks/useBackupFormState.ts @@ -1425,7 +1481,6 @@ msgstr "密码不正确" #: dashboard/hooks/useBackupFormState.ts #: dashboard/hooks/useBackupFormState.ts #: dashboard/hooks/useBackupFormState.ts -#: dashboard/hooks/useBackupFormState.ts msgid "Incorrect Password" msgstr "密码不正确" @@ -1474,6 +1529,8 @@ msgid "Invalid Block Explorer URL." msgstr "无效的块浏览器URL。" #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx msgid "Invalid email address format." msgstr "邮箱地址不正确。" @@ -1576,6 +1633,10 @@ msgstr "本地备份" msgid "Local persona or wallet only" msgstr "仅限本地身份或钱包" +#: dashboard/pages/SetupPersona/Backup/index.tsx +msgid "Locale Backup" +msgstr "" + #: popups/pages/Wallet/SwitchWallet/index.tsx msgid "Lock Wallet" msgstr "锁定钱包" @@ -1590,6 +1651,11 @@ msgstr "登出" msgid "Login to Mask Cloud" msgstr "" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +msgid "Logout" +msgstr "" + #: popups/pages/Personas/Logout/index.tsx msgid "Logout failed" msgstr "登出失败" @@ -1618,9 +1684,14 @@ msgstr "Mask Network需要以下权限" #: content-script/components/InjectedComponents/ToolboxUnstyled.tsx #: content-script/components/InjectedComponents/PostDialogHint.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/index.tsx msgid "Mask Network" msgstr "" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +msgid "Mask Network Cloud" +msgstr "" + #: content-script/components/InjectedComponents/PermissionBoundary.tsx msgid "Mask Network requires you to authorize the following websites before using it." msgstr "" @@ -1692,15 +1763,24 @@ msgstr "Max priority fee必须大于 0 GWEI" msgid "Medium" msgstr "中等" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +msgid "Merge Completed" +msgstr "" + +#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Merge data to local database" msgstr "合并数据到本地数据库" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Merge to local" -msgstr "合并至本地数据" +msgid "Merge to Browser" +msgstr "" + +#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +#~ msgid "Merge to local" +#~ msgstr "合并至本地数据" #: popups/components/SignRequestInfo/index.tsx msgid "Message" @@ -1716,10 +1796,12 @@ msgid "Mnemonic word" msgstr "助记词" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx msgid "Mobile" msgstr "手机" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx msgid "Mobile number" msgstr "手机号码" @@ -1837,6 +1919,7 @@ msgid "No back up" msgstr "没有备份" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx msgid "No backups found" msgstr "没有发现备份" @@ -1949,7 +2032,6 @@ msgid "Other social networking platforms, such as <0>Instagram, <1>Facebook, msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx msgid "Overwrite Backup" msgstr "覆盖备份" @@ -1968,6 +2050,7 @@ msgid "Paste manually" msgstr "手动粘贴" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Wallet/SetPaymentPassword/index.tsx #: popups/modals/WalletRemoveModal/index.tsx @@ -2049,6 +2132,7 @@ msgid "Personas" msgstr "身份" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx msgid "Phone verification code" msgstr "验证码" @@ -2104,7 +2188,6 @@ msgstr "" #: dashboard/pages/SetupPersona/Recovery/index.tsx #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx msgid "Please select the appropriate method to restore your personal data." msgstr "请选择合适的方法来恢复个人数据。" @@ -2299,6 +2382,8 @@ msgstr "重新选择" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx msgid "Resend" msgstr "重新发送" @@ -2413,6 +2498,8 @@ msgstr "选择钱包" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx #: popups/pages/Wallet/components/ActivityList/ActivityItem.tsx #: popups/pages/Wallet/components/ActionGroup/index.tsx #: popups/pages/Wallet/Transfer/index.tsx @@ -2616,6 +2703,7 @@ msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx msgid "Switch other account" msgstr "切换帐号" @@ -2653,15 +2741,22 @@ msgid "The chainID is not equal to the currently connected one." msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts +#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx #: dashboard/contexts/CloudBackupFormContext.tsx msgid "The code is incorrect." msgstr "验证码不正确" -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +#: dashboard/pages/SetupPersona/Backup/helpers.tsx msgid "The download link is expired" msgstr "" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx +msgid "The Mask Network Cloud Backup feature will be deactivated on April 30, 2025. Please use alternative cloud backup services or local backup solutions." +msgstr "" + #: dashboard/pages/CreateMaskWallet/CreateMnemonic/index.tsx msgid "The mnemonic word has been copied, please keep it in a safe place." msgstr "" @@ -2700,6 +2795,7 @@ msgstr "" msgid "The persona name already exists." msgstr "此身份名称已存在" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx msgid "The phone number is incorrect." msgstr "此手机号码不正确。" @@ -2986,6 +3082,8 @@ msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx msgid "Verification code sent" msgstr "验证码已发送" @@ -3096,8 +3194,8 @@ msgid "Welcome Back" msgstr "欢迎回来" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -msgid "Welcome to Mask Cloud Services" -msgstr "欢迎使用 Mask 云服务" +#~ msgid "Welcome to Mask Cloud Services" +#~ msgstr "欢迎使用 Mask 云服务" #: popups/pages/Personas/Home/UI.tsx msgid "Welcome to Mask Network" @@ -3107,6 +3205,10 @@ msgstr "欢迎来到 Mask Network!" msgid "Welcome to use Mask Network" msgstr "欢迎来到 Mask Network!" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +msgid "when you click Add Google Drive button,you will be forwarded to Google authorization pages." +msgstr "" + #: popups/pages/Wallet/ExportPrivateKey/index.tsx msgid "Write down mnemonic words" msgstr "写下助记词" @@ -3120,8 +3222,8 @@ msgid "You could check the verification result on Mask Pop-up after few minutes. msgstr "" #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx -msgid "You have backed up your data." -msgstr "" +#~ msgid "You have backed up your data." +#~ msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #~ msgid "You have recovered" @@ -3153,6 +3255,10 @@ msgstr "" msgid "Your connection to this site is not encrypted which can be modified by a hostile third party, we strongly suggest you reject this request." msgstr "" +#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +msgid "Your file has been successfully merged into the browser data." +msgstr "" + #: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx msgid "Your payment password encrypts wallet data and is needed to unlocking the wallet, transaction confirmations and signing. The password is never stored, and there is no way to recover it if you forget it." msgstr "" diff --git a/packages/mask/shared-ui/locale/zh-TW.json b/packages/mask/shared-ui/locale/zh-TW.json index 0944ff73d188..2fa73c62fe40 100644 --- a/packages/mask/shared-ui/locale/zh-TW.json +++ b/packages/mask/shared-ui/locale/zh-TW.json @@ -61,6 +61,7 @@ "5YfW3S": ["Add an encrypted comment..."], "aTzTyw": ["添加资产"], "M0FgOk": ["添加联系人"], + "FAKSZG": ["Add google Drive"], "LP+1Z7": ["添加网络"], "68m9Nl": ["向现有组添加新地址"], "1LkMSp": ["Add Suggested Token"], @@ -98,6 +99,8 @@ "7QptC5": ["自动锁定时间"], "nTFx7o": ["新头像设置成功"], "iH8pgl": ["返回"], + "npsHM5": ["Back Up to Google Drive"], + "V+1pjj": ["Back Up Your Data Your Way"], "rLgPvm": ["备份"], "h7+V7K": ["备份恢复"], "QrHM/A": ["备份下载并成功合并到本地。"], @@ -109,6 +112,7 @@ "ERYJcj": ["备份密码必须是 8-20 个字符,包括大写、小写、特殊字符和数字。"], "hUF4dG": ["备份密码设置成功。"], "UtKGok": ["备份身份"], + "+m7x4e": ["Backup Successful"], "7Ry254": ["备份到 Mask 云服务"], "6IHgRq": ["Backup to the Cloud"], "QQPCqQ": ["备份钱包"], @@ -136,6 +140,9 @@ "tcHpvG": ["更改管理账户"], "fDP2k4": ["修改支付密码"], "IXbRbM": ["切换钱包"], + "lU6uRb": [ + "Choose from multiple backup options, now including encrypted storage via your authorized Google Drive for added security and flexibility." + ], "xH6cn+": ["选择代币"], "+adBn3": ["Chrome - external extension"], "EsKgLS": ["点击这里快速开始。"], @@ -207,6 +214,7 @@ "pvnfJD": ["深色"], "Sp/me1": ["数据"], "HKH+W+": ["数据"], + "K8jCIB": ["Data backed up successfully!"], "3B4jmY": ["数据关联"], "rAcOY1": [ "Data merged from Mask Cloud Service to local successfully. Re-enter your password to encrypt and upload the new backup to Mask Cloud Service." @@ -282,7 +290,9 @@ "SLEDBF": ["添加钱包失败,请重试。"], "09vHB+": ["Failed to decrypt."], "jK7nvW": ["Failed to disconnect wallet"], + "9hzYBR": ["Failed to download and merge the backup: ", ["0"]], "0tkvsz": ["Failed to download and merge the backup."], + "etATpN": ["Failed to login: ", ["0"]], "mrAv9J": ["无法保存网络"], "ZsjtYe": ["加载头像失败。"], "RWoEqV": ["Failed to transfer token: ", ["message"]], @@ -319,6 +329,7 @@ "tdZPpe": ["Generating your"], "CiU2m/": ["Generating your "], "2p7WMm": ["Give permission to access <0/> your ", ["0"], "?"], + "w9Xmw/": ["Google Drive"], "76gPWk": ["好的"], "HqiAyF": ["Gwei"], "pu3rTn": ["GWEI"], @@ -350,6 +361,7 @@ "fza4cg": ["导入钱包"], "HvDfH/": ["已导入"], "m3XvO+": ["导入钱包"], + "ANk/Zy": ["Incorrect Backup Password"], "a23gJr": ["密码不正确。"], "bapItf": ["备份密码错误。"], "bassMa": ["云备份密码不正确,请重试。"], @@ -390,9 +402,11 @@ "jygqM9": ["Loading account information..."], "EBC6hj": ["本地备份"], "shPV5O": ["仅限本地身份或钱包"], + "crVIc7": ["Locale Backup"], "KGHnSc": ["锁定钱包"], "FgAxTj": ["登出"], "kC3Q3d": ["Login to Mask Cloud"], + "nOhz3x": ["Logout"], "NkgvWN": ["登出失败"], "o4Iu2W": ["退出成功"], "nTWWCZ": ["低"], @@ -402,6 +416,7 @@ ], "lET9my": ["Mask Network需要以下权限"], "siroPf": ["Mask Network"], + "jhoAzY": ["Mask Network Cloud"], "lWOC+h": ["Mask Network requires you to authorize the following websites before using it."], "HsoakN": ["masknetwork"], "CK1KXz": ["最大"], @@ -418,7 +433,9 @@ "sQJ3RN": ["最大优先费用在当前网络环境下过低。"], "ITBQO3": ["Max priority fee必须大于 0 GWEI"], "agPptk": ["中等"], + "lPsa94": ["Merge Completed"], "RH8jSA": ["合并数据到本地数据库"], + "E6YUtc": ["Merge to Browser"], "QTomF0": ["合并至本地数据"], "xDAtGP": ["信息"], "pGElS5": ["助记词"], @@ -647,6 +664,9 @@ "VdhBp2": ["The chainID is not equal to the currently connected one."], "h3Vpnw": ["验证码不正确"], "7w1rTm": ["The download link is expired"], + "oYkran": [ + "The Mask Network Cloud Backup feature will be deactivated on April 30, 2025. Please use alternative cloud backup services or local backup solutions." + ], "o+zDNQ": ["The mnemonic word has been copied, please keep it in a safe place."], "yRuvmU": ["The mnemonic words has been copied, please keep it in a safe place."], "thX7xs": [ @@ -783,6 +803,7 @@ "m74yjp": ["欢迎使用 Mask 云服务"], "hEpXzO": ["欢迎来到 Mask Network!"], "fFYJ8f": ["欢迎来到 Mask Network!"], + "OLUEnY": ["when you click Add Google Drive button,you will be forwarded to Google authorization pages."], "Qbo7Ev": ["写下助记词"], "f5AidZ": ["Write down recovery phrase"], "yGyJ1l": [ @@ -800,6 +821,7 @@ "FnQek5": [ "Your connection to this site is not encrypted which can be modified by a hostile third party, we strongly suggest you reject this request." ], + "UDKbPj": ["Your file has been successfully merged into the browser data."], "Q68Nuc": [ "Your payment password encrypts wallet data and is needed to unlocking the wallet, transaction confirmations and signing. The password is never stored, and there is no way to recover it if you forget it." ], diff --git a/packages/mask/shared-ui/locale/zh-TW.po b/packages/mask/shared-ui/locale/zh-TW.po index 8cbe7a8af2ed..864ffb6872c9 100644 --- a/packages/mask/shared-ui/locale/zh-TW.po +++ b/packages/mask/shared-ui/locale/zh-TW.po @@ -162,6 +162,10 @@ msgstr "" msgid "Add Contact" msgstr "" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +msgid "Add google Drive" +msgstr "" + #: popups/pages/Wallet/NetworkManagement/index.tsx #: popups/pages/Wallet/EditNetwork/index.tsx msgid "Add Network" @@ -305,13 +309,25 @@ msgid "Avatar set successfully" msgstr "" #: content-script/components/shared/SelectRecipients/SelectRecipientsDialog.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx #: dashboard/pages/CreateMaskWallet/CreateMnemonic/index.tsx #: popups/pages/Personas/ExportPrivateKey/index.tsx #: popups/pages/Personas/AccountDetail/UI.tsx msgid "Back" msgstr "返回" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +msgid "Back Up to Google Drive" +msgstr "" + #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/index.tsx +msgid "Back Up Your Data Your Way" +msgstr "" + +#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Personas/Logout/index.tsx #: popups/modals/SwitchPersonaModal/index.tsx msgid "Backup" @@ -322,16 +338,16 @@ msgid "Backup & Recovery" msgstr "" #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Backup downloaded and merged to local successfully." -msgstr "" +#~ msgid "Backup downloaded and merged to local successfully." +#~ msgstr "" #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx msgid "Backup Failed" msgstr "備份失敗" #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx -msgid "Backup is saved to Mask Cloud Service." -msgstr "" +#~ msgid "Backup is saved to Mask Cloud Service." +#~ msgstr "" #. placeholder {0}: user.localBackupAt #. placeholder {0}: user.cloudBackupAt @@ -346,6 +362,7 @@ msgid "Backup password" msgstr "備份密碼" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Settings/index.tsx @@ -368,10 +385,14 @@ msgstr "" msgid "Backup Persona" msgstr "" -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Backup to Mask Cloud Service" +#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx +msgid "Backup Successful" msgstr "" +#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +#~ msgid "Backup to Mask Cloud Service" +#~ msgstr "" + #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx msgid "Backup to the Cloud" msgstr "" @@ -510,6 +531,11 @@ msgstr "" msgid "Choose another wallet" msgstr "" +#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/index.tsx +msgid "Choose from multiple backup options, now including encrypted storage via your authorized Google Drive for added security and flexibility." +msgstr "" + #: popups/modals/ChooseToken/index.tsx msgid "Choose Token" msgstr "" @@ -535,6 +561,7 @@ msgid "Close" msgstr "關閉" #: dashboard/pages/SetupPersona/Recovery/index.tsx +#: dashboard/pages/SetupPersona/Backup/index.tsx #: dashboard/components/Restore/ConfirmSynchronizePasswordDialog.tsx #: popups/pages/Settings/index.tsx msgid "Cloud Backup" @@ -607,8 +634,6 @@ msgstr "" msgid "Confirm to hide {name}? You can redisplay it by re-adding this NFT at any time." msgstr "" -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Personas/ConnectWallet/index.tsx msgid "Congratulations" msgstr "" @@ -711,6 +736,7 @@ msgstr "聯繫人" #: dashboard/pages/SetupPersona/SignUp/index.tsx #: dashboard/pages/SetupPersona/Mnemonic/index.tsx #: dashboard/pages/SetupPersona/CloudBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx #: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx #: dashboard/pages/CreateMaskWallet/AddDeriveWallet/index.tsx #: dashboard/components/Restore/RestoreWalletFromLocal.tsx @@ -837,13 +863,17 @@ msgstr "" msgid "Data" msgstr "" +#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx +msgid "Data backed up successfully!" +msgstr "" + #: popups/pages/Settings/index.tsx msgid "Data correlation" msgstr "" #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Data merged from Mask Cloud Service to local successfully. Re-enter your password to encrypt and upload the new backup to Mask Cloud Service." -msgstr "" +#~ msgid "Data merged from Mask Cloud Service to local successfully. Re-enter your password to encrypt and upload the new backup to Mask Cloud Service." +#~ msgstr "" #: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx #: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx @@ -951,14 +981,17 @@ msgid "Done" msgstr "完成!" #: content-script/components/InjectedComponents/AutoPasteFailedDialog.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx msgid "Download" msgstr "下載" #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Download backup" -msgstr "" +#~ msgid "Download backup" +#~ msgstr "" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx msgid "Download Backup" msgstr "" @@ -988,11 +1021,14 @@ msgid "eg: X accounts, persona public keys, wallet addresses or ENS" msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx #: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx msgid "Email" msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx #: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx msgid "Email verification code" msgstr "" @@ -1118,8 +1154,18 @@ msgstr "" msgid "Failed to disconnect wallet" msgstr "" +#. placeholder {0}: (err as Error).message +#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +msgid "Failed to download and merge the backup: {0}" +msgstr "" + #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Failed to download and merge the backup." +#~ msgid "Failed to download and merge the backup." +#~ msgstr "" + +#. placeholder {0}: (err as Error).message +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +msgid "Failed to login: {0}" msgstr "" #: popups/pages/Wallet/EditNetwork/index.tsx @@ -1279,6 +1325,11 @@ msgstr "" msgid "Give permission to access <0/> your {0}?" msgstr "" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +msgid "Google Drive" +msgstr "" + #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx msgid "Got it" msgstr "" @@ -1389,6 +1440,10 @@ msgstr "" msgid "Imported Wallets" msgstr "" +#: dashboard/hooks/useBackupFormState.ts +msgid "Incorrect Backup Password" +msgstr "" + #: popups/modals/VerifyBackupPasswordModal/index.tsx #: popups/modals/ChangeBackupPasswordModal/index.tsx msgid "Incorrect backup password." @@ -1418,6 +1473,7 @@ msgid "Incorrect password" msgstr "" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: dashboard/hooks/useBackupFormState.ts #: dashboard/hooks/useBackupFormState.ts @@ -1425,7 +1481,6 @@ msgstr "" #: dashboard/hooks/useBackupFormState.ts #: dashboard/hooks/useBackupFormState.ts #: dashboard/hooks/useBackupFormState.ts -#: dashboard/hooks/useBackupFormState.ts msgid "Incorrect Password" msgstr "" @@ -1474,6 +1529,8 @@ msgid "Invalid Block Explorer URL." msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx msgid "Invalid email address format." msgstr "" @@ -1576,6 +1633,10 @@ msgstr "" msgid "Local persona or wallet only" msgstr "" +#: dashboard/pages/SetupPersona/Backup/index.tsx +msgid "Locale Backup" +msgstr "" + #: popups/pages/Wallet/SwitchWallet/index.tsx msgid "Lock Wallet" msgstr "" @@ -1590,6 +1651,11 @@ msgstr "" msgid "Login to Mask Cloud" msgstr "" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +msgid "Logout" +msgstr "" + #: popups/pages/Personas/Logout/index.tsx msgid "Logout failed" msgstr "" @@ -1618,9 +1684,14 @@ msgstr "" #: content-script/components/InjectedComponents/ToolboxUnstyled.tsx #: content-script/components/InjectedComponents/PostDialogHint.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/index.tsx msgid "Mask Network" msgstr "" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +msgid "Mask Network Cloud" +msgstr "" + #: content-script/components/InjectedComponents/PermissionBoundary.tsx msgid "Mask Network requires you to authorize the following websites before using it." msgstr "" @@ -1692,16 +1763,25 @@ msgstr "" msgid "Medium" msgstr "" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +msgid "Merge Completed" +msgstr "" + +#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Merge data to local database" msgstr "" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Merge to local" +msgid "Merge to Browser" msgstr "" +#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +#~ msgid "Merge to local" +#~ msgstr "" + #: popups/components/SignRequestInfo/index.tsx msgid "Message" msgstr "" @@ -1716,10 +1796,12 @@ msgid "Mnemonic word" msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx msgid "Mobile" msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx msgid "Mobile number" msgstr "" @@ -1837,6 +1919,7 @@ msgid "No back up" msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx msgid "No backups found" msgstr "" @@ -1949,7 +2032,6 @@ msgid "Other social networking platforms, such as <0>Instagram, <1>Facebook, msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx msgid "Overwrite Backup" msgstr "" @@ -1968,6 +2050,7 @@ msgid "Paste manually" msgstr "手動貼上" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Wallet/SetPaymentPassword/index.tsx #: popups/modals/WalletRemoveModal/index.tsx @@ -2049,6 +2132,7 @@ msgid "Personas" msgstr "角色" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx msgid "Phone verification code" msgstr "" @@ -2104,7 +2188,6 @@ msgstr "" #: dashboard/pages/SetupPersona/Recovery/index.tsx #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx msgid "Please select the appropriate method to restore your personal data." msgstr "" @@ -2299,6 +2382,8 @@ msgstr "" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx msgid "Resend" msgstr "重新傳送" @@ -2413,6 +2498,8 @@ msgstr "" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx #: popups/pages/Wallet/components/ActivityList/ActivityItem.tsx #: popups/pages/Wallet/components/ActionGroup/index.tsx #: popups/pages/Wallet/Transfer/index.tsx @@ -2616,6 +2703,7 @@ msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx msgid "Switch other account" msgstr "" @@ -2653,15 +2741,22 @@ msgid "The chainID is not equal to the currently connected one." msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts +#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx #: dashboard/contexts/CloudBackupFormContext.tsx msgid "The code is incorrect." msgstr "" -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +#: dashboard/pages/SetupPersona/Backup/helpers.tsx msgid "The download link is expired" msgstr "" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx +msgid "The Mask Network Cloud Backup feature will be deactivated on April 30, 2025. Please use alternative cloud backup services or local backup solutions." +msgstr "" + #: dashboard/pages/CreateMaskWallet/CreateMnemonic/index.tsx msgid "The mnemonic word has been copied, please keep it in a safe place." msgstr "" @@ -2700,6 +2795,7 @@ msgstr "" msgid "The persona name already exists." msgstr "" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx msgid "The phone number is incorrect." msgstr "通訊號碼錯誤" @@ -2986,6 +3082,8 @@ msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx msgid "Verification code sent" msgstr "驗證碼已傳送" @@ -3096,8 +3194,8 @@ msgid "Welcome Back" msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -msgid "Welcome to Mask Cloud Services" -msgstr "" +#~ msgid "Welcome to Mask Cloud Services" +#~ msgstr "" #: popups/pages/Personas/Home/UI.tsx msgid "Welcome to Mask Network" @@ -3107,6 +3205,10 @@ msgstr "" msgid "Welcome to use Mask Network" msgstr "" +#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +msgid "when you click Add Google Drive button,you will be forwarded to Google authorization pages." +msgstr "" + #: popups/pages/Wallet/ExportPrivateKey/index.tsx msgid "Write down mnemonic words" msgstr "" @@ -3120,8 +3222,8 @@ msgid "You could check the verification result on Mask Pop-up after few minutes. msgstr "" #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx -msgid "You have backed up your data." -msgstr "" +#~ msgid "You have backed up your data." +#~ msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #~ msgid "You have recovered" @@ -3153,6 +3255,10 @@ msgstr "" msgid "Your connection to this site is not encrypted which can be modified by a hostile third party, we strongly suggest you reject this request." msgstr "" +#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +msgid "Your file has been successfully merged into the browser data." +msgstr "" + #: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx msgid "Your payment password encrypts wallet data and is needed to unlocking the wallet, transaction confirmations and signing. The password is never stored, and there is no way to recover it if you forget it." msgstr "" diff --git a/packages/polyfills/types/env.d.ts b/packages/polyfills/types/env.d.ts index 6c3d331fdbf0..154eabfc661c 100644 --- a/packages/polyfills/types/env.d.ts +++ b/packages/polyfills/types/env.d.ts @@ -4,6 +4,7 @@ declare module NodeJS { readonly MASK_SENTRY_DSN: string readonly MASK_SENTRY: 'enabled' | 'disabled' readonly MASK_MIXPANEL: 'enabled' | 'disabled' + readonly GOOGLE_CLIENT_ID: string /** * Run skip tests like * RUN_SKIP_TESTS=1 pnpm test diff --git a/packages/shared-base/src/KVStorage/index.ts b/packages/shared-base/src/KVStorage/index.ts index 3bbd3ef675e2..fe9727a0217f 100644 --- a/packages/shared-base/src/KVStorage/index.ts +++ b/packages/shared-base/src/KVStorage/index.ts @@ -34,6 +34,8 @@ export interface BackupConfig { localBackupAt: string | null cloudBackupAt: string | null cloudBackupMethod: BackupAccountType | null + googleToken: string | null + googleAccount: string | null } export const PersistentStorages = { @@ -53,6 +55,8 @@ export const PersistentStorages = { localBackupAt: '', cloudBackupAt: '', cloudBackupMethod: null, + googleToken: '', + googleAccount: '', }, }), /** diff --git a/packages/shared-base/src/helpers/relativeRouteOf.ts b/packages/shared-base/src/helpers/relativeRouteOf.ts index 9a63dc981db2..2b7d9593b980 100644 --- a/packages/shared-base/src/helpers/relativeRouteOf.ts +++ b/packages/shared-base/src/helpers/relativeRouteOf.ts @@ -8,3 +8,7 @@ export function relativeRouteOf(parent: PopupRoutes | DashboardRoutes) { return child.slice(parent.length).replace(/^\//, '') } } +export function relativeRoute(parent: string, child: string) { + if (!child.startsWith(parent)) throw new Error() + return child.slice(parent.length).replace(/^\//, '') +} diff --git a/packages/shared-base/src/types/Routes.ts b/packages/shared-base/src/types/Routes.ts index bfb4b23743ff..baabdb6839b7 100644 --- a/packages/shared-base/src/types/Routes.ts +++ b/packages/shared-base/src/types/Routes.ts @@ -7,6 +7,13 @@ export enum DashboardRoutes { RecoveryPersona = '/setup/recovery', SignUpPersonaMnemonic = '/setup/sign-up/mnemonic', SignUpPersonaOnboarding = '/setup/sign-up/onboarding', + Backup = '/setup/backup', + BackupLocal = '/setup/backup/local', + BackupCloud = '/setup/backup/cloud', + BackupCloudMaskNetwork = '/setup/backup/cloud/mask-network', + BackupCloudGoogleDrive = '/setup/backup/cloud/google-drive', + BackupPreview = '/setup/backup/cloud/preview', + LocalBackup = '/setup/local-backup', CloudBackup = '/setup/cloud-backup', CloudBackupPreview = '/setup/cloud-backup-preview', diff --git a/packages/shared/src/UI/components/Alert/index.tsx b/packages/shared/src/UI/components/Alert/index.tsx index 322c52a9753e..3a3dcb948528 100644 --- a/packages/shared/src/UI/components/Alert/index.tsx +++ b/packages/shared/src/UI/components/Alert/index.tsx @@ -1,10 +1,11 @@ import { Icons } from '@masknet/icons' import { makeStyles } from '@masknet/theme' -import { Box, Typography } from '@mui/material' +import { Box, Typography, type AlertProps } from '@mui/material' import type { BoxProps } from '@mui/system' import { memo } from 'react' -const useStyles = makeStyles()((theme) => ({ +const useStyles = makeStyles()((theme, _, refs) => ({ + warning: {}, alert: { display: 'flex', borderRadius: 4, @@ -15,21 +16,31 @@ const useStyles = makeStyles()((theme) => ({ color: theme.palette.maskColor.main, backdropFilter: 'blur(5px)', gap: 10, + [`&.${refs.warning}`]: { + backgroundColor: 'rgba(255, 177, 0, 0.1)', + color: '#FFB100', + }, }, })) -interface Props extends BoxProps { +interface Props extends BoxProps, Pick { open?: boolean onClose?: () => void } -export const Alert = memo(function Alert({ className, children, open, onClose, ...rest }: Props) { +export const Alert = memo(function Alert({ className, children, open, onClose, severity, ...rest }: Props) { const { classes, cx } = useStyles() if (!open) return null return ( - - + + {severity === 'warning' ? + + : } {children} diff --git a/packages/shared/src/UI/components/CountryCodePicker/index.tsx b/packages/shared/src/UI/components/CountryCodePicker/index.tsx index 64b4b8d95f32..9669db07d278 100644 --- a/packages/shared/src/UI/components/CountryCodePicker/index.tsx +++ b/packages/shared/src/UI/components/CountryCodePicker/index.tsx @@ -1,18 +1,18 @@ import { List, ListItemButton, ListItemIcon, ListItemText, Popover, TextField, Typography } from '@mui/material' import { memo, useDeferredValue, useMemo, useState } from 'react' +import { Trans, useLingui } from '@lingui/react/macro' import { Icons } from '@masknet/icons' +import { COUNTRIES, useRenderPhraseCallbackOnDepsChange } from '@masknet/shared-base-ui' import { makeStyles } from '@masknet/theme' import Fuse from 'fuse.js' import { EmptyStatus } from '../../../index.js' -import { COUNTRIES, useRenderPhraseCallbackOnDepsChange } from '@masknet/shared-base-ui' import { getCountryFlag } from '../../../utils/getCountryFlag.js' -import { Trans, useLingui } from '@lingui/react/macro' const useStyles = makeStyles()((theme) => ({ paper: { padding: theme.spacing(2), - borderRadius: 8, + borderRadius: 24, width: 320, height: 316, background: theme.palette.maskColor.bottom, @@ -98,10 +98,10 @@ export const CountryCodePicker = memo(({ open, anchorEl, onClose() }} classes={{ paper: classes.paper }} - anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }} + anchorOrigin={{ vertical: 'bottom', horizontal: 'left' }} transformOrigin={{ vertical: 'top', - horizontal: 'center', + horizontal: 'left', }}> ({ + button: { + padding: 0, + }, +})) export interface PhoneNumberFieldProps extends Omit { code: string @@ -12,6 +19,7 @@ export interface PhoneNumberFieldProps extends Omit(null) @@ -32,7 +40,10 @@ export function PhoneNumberField({ code, onCodeChange, ...rest }: PhoneNumberFie ...rest.InputProps, disableUnderline: true, startAdornment: ( - + + + MaskBackup file + { + const blob = await googleDriveClient.downloadFile(file.id) + const url = URL.createObjectURL(blob) + downloadBackup(url, file.name) + URL.revokeObjectURL(url) + }} + /> + + + } + size="large" + color="primary" + loading={loading} + disabled={loading} + onClick={() => { + if (!user.googleAccount) return + BackupPreviewModal.open({ + code: 'google-drive', + type: BackupAccountType.Email, + account: user.googleAccount!, + isUpload: true, + onUpload: uploadFile, + uploadButtonLabel: Back Up to Google Drive, + }) + }}> + Back Up to Google Drive + + + + ) +}) diff --git a/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx b/packages/mask/dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx similarity index 79% rename from packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx rename to packages/mask/dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx index c4b90b7b5700..97c6d5e9a6ba 100644 --- a/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx @@ -3,15 +3,15 @@ import { Trans } from '@lingui/react/macro' import { Alert, useParamTab } from '@masknet/shared' import { BackupAccountType, DashboardRoutes } from '@masknet/shared-base' import { makeStyles } from '@masknet/theme' -import { Box, Portal, Radio, RadioGroup, Typography } from '@mui/material' +import { Box, Radio, RadioGroup, Typography } from '@mui/material' import { memo, useState } from 'react' -import { useNavigate, useOutletContext } from 'react-router-dom' +import { useNavigate } from 'react-router-dom' import { useAsyncFn } from 'react-use' import urlcat from 'urlcat' import { UserContext } from '../../../../../shared-ui/index.js' +import { OutletPortal } from '../../../../components/OutletPortal.js' import { PrimaryButton } from '../../../../components/PrimaryButton/index.js' import { fetchDownloadLink } from '../../../../utils/api.js' -import type { PortalContainerProps } from '../types.js' import { CloudBackupFormContext, type CloudBackupFormInputs } from './CloudBackupFormContext.js' import { EmailForm } from './EmailForm.js' import { PhoneForm } from './PhoneForm.js' @@ -38,7 +38,6 @@ const useStyles = makeStyles()((theme) => ({ export const Component = memo(function MaskNetworkBackup() { const { classes } = useStyles() - const { portalContainerRef } = useOutletContext() const { user, updateUser } = UserContext.useContainer() const navigate = useNavigate() const [showAlert, setShowAlert] = useState(true) @@ -51,17 +50,35 @@ export const Component = memo(function MaskNetworkBackup() { const incorrectCodeMsg = t`The code is incorrect.` const [{ loading }, handleSubmit] = useAsyncFn( async (data: CloudBackupFormInputs) => { - const response = await fetchDownloadLink({ - account: isEmail ? data.email : `+${data.countryCode} ${data.phone}`, - type: isEmail ? BackupAccountType.Email : BackupAccountType.Phone, - code: data.code, - }).catch((error) => { - if (error.status === 400) { + try { + const response = await fetchDownloadLink({ + account: isEmail ? data.email : `+${data.countryCode} ${data.phone}`, + type: isEmail ? BackupAccountType.Email : BackupAccountType.Phone, + code: data.code, + }) + + if (!response) return + + updateUser({ + email: data.email || user.email, + phone: data.phone ? `${data.countryCode} ${data.phone}` : user.phone, + }) + reset() + navigate( + urlcat(DashboardRoutes.BackupPreview, { + ...response, + type: isEmail ? BackupAccountType.Email : BackupAccountType.Phone, + account: isEmail ? data.email : `+${data.countryCode} ${data.phone}`, + code: data.code, + }), + ) + } catch (err) { + if ((err as any).status === 400) { setError('code', { type: 'custom', message: incorrectCodeMsg, }) - } else if (error.status === 404) { + } else if ((err as any).status === 404) { reset() // No cloud backup file navigate( @@ -72,23 +89,7 @@ export const Component = memo(function MaskNetworkBackup() { }), ) } - }) - - if (!response) return - - updateUser({ - email: data.email || user.email, - phone: data.phone ? `${data.countryCode} ${data.phone}` : user.phone, - }) - reset() - navigate( - urlcat(DashboardRoutes.BackupPreview, { - ...response, - type: isEmail ? BackupAccountType.Email : BackupAccountType.Phone, - account: isEmail ? data.email : `+${data.countryCode} ${data.phone}`, - code: data.code, - }), - ) + } }, [isEmail, setError, reset, navigate, updateUser, user], ) @@ -123,7 +124,7 @@ export const Component = memo(function MaskNetworkBackup() { cloud backup services or local backup solutions. - portalContainerRef.current}> + Continue - + ) }) diff --git a/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx b/packages/mask/dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx similarity index 86% rename from packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx rename to packages/mask/dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx index 530cd6572f6c..09bd9e5287d2 100644 --- a/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx @@ -37,17 +37,19 @@ export const PhoneForm = memo(function PhoneForm() { const [countryCode, phone] = watch(['countryCode', 'phone']) const handleSendVerificationCode = useCallback(async () => { - const response = await sendCode({ - account: `+${countryCode}${phone}`, - type: BackupAccountType.Phone, - scenario: user.phone ? Scenario.change : Scenario.create, - locale: lang.includes('zh') ? Locale.zh : Locale.en, - }).catch((error) => { - showSnackbar(error.message, { variant: 'error' }) - }) + try { + const response = await sendCode({ + account: `+${countryCode}${phone}`, + type: BackupAccountType.Phone, + scenario: user.phone ? Scenario.change : Scenario.create, + locale: lang.includes('zh') ? Locale.zh : Locale.en, + }) - if (response) { - showSnackbar(Verification code sent, { variant: 'success' }) + if (response) { + showSnackbar(Verification code sent, { variant: 'success' }) + } + } catch (error) { + showSnackbar((error as Error).message, { variant: 'error' }) } }, [phone, user, lang, countryCode]) diff --git a/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx b/packages/mask/dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx similarity index 95% rename from packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx rename to packages/mask/dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx index f036fc163db9..1fa1da1da517 100644 --- a/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx @@ -4,14 +4,14 @@ import { EmptyStatus, formatFileSize } from '@masknet/shared' import type { BackupAccountType } from '@masknet/shared-base' import { DashboardRoutes } from '@masknet/shared-base' import { ActionButton, TextOverflowTooltip, makeStyles } from '@masknet/theme' -import { Box, Button, Portal, Typography } from '@mui/material' +import { Box, Button, Typography } from '@mui/material' import { format as formatDateTime, fromUnixTime } from 'date-fns' import { memo, useCallback, useMemo } from 'react' -import { useNavigate, useOutletContext, useSearchParams } from 'react-router-dom' +import { useNavigate, useSearchParams } from 'react-router-dom' import { useAsyncFn } from 'react-use' +import { OutletPortal } from '../../../../components/OutletPortal.js' import { BackupPreviewModal, MergeBackupModal } from '../../../../modals/modals.js' -import { createBackupName, downloadBackup, getFileName, progressDownload } from '../helpers.js' -import type { PortalContainerProps } from '../types.js' +import { createBackupName, downloadBackup, getFileName, progressDownload } from '../../../../utils/api.js' const useStyles = makeStyles()((theme) => ({ header: { @@ -66,7 +66,6 @@ const useStyles = makeStyles()((theme) => ({ export const Component = memo(function CloudBackupPreview() { const { classes, theme } = useStyles() const [params] = useSearchParams() - const { portalContainerRef } = useOutletContext() const navigate = useNavigate() @@ -190,11 +189,11 @@ export const Component = memo(function CloudBackupPreview() { } {!previewInfo.downloadLink ? - portalContainerRef.current}> + Back - + : null} ) diff --git a/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/index.tsx b/packages/mask/dashboard/pages/SetupPersona/Backup/Cloud/index.tsx similarity index 97% rename from packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/index.tsx rename to packages/mask/dashboard/pages/SetupPersona/Backup/Cloud/index.tsx index 11747dd10c30..85b39ce44da8 100644 --- a/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/index.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/Backup/Cloud/index.tsx @@ -5,8 +5,8 @@ import { makeStyles } from '@masknet/theme' import { Box, Typography } from '@mui/material' import { memo } from 'react' import { Outlet, useMatch, useNavigate, useOutletContext } from 'react-router-dom' -import type { PortalContainerProps } from '../types.js' import { CloudBackupFormContext } from './CloudBackupFormContext.js' +import type { PortalContainerProps } from '../../../../components/OutletPortal.js' const useStyles = makeStyles()((theme, _, refs) => ({ container: { diff --git a/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx b/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx deleted file mode 100644 index 2d30815c02b3..000000000000 --- a/packages/mask/dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +++ /dev/null @@ -1,369 +0,0 @@ -import { t } from '@lingui/core/macro' -import { formatFileSize } from '@masknet/shared' -import { Trans } from '@lingui/react/macro' -import { Icons } from '@masknet/icons' -import { BackupAccountType, EMPTY_LIST } from '@masknet/shared-base' -import { format } from 'date-fns' -import { makeStyles, useCustomSnackbar } from '@masknet/theme' -import { GoogleDriveClient, type DriveFile } from '@masknet/web3-providers' -import { - Box, - Button, - Paper, - Portal, - Table, - TableBody, - TableCell, - TableContainer, - TableHead, - Tooltip, - TableRow, - Typography, - Skeleton, -} from '@mui/material' -import { compact, range, uniqBy } from 'lodash-es' -import { memo, useMemo, useState } from 'react' -import { useOutletContext } from 'react-router-dom' -import { useAsyncFn } from 'react-use' -import { UserContext } from '../../../../../shared-ui/index.js' -import { PrimaryButton } from '../../../../components/PrimaryButton/index.js' -import { useGoogleDriveFiles } from '../../../../hooks/useGoogleDriveFiles.js' -import type { PortalContainerProps } from '../types.js' -import { BackupPreviewModal, MergeBackupModal } from '../../../../modals/modals.js' -import { - clearGoogleDriveAccessToken, - createBackupName, - downloadBackup, - getGoogleDriveAccessToken, - progressDownload, -} from '../helpers.js' -import { MoreMenu } from '../../../../components/MoreMenu/index.js' - -const useStyles = makeStyles()((theme) => ({ - container: { - display: 'flex', - flexDirection: 'column', - gap: theme.spacing(1.5), - paddingBottom: theme.spacing(6), - }, - header: { - display: 'flex', - justifyContent: 'space-between', - alignItems: 'center', - }, - user: { - display: 'flex', - flexDirection: 'column', - gap: theme.spacing(1), - }, - providerName: { - fontWeight: 400, - fontSize: 14, - lineHeight: '18px', - height: 18, - color: theme.palette.maskColor.second, - }, - userAccount: { - fontWeight: 700, - fontSize: 14, - lineHeight: '18px', - height: 18, - color: theme.palette.maskColor.main, - }, - title: { - fontSize: 16, - fontWeight: 700, - lineHeight: '20px', - }, - subtitle: { - fontSize: 14, - fontWeight: 400, - lineHeight: '18px', - }, - folder: { - fontSize: 14, - fontWeight: 700, - lineHeight: '18px', - }, - tableContainer: { - border: `1px solid ${theme.palette.maskColor.line}`, - borderRadius: 8, - overflow: 'hidden', - height: 340, - marginTop: theme.spacing(2), - }, - table: { - borderRadius: 8, - borderCollapse: 'collapse', - borderSpacing: 0, - }, - tableHeadCell: { - borderBottom: `1px solid ${theme.palette.maskColor.line}`, - fontSize: 14, - fontWeight: 700, - lineHeight: '18px', - padding: theme.spacing(1.5), - height: 18, - }, - bodyCell: { - padding: theme.spacing(0, 1.5), - fontSize: 14, - height: 42, - lineHeight: '18px', - fontWeight: 400, - color: theme.palette.maskColor.main, - verticalAlign: 'middle', - }, - cellText: { - fontSize: 14, - }, - actionButton: { - color: theme.palette.maskColor.second, - '&:hover': { - color: theme.palette.maskColor.main, - }, - }, - actions: { - display: 'flex', - flexDirection: 'column', - gap: theme.spacing(1.5), - }, - action: { - padding: 6, - height: 30, - display: 'flex', - gap: 4, - alignItems: 'center', - cursor: 'pointer', - borderRadius: 8, - '&:hover': { - backgroundColor: theme.palette.maskColor.bg, - }, - }, - actionLabel: { - fontSize: 14, - fontWeight: 700, - lineHeight: '18px', - color: theme.palette.maskColor.main, - }, -})) - -export const Component = memo(function GoogleDriveBackup() { - const { classes } = useStyles() - const { user, updateUser } = UserContext.useContainer() - const { showSnackbar } = useCustomSnackbar() - const { portalContainerRef } = useOutletContext() - const googleDriveClient = useMemo( - () => new GoogleDriveClient(getGoogleDriveAccessToken, clearGoogleDriveAccessToken), - [], - ) - const { data: files = EMPTY_LIST, refetch, isLoading } = useGoogleDriveFiles(googleDriveClient) - - const login = async () => { - try { - const userInfo = await googleDriveClient.getUserInfo() - updateUser({ - googleAccount: userInfo.email || '', - }) - } catch (err) { - showSnackbar(t`Failed to login: ${(err as Error).message}`, { variant: 'error' }) - } - } - - const [uploadedFile, setUploadedFile] = useState(null) - - const [{ loading }, uploadFile] = useAsyncFn( - async (content: ArrayBuffer) => { - const name = createBackupName() - const file = new File([content], name, { type: 'application/octet-stream' }) - const result = await googleDriveClient.uploadFile(file) - const date = new Date() - setUploadedFile({ - ...result, - name, - size: file.size.toString(), - createdTime: date.toISOString(), - modifiedTime: date.toISOString(), - }) - refetch() - }, - [googleDriveClient], - ) - - const mergedFiles = useMemo(() => uniqBy(compact([...files, uploadedFile]), (x) => x.id), [files, uploadedFile]) - - if (!user.googleAccount) { - return ( - - - Add google Drive - - - - when you click Add Google Drive button,you will be forwarded to Google authorization pages. - - - - - - - ) - } - - const downloadAndMerge = async (file: DriveFile) => { - await MergeBackupModal.openAndWaitForClose({ - download: () => { - return progressDownload(() => googleDriveClient.requestFile(file.id), file.size ? +file.size : 0) - }, - fileName: file.name, - account: user.googleAccount!, - size: file.size || '0', - uploadedAt: new Date(file.modifiedTime).getTime(), - }) - } - return ( - - - - - Google Drive - - {user.googleAccount} - - - - - MaskBackup file - - - - - - File name - - - Size - - - Date & Time - - - Actions - - - - {isLoading ? - - {range(3).map((index) => ( - - - - - - - - - - - - - - - ))} - - : - {mergedFiles.map((file, index) => ( - - {file.name} - - {file.size ? formatFileSize(+file.size) : '--'} - - - - - {format(file.modifiedTime, 'LLL d, yyyy')} - - - - - - {({ close }) => ( -
-
{ - close() - downloadAndMerge(file) - }}> - - - Merge to Browser - -
-
{ - const blob = await googleDriveClient.downloadFile( - file.id, - ) - const url = URL.createObjectURL(blob) - downloadBackup(url, file.name) - URL.revokeObjectURL(url) - close() - }}> - - - Download - -
-
- )} -
-
-
- ))} -
- } -
-
-
- portalContainerRef.current}> - } - size="large" - color="primary" - loading={loading} - disabled={loading} - onClick={() => { - if (!user.googleAccount) return - BackupPreviewModal.open({ - code: 'google-drive', - type: BackupAccountType.Email, - account: user.googleAccount!, - isUpload: true, - onUpload: uploadFile, - uploadButtonLabel: Back Up to Google Drive, - }) - }}> - Back Up to Google Drive - - -
- ) -}) diff --git a/packages/mask/dashboard/pages/SetupPersona/Backup/LocalBackup.tsx b/packages/mask/dashboard/pages/SetupPersona/Backup/Local.tsx similarity index 93% rename from packages/mask/dashboard/pages/SetupPersona/Backup/LocalBackup.tsx rename to packages/mask/dashboard/pages/SetupPersona/Backup/Local.tsx index 10d0c10351ca..4de49680129c 100644 --- a/packages/mask/dashboard/pages/SetupPersona/Backup/LocalBackup.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/Backup/Local.tsx @@ -5,23 +5,21 @@ import { Icons } from '@masknet/icons' import { LoadingStatus } from '@masknet/shared' import { MimeType } from '@masknet/shared-base' import { encode } from '@msgpack/msgpack' -import { Box, Portal } from '@mui/material' +import { Box } from '@mui/material' import { format as formatDateTime } from 'date-fns' import { memo } from 'react' import { Controller } from 'react-hook-form' -import { useOutletContext } from 'react-router-dom' import { useAsyncFn } from 'react-use' import { UserContext } from '../../../../shared-ui/index.js' import { PersonasBackupPreview, WalletsBackupPreview } from '../../../components/BackupPreview/index.js' +import { OutletPortal } from '../../../components/OutletPortal.js' import PasswordField from '../../../components/PasswordField/index.js' import { PrimaryButton } from '../../../components/PrimaryButton/index.js' import { useBackupFormState, type BackupFormInputs } from '../../../hooks/useBackupFormState.js' import { useBackupPreviewInfo } from '../../../hooks/useBackupPreviewInfo.js' -import type { PortalContainerProps } from './types.js' -import { downloadBackup } from './helpers.js' +import { downloadBackup } from '../../../utils/api.js' export const Component = memo(function LocalBackup() { - const { portalContainerRef } = useOutletContext() const { t } = useLingui() const { user, updateUser } = UserContext.useContainer() const { @@ -113,7 +111,7 @@ export const Component = memo(function LocalBackup() { : null} : } - portalContainerRef.current}> + } size="large" @@ -124,7 +122,7 @@ export const Component = memo(function LocalBackup() { onClick={handleSubmit(handleFormSubmit)}> Download Backup - + ) }) diff --git a/packages/mask/dashboard/pages/SetupPersona/Backup/helpers.tsx b/packages/mask/dashboard/pages/SetupPersona/Backup/helpers.tsx deleted file mode 100644 index 460fdac9e33e..000000000000 --- a/packages/mask/dashboard/pages/SetupPersona/Backup/helpers.tsx +++ /dev/null @@ -1,94 +0,0 @@ -import Services from '#services' -import { t } from '@lingui/core/macro' -import { fetchJSON } from '@masknet/web3-providers/helpers' -import { format as formatDateTime } from 'date-fns' - -interface Options { - code: string - clientId: string - redirectUri: string -} - -interface TokenResponse { - access_token: string - error_description: string -} - -export async function requestGoogleDriveAccessToken(options: Options) { - return fetchJSON('https://oauth2.googleapis.com/token', { - method: 'POST', - headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, - body: new URLSearchParams({ - code: options.code, - client_id: options.clientId, - redirect_uri: options.redirectUri, - grant_type: 'authorization_code', - }), - }) -} - -export function downloadBackup(url: string, name?: string) { - const a = document.createElement('a') - a.href = url - if (name) a.download = name - a.click() -} - -export function getGoogleDriveAccessToken() { - return Services.Backup.getAccessToken() -} -export function clearGoogleDriveAccessToken() { - return Services.Backup.clearAccessToken() -} - -export function createBackupName() { - return `mask-network-keystore-backup-${formatDateTime(new Date(), 'yyyy-MM-dd')}.bin` -} - -export function getFileName(url: string) { - try { - const urlObj = new URL(url) - return urlObj.pathname.split('/').pop() - } catch { - return '' - } -} - -/** - * Download general backup file (no need to authenticate) - */ -export async function* progressDownload(request: string | null | (() => Promise), size?: number) { - if (!request) return - const response = - typeof request === 'function' ? - await request() - : await fetch(request, { - method: 'GET', - cache: 'no-store', - }) - - if (!response.ok || response.status !== 200) { - throw new Error(t`The download link is expired`) - } - if (!response.body) return - const reader = response.body.getReader() - const contentLength = response.headers.get('Content-Length') || size - - if (!contentLength || !reader) return - - let received = 0 - const chunks: number[] = [] - while (true) { - const { done, value } = await reader.read() - - if (done || !value) { - yield 100 - break - } - chunks.push(...value) - received += value.length - - yield (received / Number(contentLength)) * 100 - } - return Uint8Array.from(chunks).buffer -} diff --git a/packages/mask/dashboard/pages/SetupPersona/Backup/index.tsx b/packages/mask/dashboard/pages/SetupPersona/Backup/index.tsx index 6bd737cbb996..25994a653e87 100644 --- a/packages/mask/dashboard/pages/SetupPersona/Backup/index.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/Backup/index.tsx @@ -3,9 +3,10 @@ import { MaskTabList, makeStyles } from '@masknet/theme' import { TabContext } from '@mui/lab' import { Box, Tab, Typography } from '@mui/material' import { memo, useRef } from 'react' -import { Outlet, useLocation, useNavigate } from 'react-router-dom' -import { CloudBackupRoutes } from './constants.js' -import { StorageType } from './types.js' +import { Outlet } from 'react-router-dom' +import { StorageType } from '../types.js' +import { usePathTab, type TabPathTuple } from '@masknet/shared' +import { DashboardRoutes } from '@masknet/shared-base' const useStyles = makeStyles()((theme) => ({ title: { @@ -43,14 +44,20 @@ const useStyles = makeStyles()((theme) => ({ }, })) -export const Backup = memo(function Backup() { +const tuples: TabPathTuple[] = [ + [StorageType.Local, DashboardRoutes.BackupLocal], + [ + StorageType.Cloud, + DashboardRoutes.BackupCloud, + DashboardRoutes.BackupCloudMaskNetwork, + DashboardRoutes.BackupCloudGoogleDrive, + ], +] + +export const Component = memo(function Backup() { const { classes } = useStyles() - const location = useLocation() - const { pathname } = location - const isCloud = CloudBackupRoutes.includes(pathname) - const tab = isCloud ? StorageType.Cloud : StorageType.Local - const navigate = useNavigate() + const [tab, handleTabChange] = usePathTab(tuples) const portalContainerRef = useRef(null) @@ -68,12 +75,7 @@ export const Backup = memo(function Backup() {
- { - navigate(value === StorageType.Cloud ? '/setup/backup/cloud' : '/setup/backup/local') - }} - aria-label="Cloud Backup Methods"> + Locale Backup} diff --git a/packages/mask/dashboard/pages/SetupPersona/Backup/types.ts b/packages/mask/dashboard/pages/SetupPersona/Backup/types.ts deleted file mode 100644 index ae301402a683..000000000000 --- a/packages/mask/dashboard/pages/SetupPersona/Backup/types.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface PortalContainerProps { - portalContainerRef: React.RefObject -} - -export enum StorageType { - Local = 'local', - Cloud = 'cloud', -} diff --git a/packages/mask/dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx b/packages/mask/dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx index 3435aca27aca..92a3d951db80 100644 --- a/packages/mask/dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx @@ -1,13 +1,13 @@ -import { memo, useCallback } from 'react' +import { Trans, useLingui } from '@lingui/react/macro' +import { BackupAccountType } from '@masknet/shared-base' import { CountdownButton, makeStyles, useCustomSnackbar } from '@masknet/theme' -import { Controller } from 'react-hook-form' import { Box, TextField } from '@mui/material' -import { sendCode } from '../../../utils/api.js' -import { BackupAccountType } from '@masknet/shared-base' -import { Locale, Scenario } from '../../../utils/type.js' +import { memo, useCallback } from 'react' +import { Controller } from 'react-hook-form' import { UserContext, useLanguage } from '../../../../shared-ui/index.js' import { CloudBackupFormContext } from '../../../contexts/CloudBackupFormContext.js' -import { Trans, useLingui } from '@lingui/react/macro' +import { sendCode } from '../../../utils/api.js' +import { Locale, Scenario } from '../../../utils/type.js' const useStyles = makeStyles()((theme) => ({ send: { @@ -35,22 +35,21 @@ export const EmailForm = memo(function EmailForm() { const email = watch('email') const handleSendVerificationCode = useCallback(async () => { - const response = await sendCode({ - account: email, - type: BackupAccountType.Email, - scenario: user.email ? Scenario.change : Scenario.create, - locale: language.includes('zh') ? Locale.zh : Locale.en, - }).catch((error) => { + try { + const response = await sendCode({ + account: email, + type: BackupAccountType.Email, + scenario: user.email ? Scenario.change : Scenario.create, + locale: language.includes('zh') ? Locale.zh : Locale.en, + }) + + if (response) showSnackbar(Verification code sent, { variant: 'success' }) + } catch (error) { + const message = (error as any).message showSnackbar( - error.message.includes('SendTemplatedEmail') ? - Invalid email address format. - : error.message, + message.includes('SendTemplatedEmail') ? Invalid email address format. : message, { variant: 'error' }, ) - }) - - if (response) { - showSnackbar(Verification code sent, { variant: 'success' }) } }, [email, user, language]) diff --git a/packages/mask/dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx b/packages/mask/dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx index a4b87117b4ad..290350e53a24 100644 --- a/packages/mask/dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx @@ -37,17 +37,19 @@ export const PhoneForm = memo(function PhoneForm() { const [countryCode, phone] = watch(['countryCode', 'phone']) const handleSendVerificationCode = useCallback(async () => { - const response = await sendCode({ - account: `+${countryCode}${phone}`, - type: BackupAccountType.Phone, - scenario: user.phone ? Scenario.change : Scenario.create, - locale: lang.includes('zh') ? Locale.zh : Locale.en, - }).catch((error) => { - showSnackbar(error.message, { variant: 'error' }) - }) + try { + const response = await sendCode({ + account: `+${countryCode}${phone}`, + type: BackupAccountType.Phone, + scenario: user.phone ? Scenario.change : Scenario.create, + locale: lang.includes('zh') ? Locale.zh : Locale.en, + }) - if (response) { - showSnackbar(Verification code sent, { variant: 'success' }) + if (response) { + showSnackbar(Verification code sent, { variant: 'success' }) + } + } catch (error) { + showSnackbar((error as Error).message, { variant: 'error' }) } }, [phone, user, lang, countryCode]) diff --git a/packages/mask/dashboard/pages/SetupPersona/CloudBackup/index.tsx b/packages/mask/dashboard/pages/SetupPersona/CloudBackup/index.tsx index 751af6f19074..c69551403473 100644 --- a/packages/mask/dashboard/pages/SetupPersona/CloudBackup/index.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/CloudBackup/index.tsx @@ -69,17 +69,34 @@ const CloudBackupInner = memo(function CloudBackupInner() { const [{ loading }, handleSubmit] = useAsyncFn( async (data: CloudBackupFormInputs) => { - const response = await fetchDownloadLink({ - account: currentTab === tabs.email ? data.email : `+${data.countryCode} ${data.phone}`, - type: currentTab === tabs.email ? BackupAccountType.Email : BackupAccountType.Phone, - code: data.code, - }).catch((error) => { - if (error.status === 400) { + try { + const response = await fetchDownloadLink({ + account: currentTab === tabs.email ? data.email : `+${data.countryCode} ${data.phone}`, + type: currentTab === tabs.email ? BackupAccountType.Email : BackupAccountType.Phone, + code: data.code, + }) + + if (!response) return + + updateUser({ + email: data.email || user.email, + phone: data.phone ? `${data.countryCode} ${data.phone}` : user.phone, + }) + navigate( + urlcat(DashboardRoutes.CloudBackupPreview, { + ...response, + type: currentTab === tabs.email ? BackupAccountType.Email : BackupAccountType.Phone, + account: currentTab === tabs.email ? data.email : `+${data.countryCode} ${data.phone}`, + code: data.code, + }), + ) + } catch (error) { + if ((error as any).status === 400) { formState.setError('code', { type: 'custom', message: _(msg`The code is incorrect.`), }) - } else if (error.status === 404) { + } else if ((error as any).status === 404) { // No cloud backup file navigate( urlcat(DashboardRoutes.CloudBackupPreview, { @@ -89,22 +106,7 @@ const CloudBackupInner = memo(function CloudBackupInner() { }), ) } - }) - - if (!response) return - - updateUser({ - email: data.email || user.email, - phone: data.phone ? `${data.countryCode} ${data.phone}` : user.phone, - }) - navigate( - urlcat(DashboardRoutes.CloudBackupPreview, { - ...response, - type: currentTab === tabs.email ? BackupAccountType.Email : BackupAccountType.Phone, - account: currentTab === tabs.email ? data.email : `+${data.countryCode} ${data.phone}`, - code: data.code, - }), - ) + } }, [_, currentTab, tabs, formState, navigate, updateUser, user], ) diff --git a/packages/mask/dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx b/packages/mask/dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx index 5be0bab4e62f..e3decb43bd6f 100644 --- a/packages/mask/dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx @@ -11,7 +11,7 @@ import { useNavigate, useSearchParams } from 'react-router-dom' import { useAsyncFn } from 'react-use' import { SetupFrameController } from '../../../components/SetupFrame/index.js' import { BackupPreviewModal, ConfirmDialog, MergeBackupModal } from '../../../modals/modals.js' -import { createBackupName, getFileName, progressDownload } from '../Backup/helpers.js' +import { createBackupName, getFileName, progressDownload } from '../../../utils/api.js' const useStyles = makeStyles()((theme) => ({ title: { diff --git a/packages/mask/dashboard/pages/SetupPersona/Mnemonic/index.tsx b/packages/mask/dashboard/pages/SetupPersona/Mnemonic/index.tsx index 3bb9797e0bf9..612c6f6c5681 100644 --- a/packages/mask/dashboard/pages/SetupPersona/Mnemonic/index.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/Mnemonic/index.tsx @@ -126,7 +126,7 @@ export const Component = memo(function SignUpMnemonic() { }, [words]) const handleRecovery = useCallback(() => { - navigate(DashboardRoutes.RecoveryPersona) + navigate(DashboardRoutes.Recovery) }, []) const { value } = useAsync(async () => { diff --git a/packages/mask/dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx b/packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx similarity index 80% rename from packages/mask/dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx rename to packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx index 650e2e333e39..0b33b5eed5aa 100644 --- a/packages/mask/dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx @@ -1,17 +1,17 @@ +import Services from '#services' +import { Trans, useLingui } from '@lingui/react/macro' import { decryptBackup } from '@masknet/backup-format' import { decode, encode } from '@msgpack/msgpack' import { Box } from '@mui/material' -import { memo, useCallback, useLayoutEffect, useState, type ReactNode } from 'react' -import Services from '#services' -import { usePersonaRecovery } from '../../../contexts/index.js' -import { fetchBackupValue } from '../../../utils/api.js' -import PasswordField from '../../PasswordField/index.js' -import { PrimaryButton } from '../../PrimaryButton/index.js' -import { AccountStatusBar } from '../AccountStatusBar.js' -import { BackupInfoCard } from '../BackupInfoCard.js' +import { memo, useCallback, useState, type ReactNode } from 'react' +import { OutletPortal } from '../../../../components/OutletPortal.js' +import PasswordField from '../../../../components/PasswordField/index.js' +import { PrimaryButton } from '../../../../components/PrimaryButton/index.js' +import { AccountStatusBar } from '../../../../components/Restore/AccountStatusBar.js' +import { BackupInfoCard } from '../../../../components/Restore/BackupInfoCard.js' +import { fetchBackupValue } from '../../../../utils/api.js' import { RestoreContext } from './RestoreProvider.js' import { RestoreStep } from './restoreReducer.js' -import { Trans, useLingui } from '@lingui/react/macro' export const ConfirmBackupInfo = memo(function ConfirmBackupInfo() { const { t } = useLingui() @@ -56,15 +56,6 @@ export const ConfirmBackupInfo = memo(function ConfirmBackupInfo() { dispatch({ type: 'TO_INPUT' }) }, []) - const { fillSubmitOutlet } = usePersonaRecovery() - useLayoutEffect(() => { - return fillSubmitOutlet( - - Restore - , - ) - }, [handleNext, loading]) - if (!backupFileInfo) return null return ( @@ -89,6 +80,11 @@ export const ConfirmBackupInfo = memo(function ConfirmBackupInfo() { helperText={errorMessage} /> + + + Restore + + ) }) diff --git a/packages/mask/dashboard/components/Restore/RestoreFromCloud/EmailField.tsx b/packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx similarity index 66% rename from packages/mask/dashboard/components/Restore/RestoreFromCloud/EmailField.tsx rename to packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx index 72f909e79360..17b7071fa769 100644 --- a/packages/mask/dashboard/components/Restore/RestoreFromCloud/EmailField.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx @@ -1,16 +1,16 @@ +import { Trans, useLingui } from '@lingui/react/macro' +import { BackupAccountType } from '@masknet/shared-base' import { SendingCodeField, useCustomSnackbar } from '@masknet/theme' import { Box, TextField } from '@mui/material' -import { memo, useCallback, useLayoutEffect, useState, type ReactNode } from 'react' +import { memo, useCallback, useState, type ReactNode } from 'react' import { useAsyncFn } from 'react-use' -import { usePersonaRecovery } from '../../../contexts/RecoveryContext.js' -import { sendCode, type RestoreQueryError } from '../../../utils/api.js' -import { emailRegexp } from '../../../utils/regexp.js' -import { BackupAccountType } from '@masknet/shared-base' -import { Locale, Scenario } from '../../../utils/type.js' -import { PrimaryButton } from '../../PrimaryButton/index.js' -import { useLanguage } from '../../../../shared-ui/index.js' +import { useLanguage } from '../../../../../shared-ui/index.js' +import { OutletPortal } from '../../../../components/OutletPortal.js' +import { PrimaryButton } from '../../../../components/PrimaryButton/index.js' +import { sendCode, type RestoreQueryError } from '../../../../utils/api.js' +import { emailRegexp } from '../../../../utils/regexp.js' +import { Locale, Scenario } from '../../../../utils/type.js' import { RestoreContext } from './RestoreProvider.js' -import { Trans, useLingui } from '@lingui/react/macro' export const EmailField = memo(function EmailField() { const { t } = useLingui() @@ -47,35 +47,8 @@ export const EmailField = memo(function EmailField() { setInvalidEmail(!isValid) } - const { fillSubmitOutlet } = usePersonaRecovery() const emailNotReady = !account || invalidEmail const disabled = emailNotReady || code.length !== 6 - useLayoutEffect(() => { - return fillSubmitOutlet( - { - dispatch({ type: 'SET_LOADING', loading: true }) - try { - const backupFileInfo = await downloadBackupInfo(BackupAccountType.Email, account, code) - dispatch({ type: 'SET_BACKUP_INFO', info: backupFileInfo }) - dispatch({ type: 'NEXT_STEP' }) - } catch (err) { - const message = (err as RestoreQueryError).message - if (['code not found', 'code mismatch'].includes(message)) - setCodeError(Invalid verification code.) - else setError(message) - } finally { - dispatch({ type: 'SET_LOADING', loading: false }) - } - }} - loading={loading} - disabled={disabled}> - Continue - , - ) - }, [account, code, loading, disabled]) const hasError = sendCodeError?.message.includes('SendTemplatedEmail') || invalidEmail || !!error const errorMessage = @@ -121,6 +94,31 @@ export const EmailField = memo(function EmailField() { }} /> + + { + dispatch({ type: 'SET_LOADING', loading: true }) + try { + const backupFileInfo = await downloadBackupInfo(BackupAccountType.Email, account, code) + dispatch({ type: 'SET_BACKUP_INFO', info: backupFileInfo }) + dispatch({ type: 'NEXT_STEP' }) + } catch (err) { + const message = (err as RestoreQueryError).message + if (['code not found', 'code mismatch'].includes(message)) + setCodeError(Invalid verification code.) + else setError(message) + } finally { + dispatch({ type: 'SET_LOADING', loading: false }) + } + }} + loading={loading} + disabled={disabled}> + Continue + + ) }) diff --git a/packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx b/packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx new file mode 100644 index 000000000000..e0c6b0338948 --- /dev/null +++ b/packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx @@ -0,0 +1,168 @@ +import { Trans } from '@lingui/react/macro' +import { Icons } from '@masknet/icons' +import { EMPTY_LIST } from '@masknet/shared-base' +import { makeStyles } from '@masknet/theme' +import { GoogleDriveClient, type DriveFile } from '@masknet/web3-providers' +import { Box, Button, Typography } from '@mui/material' +import { memo, useMemo, useState } from 'react' +import { UserContext } from '../../../../../shared-ui/index.js' +import { GoogleDriveFileTable } from '../../../../components/GoogleDriveFileTable.js' +import { GoogleDriveLogin } from '../../../../components/GoogleDriveLogin.js' +import { OutletPortal } from '../../../../components/OutletPortal.js' +import { PrimaryButton } from '../../../../components/PrimaryButton/index.js' +import { useGoogleDriveFiles } from '../../../../hooks/useGoogleDriveFiles.js' +import { MergeBackupModal, RestoreBackupModal } from '../../../../modals/modals.js' +import { + clearGoogleDriveAccessToken, + downloadBackup, + getGoogleDriveAccessToken, + progressDownload, +} from '../../../../utils/api.js' + +const useStyles = makeStyles()((theme) => ({ + container: { + display: 'flex', + flexDirection: 'column', + gap: theme.spacing(1.5), + }, + header: { + display: 'flex', + justifyContent: 'space-between', + alignItems: 'center', + }, + user: { + display: 'flex', + flexDirection: 'column', + gap: theme.spacing(1), + }, + providerName: { + fontWeight: 400, + fontSize: 14, + lineHeight: '18px', + height: 18, + color: theme.palette.maskColor.second, + }, + userAccount: { + fontWeight: 700, + fontSize: 14, + lineHeight: '18px', + height: 18, + color: theme.palette.maskColor.main, + }, + folder: { + fontSize: 14, + fontWeight: 700, + lineHeight: '18px', + }, + tableContainer: { + height: 340, + marginTop: theme.spacing(2), + }, +})) + +export const Component = memo(function GoogleDriveRecovery() { + const { classes } = useStyles() + const { user, updateUser } = UserContext.useContainer() + const googleDriveClient = useMemo( + () => new GoogleDriveClient(getGoogleDriveAccessToken, clearGoogleDriveAccessToken), + [], + ) + const { data: files = EMPTY_LIST, isLoading } = useGoogleDriveFiles(googleDriveClient) + + const [selectedFile, setSelectedFile] = useState(null) + + if (!user.googleAccount) { + return + } + + const downloadAndMerge = async (file: DriveFile) => { + await MergeBackupModal.openAndWaitForClose({ + download: () => { + return progressDownload(() => googleDriveClient.requestFile(file.id), file.size ? +file.size : 0) + }, + fileName: file.name, + account: user.googleAccount!, + size: file.size || '0', + uploadedAt: new Date(file.modifiedTime).getTime(), + }) + } + return ( + + + + + Google Drive + + {user.googleAccount} + + + + + MaskBackup file + { + const blob = await googleDriveClient.downloadFile(file.id) + const url = URL.createObjectURL(blob) + downloadBackup(url, file.name) + Promise.resolve().then(() => { + URL.revokeObjectURL(url) + }) + }} + /> + + + } + size="large" + color="primary" + disabled={!selectedFile} + onClick={async () => { + if (!user.googleAccount || !selectedFile?.id) return + await RestoreBackupModal.openAndWaitForClose({ + download: () => { + return progressDownload( + () => googleDriveClient.requestFile(selectedFile.id), + selectedFile.size ? +selectedFile.size : 0, + ) + }, + fileName: selectedFile.name, + account: user.googleAccount, + size: selectedFile.size || '0', + uploadedAt: new Date(selectedFile.modifiedTime).getTime(), + restoreSuccessMessage: ( + + You have successfully restored the backup from Google Drive to your browser. + + ), + restoreErrorMessage: ( + + Failed to restore the backup from Google Drive to your browser. Please try again. + + ), + }) + setSelectedFile(null) + }}> + Recover + + + + ) +}) diff --git a/packages/mask/dashboard/components/Restore/RestoreFromCloud/InputForm.tsx b/packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/InputForm.tsx similarity index 100% rename from packages/mask/dashboard/components/Restore/RestoreFromCloud/InputForm.tsx rename to packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/InputForm.tsx index 460f94435a3e..1ed8c88549f4 100644 --- a/packages/mask/dashboard/components/Restore/RestoreFromCloud/InputForm.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/InputForm.tsx @@ -3,9 +3,9 @@ import { makeStyles } from '@masknet/theme' import { Box, FormControlLabel, Radio, RadioGroup, type BoxProps } from '@mui/material' import { memo, useState } from 'react' import { BackupAccountType } from '@masknet/shared-base' -import { RestoreContext } from './RestoreProvider.js' import { EmailField } from './EmailField.js' import { PhoneField } from './PhoneField.js' +import { RestoreContext } from './RestoreProvider.js' import { RestoreStep } from './restoreReducer.js' const useStyles = makeStyles()((theme) => ({ diff --git a/packages/mask/dashboard/components/Restore/RestoreFromCloud/index.tsx b/packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/MaskNetwork.tsx similarity index 63% rename from packages/mask/dashboard/components/Restore/RestoreFromCloud/index.tsx rename to packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/MaskNetwork.tsx index 66ac26731eb9..df3f45ea53bc 100644 --- a/packages/mask/dashboard/components/Restore/RestoreFromCloud/index.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/MaskNetwork.tsx @@ -1,45 +1,24 @@ -import urlcat from 'urlcat' -import { memo, useCallback, useLayoutEffect, useState } from 'react' -import { useNavigate } from 'react-router-dom' -import { Box } from '@mui/material' -import { DashboardRoutes, BackupAccountType } from '@masknet/shared-base' -import { useCustomSnackbar } from '@masknet/theme' import Services from '#services' +import { BackupAccountType, DashboardRoutes } from '@masknet/shared-base' +import { useCustomSnackbar } from '@masknet/theme' +import { Box } from '@mui/material' +import { memo, useCallback, useState } from 'react' +import { useNavigate } from 'react-router-dom' +import urlcat from 'urlcat' -import { ConfirmSynchronizePasswordDialog } from '../ConfirmSynchronizePasswordDialog.js' -import { usePersonaRecovery } from '../../../contexts/index.js' -import { PrimaryButton } from '../../PrimaryButton/index.js' +import { Trans } from '@lingui/react/macro' +import { Alert, PersonaContext } from '@masknet/shared' +import { UserContext } from '../../../../../shared-ui/index.js' +import { BackupPreview } from '../../../../components/BackupPreview/index.js' +import { OutletPortal } from '../../../../components/OutletPortal.js' +import { PrimaryButton } from '../../../../components/PrimaryButton/index.js' +import { ConfirmSynchronizePasswordDialog } from '../../../../components/Restore/ConfirmSynchronizePasswordDialog.js' +import { ConfirmBackupInfo } from './ConfirmBackupInfo.js' +import { InputForm } from './InputForm.js' import { RestoreContext } from './RestoreProvider.js' import { RestoreStep } from './restoreReducer.js' -import { InputForm } from './InputForm.js' -import { ConfirmBackupInfo } from './ConfirmBackupInfo.js' -import { UserContext } from '../../../../shared-ui/index.js' -import { BackupPreview } from '../../BackupPreview/index.js' -import { PersonaContext } from '@masknet/shared' -import { Trans } from '@lingui/react/macro' - -interface RestoreProps { - onRestore: () => Promise -} - -const Restore = memo(function Restore({ onRestore }: RestoreProps) { - const { fillSubmitOutlet } = usePersonaRecovery() - const { state } = RestoreContext.useContainer() - - useLayoutEffect(() => { - return fillSubmitOutlet( - - Restore - , - ) - }, [onRestore, state.loading]) - if (!state.backupSummary) return null - - return -}) - -const RestoreFromCloudInner = memo(function RestoreFromCloudInner() { +const MaskNetworkInner = memo(function MaskNetworkInner() { const navigate = useNavigate() const { showSnackbar } = useCustomSnackbar() const { user, updateUser } = UserContext.useContainer() @@ -96,13 +75,25 @@ const RestoreFromCloudInner = memo(function RestoreFromCloudInner() { onCloseSynchronizePassword() }, [account, password, updateUser]) + const showButton = ![RestoreStep.InputEmail, RestoreStep.InputPhone, RestoreStep.Decrypt].includes(state.step) + const [showAlert, setShowAlert] = useState(true) return ( {[RestoreStep.InputEmail, RestoreStep.InputPhone].includes(state.step) ? - + <> + + setShowAlert(false)}> + + The Mask Network Cloud Backup feature will be deactivated on April 30, 2025. Please use + alternative cloud backup services or local backup solutions. + + + : state.step === RestoreStep.Decrypt ? - : } + : state.backupSummary ? + + : null} {openSynchronizePasswordDialog ? : null} + {showButton ? + + + Restore + + + : null} ) }) -export const RestoreFromCloud = memo(function RestoreFromCloud() { +export const Component = memo(function RestoreFromCloud() { return ( - + ) }) diff --git a/packages/mask/dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx b/packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx similarity index 68% rename from packages/mask/dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx rename to packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx index 789c0330aca9..5f8d2568e696 100644 --- a/packages/mask/dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx @@ -1,19 +1,19 @@ +import { Trans, useLingui } from '@lingui/react/macro' +import { PhoneNumberField } from '@masknet/shared' +import { BackupAccountType } from '@masknet/shared-base' import { SendingCodeField, useCustomSnackbar } from '@masknet/theme' import { Box } from '@mui/material' import guessCallingCode from 'guess-calling-code' import { pick } from 'lodash-es' -import { memo, useCallback, useEffect, useLayoutEffect, useMemo, useState, type ReactNode } from 'react' +import { memo, useCallback, useEffect, useMemo, useState, type ReactNode } from 'react' import { useAsyncFn } from 'react-use' -import { usePersonaRecovery } from '../../../contexts/index.js' -import { useLanguage } from '../../../../shared-ui/index.js' -import { sendCode, type RestoreQueryError } from '../../../utils/api.js' -import { phoneRegexp } from '../../../utils/regexp.js' -import { BackupAccountType } from '@masknet/shared-base' -import { Locale, Scenario } from '../../../utils/type.js' -import { PrimaryButton } from '../../PrimaryButton/index.js' +import { useLanguage } from '../../../../../shared-ui/index.js' +import { OutletPortal } from '../../../../components/OutletPortal.js' +import { PrimaryButton } from '../../../../components/PrimaryButton/index.js' +import { sendCode, type RestoreQueryError } from '../../../../utils/api.js' +import { phoneRegexp } from '../../../../utils/regexp.js' +import { Locale, Scenario } from '../../../../utils/type.js' import { RestoreContext } from './RestoreProvider.js' -import { PhoneNumberField } from '@masknet/shared' -import { Trans, useLingui } from '@lingui/react/macro' export const PhoneField = memo(function PhoneField() { const { t } = useLingui() @@ -60,35 +60,8 @@ export const PhoneField = memo(function PhoneField() { }) }, [account, language]) - const { fillSubmitOutlet } = usePersonaRecovery() const phoneNotReady = !account || invalidPhone || !phoneRegexp.test(account) const disabled = phoneNotReady || code.length !== 6 || !!error || loading - useLayoutEffect(() => { - return fillSubmitOutlet( - { - dispatch({ type: 'SET_LOADING', loading: true }) - try { - const backupInfo = await downloadBackupInfo(BackupAccountType.Phone, account, code) - dispatch({ type: 'SET_BACKUP_INFO', info: backupInfo }) - dispatch({ type: 'NEXT_STEP' }) - } catch (err) { - const message = (err as RestoreQueryError).message - if (['code not found', 'code mismatch'].includes(message)) - setCodeError(Invalid verification code.) - else setError(message) - } finally { - dispatch({ type: 'SET_LOADING', loading: false }) - } - }} - loading={loading} - disabled={disabled}> - Continue - , - ) - }, [account, code, disabled, loading]) return ( <> @@ -121,6 +94,31 @@ export const PhoneField = memo(function PhoneField() { }} /> + + { + dispatch({ type: 'SET_LOADING', loading: true }) + try { + const backupInfo = await downloadBackupInfo(BackupAccountType.Phone, account, code) + dispatch({ type: 'SET_BACKUP_INFO', info: backupInfo }) + dispatch({ type: 'NEXT_STEP' }) + } catch (err) { + const message = (err as RestoreQueryError).message + if (['code not found', 'code mismatch'].includes(message)) + setCodeError(Invalid verification code.) + else setError(message) + } finally { + dispatch({ type: 'SET_LOADING', loading: false }) + } + }} + loading={loading} + disabled={disabled}> + Continue + + ) }) diff --git a/packages/mask/dashboard/components/Restore/RestoreFromCloud/RestoreProvider.tsx b/packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/RestoreProvider.tsx similarity index 91% rename from packages/mask/dashboard/components/Restore/RestoreFromCloud/RestoreProvider.tsx rename to packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/RestoreProvider.tsx index 29696cb8da40..9567cc994721 100644 --- a/packages/mask/dashboard/components/Restore/RestoreFromCloud/RestoreProvider.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/RestoreProvider.tsx @@ -1,8 +1,8 @@ import { useCallback, useReducer } from 'react' import { createContainer } from '@masknet/shared-base-ui' -import { fetchDownloadLink } from '../../../utils/api.js' import type { BackupAccountType } from '@masknet/shared-base' import { initialState, restoreReducer } from './restoreReducer.js' +import { fetchDownloadLink } from '../../../../utils/api.js' function useRestoreState() { const [state, dispatch] = useReducer(restoreReducer, initialState) diff --git a/packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/index.tsx b/packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/index.tsx new file mode 100644 index 000000000000..14fb77646064 --- /dev/null +++ b/packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/index.tsx @@ -0,0 +1,79 @@ +import { Trans } from '@lingui/react/macro' +import { Icons } from '@masknet/icons' +import { DashboardRoutes } from '@masknet/shared-base' +import { makeStyles } from '@masknet/theme' +import { Box, Typography } from '@mui/material' +import { memo } from 'react' +import { Outlet, useMatch, useNavigate, useOutletContext } from 'react-router-dom' +import type { PortalContainerProps } from '../../../../components/OutletPortal.js' + +const useStyles = makeStyles()((theme, _, refs) => ({ + container: { + display: 'flex', + flexDirection: 'column', + gap: theme.spacing(2), + }, + providers: { + display: 'flex', + gap: theme.spacing(1.5), + }, + providerName: { + fontWeight: 700, + fontSize: 14, + lineHeight: '18px', + height: 18, + color: theme.palette.maskColor.main, + }, + activeButton: { + backgroundColor: theme.palette.maskColor.input, + }, + toggleButton: { + backgroundColor: theme.palette.maskColor.bottom, + cursor: 'pointer', + boxSizing: 'border-box', + borderRadius: 18, + height: 34, + gap: theme.spacing(1), + border: `1px solid ${theme.palette.maskColor.line}`, + display: 'inline-flex', + padding: theme.spacing(1, 1.5), + [`&.${refs.activeButton}`]: { + backgroundColor: theme.palette.maskColor.input, + }, + }, +})) + +export const Component = memo(function CloudBackup() { + const outletContext = useOutletContext() + const { classes, cx } = useStyles() + + const navigate = useNavigate() + const match = useMatch(DashboardRoutes.RecoveryCloudGoogleDrive) // MaskBook is index + const isGoogleDrive = !!match + + return ( + + + + + + + + ) +}) diff --git a/packages/mask/dashboard/components/Restore/RestoreFromCloud/restoreReducer.ts b/packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/restoreReducer.ts similarity index 98% rename from packages/mask/dashboard/components/Restore/RestoreFromCloud/restoreReducer.ts rename to packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/restoreReducer.ts index dc09023815c6..edb290be9b5e 100644 --- a/packages/mask/dashboard/components/Restore/RestoreFromCloud/restoreReducer.ts +++ b/packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/restoreReducer.ts @@ -1,7 +1,7 @@ import type { BackupSummary } from '@masknet/backup-format' import { produce } from 'immer' -import { type BackupFileInfo } from '../../../utils/type.js' import { BackupAccountType } from '@masknet/shared-base' +import type { BackupFileInfo } from '../../../../utils/type.js' export enum RestoreStep { InputEmail = 'InputEmail', diff --git a/packages/mask/dashboard/components/Restore/RestorePersonaFromLocal.tsx b/packages/mask/dashboard/pages/SetupPersona/Recovery/Local.tsx similarity index 75% rename from packages/mask/dashboard/components/Restore/RestorePersonaFromLocal.tsx rename to packages/mask/dashboard/pages/SetupPersona/Recovery/Local.tsx index 76c504d1042d..02fbe430fe9a 100644 --- a/packages/mask/dashboard/components/Restore/RestorePersonaFromLocal.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/Recovery/Local.tsx @@ -1,19 +1,22 @@ -import { memo, useCallback, useLayoutEffect, useMemo, useState, type ReactNode } from 'react' -import { useAsync } from 'react-use' -import { Box, Button, Typography } from '@mui/material' -import { type BackupSummary, decryptBackup } from '@masknet/backup-format' +import Services from '#services' +import { Trans, useLingui } from '@lingui/react/macro' +import { decryptBackup, type BackupSummary } from '@masknet/backup-format' import { Icons } from '@masknet/icons' import { delay } from '@masknet/kit' -import { FileFrame, UploadDropArea } from '@masknet/shared' +import { FileFrame, PersonaContext, UploadDropArea } from '@masknet/shared' +import { DashboardRoutes } from '@masknet/shared-base' import { makeStyles, useCustomSnackbar } from '@masknet/theme' import { decode, encode } from '@msgpack/msgpack' -import Services from '#services' -import { usePersonaRecovery } from '../../contexts/RecoveryContext.js' -import PasswordField from '../PasswordField/index.js' -import { PrimaryButton } from '../PrimaryButton/index.js' -import { AccountStatusBar } from './AccountStatusBar.js' -import { BackupPreview } from '../BackupPreview/index.js' -import { Trans, useLingui } from '@lingui/react/macro' +import { Box, Button, Typography } from '@mui/material' +import { memo, useCallback, useMemo, useState, type ReactNode } from 'react' +import { useNavigate } from 'react-router-dom' +import { useAsync } from 'react-use' +import urlcat from 'urlcat' +import { BackupPreview } from '../../../components/BackupPreview/index.js' +import { OutletPortal } from '../../../components/OutletPortal.js' +import PasswordField from '../../../components/PasswordField/index.js' +import { PrimaryButton } from '../../../components/PrimaryButton/index.js' +import { AccountStatusBar } from '../../../components/Restore/AccountStatusBar.js' enum RestoreStatus { WaitingInput = 0, @@ -39,15 +42,12 @@ const useStyles = makeStyles()((theme) => ({ marginTop: 7, }, })) -interface RestoreFromLocalProps { - onRestore: (count?: number) => Promise -} -export const RestorePersonaFromLocal = memo(function RestorePersonaFromLocal({ onRestore }: RestoreFromLocalProps) { +export const Component = memo(function RecoveryLocalBackup() { const { t } = useLingui() const { classes, theme } = useStyles() const { showSnackbar } = useCustomSnackbar() - const { fillSubmitOutlet } = usePersonaRecovery() + const navigate = useNavigate() const [file, setFile] = useState(null) const [summary, setSummary] = useState(null) @@ -114,6 +114,22 @@ export const RestorePersonaFromLocal = memo(function RestorePersonaFromLocal({ o } }, [file, password]) + const { currentPersona } = PersonaContext.useContainer() + const hasNoPersona = !currentPersona + const onRestore = useCallback( + async (count?: number) => { + if (hasNoPersona) { + const lastedPersona = await Services.Identity.queryLastPersonaCreated() + if (lastedPersona) { + await Services.Settings.setCurrentPersonaIdentifier(lastedPersona) + await delay(1000) + } + } + navigate(urlcat(DashboardRoutes.SignUpPersonaOnboarding, { count }), { replace: true }) + }, + [hasNoPersona, Services.Settings.setCurrentPersonaIdentifier, navigate], + ) + const restoreDB = useCallback(async () => { try { setProcessing(true) @@ -140,21 +156,6 @@ export const RestorePersonaFromLocal = memo(function RestorePersonaFromLocal({ o return !file }, [loading, !file, restoreStatus, summary, !password]) - useLayoutEffect(() => { - return fillSubmitOutlet( - - {restoreStatus !== RestoreStatus.Verified ? - Continue - : Restore} - , - ) - }, [restoreStatus, decryptBackupFile, restoreDB, disabled, loading]) - return ( {restoreStatus !== RestoreStatus.Verified ? @@ -194,6 +195,19 @@ export const RestorePersonaFromLocal = memo(function RestorePersonaFromLocal({ o : null} + + + {restoreStatus !== RestoreStatus.Verified ? + Continue + : Restore} + + ) }) diff --git a/packages/mask/dashboard/pages/SetupPersona/Recovery/Phrase.tsx b/packages/mask/dashboard/pages/SetupPersona/Recovery/Phrase.tsx new file mode 100644 index 000000000000..f067fc8dbb53 --- /dev/null +++ b/packages/mask/dashboard/pages/SetupPersona/Recovery/Phrase.tsx @@ -0,0 +1,79 @@ +import Services from '#services' +import { Trans } from '@lingui/react/macro' +import { delay } from '@masknet/kit' +import { DashboardRoutes } from '@masknet/shared-base' +import { makeStyles } from '@masknet/theme' +import { Box, Typography } from '@mui/material' +import { some } from 'lodash-es' +import { memo, useCallback, useState, type ReactNode } from 'react' +import { useNavigate } from 'react-router-dom' +import { useList } from 'react-use' +import { DesktopMnemonicConfirm } from '../../../components/Mnemonic/index.js' +import { OutletPortal } from '../../../components/OutletPortal.js' +import { PrimaryButton } from '../../../components/PrimaryButton/index.js' +import { SignUpRoutePath } from '../../SignUp/routePath.js' + +const useStyles = makeStyles()((theme) => ({ + error: { + marginTop: theme.spacing(2), + color: theme.palette.maskColor.danger, + }, +})) + +export const Component = memo(function Phrase() { + const { classes } = useStyles() + const [error, setError] = useState() + + const [values, { updateAt, set: setMnemonic }] = useList(() => Array.from({ length: 12 }, () => '')) + const handleWordChange = useCallback((word: string, index: number) => { + updateAt(index, word) + setError?.(undefined) + }, []) + + const disabled = some(values, (value) => !value) + const navigate = useNavigate() + + const handleRestoreFromMnemonic = useCallback( + async (values: string[]) => { + try { + const persona = await Services.Identity.queryPersonaByMnemonic(values.join(' '), '') + if (persona) { + await Services.Settings.setCurrentPersonaIdentifier(persona) + // Waiting persona changed event notify + await delay(100) + navigate(DashboardRoutes.SignUpPersonaOnboarding, { replace: true }) + } else { + navigate(`${DashboardRoutes.SignUp}/${SignUpRoutePath.PersonaRecovery}`, { + replace: false, + state: { mnemonic: values }, + }) + } + } catch { + setError(Incorrect recovery phrase.) + } + }, + [navigate], + ) + const handleImport = useCallback(async () => handleRestoreFromMnemonic(values), [values, handleRestoreFromMnemonic]) + return ( + + + {error ? + + {error} + + : null} + + + + Continue + + + + ) +}) diff --git a/packages/mask/dashboard/pages/SetupPersona/Recovery/PrivateKey.tsx b/packages/mask/dashboard/pages/SetupPersona/Recovery/PrivateKey.tsx new file mode 100644 index 000000000000..38d86ce858d9 --- /dev/null +++ b/packages/mask/dashboard/pages/SetupPersona/Recovery/PrivateKey.tsx @@ -0,0 +1,111 @@ +import Services from '#services' +import { zodResolver } from '@hookform/resolvers/zod' +import { msg } from '@lingui/core/macro' +import { useLingui } from '@lingui/react' +import { Trans, useLingui as useLinguiMacro } from '@lingui/react/macro' +import { delay } from '@masknet/kit' +import { DashboardRoutes } from '@masknet/shared-base' +import { makeStyles } from '@masknet/theme' +import { Box } from '@mui/material' +import { memo, useCallback } from 'react' +import { Controller, useForm, type SubmitHandler, type UseFormSetError } from 'react-hook-form' +import { useNavigate } from 'react-router-dom' +import { z } from 'zod' +import { OutletPortal } from '../../../components/OutletPortal.js' +import PasswordField from '../../../components/PasswordField/index.js' +import { PrimaryButton } from '../../../components/PrimaryButton/index.js' +import { SignUpRoutePath } from '../../SignUp/routePath.js' + +const useStyles = makeStyles()((theme) => ({ + input: { + backgroundColor: theme.palette.maskColor.input, + color: theme.palette.maskColor.main, + }, +})) +const schema = z.object({ + privateKey: z.string(), +}) +export type FormInputs = z.infer +export const Component = memo(function RecoveryPrivateKey() { + const { classes } = useStyles() + const { t } = useLinguiMacro() + const { _ } = useLingui() + const navigate = useNavigate() + + const { + control, + handleSubmit, + setError, + formState: { errors, isSubmitting, isDirty }, + } = useForm({ + mode: 'onChange', + resolver: zodResolver(schema), + defaultValues: { + privateKey: '', + }, + }) + + const handleRestoreFromPrivateKey = useCallback( + async (data: FormInputs, onError: UseFormSetError) => { + try { + const persona = await Services.Identity.loginExistPersonaByPrivateKey(data.privateKey) + if (persona) { + await Services.Settings.setCurrentPersonaIdentifier(persona) + // Waiting persona changed event notify + await delay(100) + navigate(DashboardRoutes.SignUpPersonaOnboarding) + } else { + navigate(`${DashboardRoutes.SignUp}/${SignUpRoutePath.PersonaRecovery}`, { + replace: false, + state: { privateKey: data.privateKey }, + }) + } + } catch { + onError('privateKey', { type: 'value', message: _(msg`Incorrect Private Key`) }) + } + }, + [_, navigate], + ) + + const onSubmit: SubmitHandler = useCallback( + async (data) => { + await handleRestoreFromPrivateKey(data, setError) + }, + [navigate, setError, handleRestoreFromPrivateKey], + ) + + return ( + + ( + + )} + name="privateKey" + /> + + + Continue + + + + ) +}) diff --git a/packages/mask/dashboard/pages/SetupPersona/Recovery/index.tsx b/packages/mask/dashboard/pages/SetupPersona/Recovery/index.tsx index 99187d39ac49..7920bf6c5cd6 100644 --- a/packages/mask/dashboard/pages/SetupPersona/Recovery/index.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/Recovery/index.tsx @@ -1,54 +1,50 @@ -import { DashboardRoutes } from '@masknet/shared-base' -import type { UseFormSetError } from 'react-hook-form' -import { MaskTabList, makeStyles, useTabs } from '@masknet/theme' -import { TabContext, TabPanel } from '@mui/lab' -import { Button, Tab, Typography } from '@mui/material' -import { Box } from '@mui/system' -import { memo, use, useCallback, useMemo, useState, type ReactNode } from 'react' -import { useNavigate } from 'react-router-dom' -import { SetupFrameController } from '../../../components/SetupFrame/index.js' -import { RestoreFromPrivateKey, type FormInputs } from '../../../components/Restore/RestoreFromPrivateKey.js' -import { RestorePersonaFromLocal } from '../../../components/Restore/RestorePersonaFromLocal.js' -import { RestoreFromCloud } from '../../../components/Restore/RestoreFromCloud/index.js' -import { RecoveryProvider, RecoveryContext } from '../../../contexts/index.js' -import { RestoreFromMnemonic } from '../../../components/Restore/RestoreFromMnemonic.js' -import Services from '#services' -import { delay } from '@masknet/kit' - -import urlcat from 'urlcat' -import { SignUpRoutePath } from '../../SignUp/routePath.js' -import { PersonaContext } from '@masknet/shared' -import { msg } from '@lingui/core/macro' import { Trans } from '@lingui/react/macro' -import { useLingui } from '@lingui/react' +import { usePathTab, type TabPathTuple } from '@masknet/shared' +import { DashboardRoutes } from '@masknet/shared-base' +import { MaskTabList, makeStyles } from '@masknet/theme' +import { TabContext } from '@mui/lab' +import { Box, Tab, Typography } from '@mui/material' +import { memo, useRef } from 'react' +import { Link, Outlet } from 'react-router-dom' +import { RecoveryMethod } from './types.js' const useStyles = makeStyles()((theme) => ({ + container: { + display: 'flex', + flexDirection: 'column', + height: '100%', + }, header: { display: 'flex', - justifyContent: 'space-between', + gap: theme.spacing(1.5), }, - second: { - fontSize: 14, - lineHeight: '18px', - color: theme.palette.maskColor.second, + texts: { + display: 'flex', + flexDirection: 'column', + gap: theme.spacing(1.5), + marginRight: 'auto', }, setup: { fontSize: 14, lineHeight: '18px', color: theme.palette.maskColor.main, fontWeight: 700, + textDecoration: 'none', }, title: { fontSize: 36, lineHeight: 1.2, fontWeight: 700, }, + description: { + color: theme.palette.maskColor.second, + fontSize: 14, + }, tabContainer: { border: `1px solid ${theme.palette.maskColor.line}`, marginTop: theme.spacing(3), borderRadius: theme.spacing(1, 1, 0, 0), overflow: 'hidden', - marginBottom: 46, }, tabList: { background: @@ -61,157 +57,75 @@ const useStyles = makeStyles()((theme) => ({ fontSize: 16, fontWeight: 700, }, - panels: { - display: 'flex', - flexDirection: 'column', - alignItems: 'center', - padding: 0, - width: '100%', - }, panelContainer: { padding: theme.spacing(2), }, - buttonGroup: { - display: 'flex', - columnGap: 12, + exclaveActions: { + marginTop: 'auto', }, })) +const tuples: TabPathTuple[] = [ + [RecoveryMethod.Phrase, DashboardRoutes.RecoveryPhrase], + [RecoveryMethod.PrivateKey, DashboardRoutes.RecoveryPrivateKey], + [RecoveryMethod.Local, DashboardRoutes.RecoveryLocal], + [RecoveryMethod.Cloud, DashboardRoutes.RecoveryCloudMaskNetwork, DashboardRoutes.RecoveryCloudGoogleDrive], +] + export const Component = memo(function Recovery() { - const { _ } = useLingui() const { classes } = useStyles() - const { currentPersona } = PersonaContext.useContainer() - const tabPanelClasses = useMemo(() => ({ root: classes.panels }), [classes.panels]) - const navigate = useNavigate() - const [error, setError] = useState() - - const [currentTab, onChange, tabs] = useTabs('mnemonic', 'privateKey', 'local', 'cloud') - - const handleRestoreFromMnemonic = useCallback( - async (values: string[]) => { - try { - const persona = await Services.Identity.queryPersonaByMnemonic(values.join(' '), '') - if (persona) { - await Services.Settings.setCurrentPersonaIdentifier(persona) - // Waiting persona changed event notify - await delay(100) - navigate(DashboardRoutes.SignUpPersonaOnboarding, { replace: true }) - } else { - navigate(`${DashboardRoutes.SignUp}/${SignUpRoutePath.PersonaRecovery}`, { - replace: false, - state: { mnemonic: values }, - }) - } - } catch { - setError(Incorrect recovery phrase.) - } - }, - [navigate], - ) - const handleRestoreFromPrivateKey = useCallback( - async (data: FormInputs, onError: UseFormSetError) => { - try { - const persona = await Services.Identity.loginExistPersonaByPrivateKey(data.privateKey) - if (persona) { - await Services.Settings.setCurrentPersonaIdentifier(persona) - // Waiting persona changed event notify - await delay(100) - navigate(DashboardRoutes.SignUpPersonaOnboarding) - } else { - navigate(`${DashboardRoutes.SignUp}/${SignUpRoutePath.PersonaRecovery}`, { - replace: false, - state: { privateKey: data.privateKey }, - }) - } - } catch { - onError('privateKey', { type: 'value', message: _(msg`Incorrect Private Key`) }) - } - }, - [_, navigate], - ) + const [tab, handleTabChange] = usePathTab(tuples) - const hasNoPersona = !currentPersona - const onRestore = useCallback( - async (count?: number) => { - if (hasNoPersona) { - const lastedPersona = await Services.Identity.queryLastPersonaCreated() - if (lastedPersona) { - await Services.Settings.setCurrentPersonaIdentifier(lastedPersona) - await delay(1000) - } - } - navigate(urlcat(DashboardRoutes.SignUpPersonaOnboarding, { count }), { replace: true }) - }, - [hasNoPersona, Services.Settings.setCurrentPersonaIdentifier, navigate], - ) + const portalContainerRef = useRef(null) return ( - <> + - - Recover your data +
+ + Recover your data + + + Please select the appropriate method to restore your personal data. + +
+ + Create Persona -
- - - Please select the appropriate method to restore your personal data. - - -
- -
- - Recovery Phrase} - value={tabs.mnemonic} - /> - Private Key} - value={tabs.privateKey} - /> - Local Backup} value={tabs.local} /> - Cloud Backup} value={tabs.cloud} /> - -
-
- - - - - - - - - - - - -
+ +
+ + + Recovery Phrase} + value={RecoveryMethod.Phrase} + /> + Private Key} + value={RecoveryMethod.PrivateKey} + /> + Local Backup} + value={RecoveryMethod.Local} + /> + Cloud Backup} + value={RecoveryMethod.Cloud} + /> +
- - - - - +
+ +
+
+ + ) }) -function Outlet() { - const { classes } = useStyles() - return
{use(RecoveryContext).SubmitOutlet}
-} diff --git a/packages/mask/dashboard/pages/SetupPersona/Recovery/types.ts b/packages/mask/dashboard/pages/SetupPersona/Recovery/types.ts new file mode 100644 index 000000000000..d6c1e8e51187 --- /dev/null +++ b/packages/mask/dashboard/pages/SetupPersona/Recovery/types.ts @@ -0,0 +1,6 @@ +export enum RecoveryMethod { + Phrase = 'phrase', + PrivateKey = 'private-key', + Local = 'local', + Cloud = 'cloud', +} diff --git a/packages/mask/dashboard/pages/SetupPersona/SignUp/index.tsx b/packages/mask/dashboard/pages/SetupPersona/SignUp/index.tsx index 98cf9dfe37c0..5ee8e1083915 100644 --- a/packages/mask/dashboard/pages/SetupPersona/SignUp/index.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/SignUp/index.tsx @@ -1,17 +1,17 @@ -import { DashboardRoutes, EnhanceableSite, userGuideStatus } from '@masknet/shared-base' -import { useState, useCallback, memo, type ReactNode } from 'react' -import { useNavigate } from 'react-router-dom' import Services from '#services' +import { Trans, useLingui } from '@lingui/react/macro' import { delay } from '@masknet/kit' +import { DashboardRoutes, EnhanceableSite, userGuideStatus } from '@masknet/shared-base' import { makeStyles } from '@masknet/theme' -import { Typography, Button, TextField } from '@mui/material' +import { Button, TextField, Typography } from '@mui/material' import { Box } from '@mui/system' +import { memo, useCallback, useState, type ReactNode } from 'react' +import { useNavigate } from 'react-router-dom' +import { requestPermissionFromExtensionPage } from '../../../../shared-ui/index.js' +import { TwitterAdaptor } from '../../../../shared/site-adaptors/implementations/twitter.com.js' import { PrimaryButton } from '../../../components/PrimaryButton/index.js' import { SecondaryButton } from '../../../components/SecondaryButton/index.js' import { SetupFrameController } from '../../../components/SetupFrame/index.js' -import { TwitterAdaptor } from '../../../../shared/site-adaptors/implementations/twitter.com.js' -import { requestPermissionFromExtensionPage } from '../../../../shared-ui/index.js' -import { Trans, useLingui } from '@lingui/react/macro' const useStyles = makeStyles()((theme) => ({ header: { @@ -79,7 +79,7 @@ export const Component = memo(function SignUp() { }, []) const handleRecovery = useCallback(() => { - navigate(DashboardRoutes.RecoveryPersona) + navigate(DashboardRoutes.Recovery) }, []) return ( diff --git a/packages/mask/dashboard/pages/SetupPersona/index.tsx b/packages/mask/dashboard/pages/SetupPersona/index.tsx index aca0fa84e8bf..366126ebe7c2 100644 --- a/packages/mask/dashboard/pages/SetupPersona/index.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/index.tsx @@ -1,7 +1,6 @@ import { useMatch, type RouteObject } from 'react-router-dom' import { DashboardRoutes, relativeRoute as rr, relativeRouteOf } from '@masknet/shared-base' import { SetupFrame } from '../../components/SetupFrame/index.js' -import { Backup } from './Backup/index.js' const r = relativeRouteOf(DashboardRoutes.Setup) const Routes = DashboardRoutes @@ -10,41 +9,79 @@ export const personaRoutes: RouteObject[] = [ { path: r(Routes.Permissions), lazy: () => import('./Permissions/index.js') }, { path: r(Routes.PermissionsOnboarding), lazy: () => import('./PermissionOnboarding/index.js') }, { path: r(Routes.SignUpPersona), lazy: () => import('./SignUp/index.js') }, - { path: r(Routes.RecoveryPersona), lazy: () => import('./Recovery/index.js') }, { path: r(Routes.SignUpPersonaMnemonic), lazy: () => import('./Mnemonic/index.js') }, { path: r(Routes.SignUpPersonaOnboarding), lazy: () => import('./Onboarding/index.js') }, { path: r(Routes.Backup), - element: , + lazy: () => import('./Backup/index.js'), children: [ { index: true, - lazy: () => import('./Backup/LocalBackup.js'), + lazy: () => import('./Backup/Local.js'), }, { path: rr(Routes.Backup, Routes.BackupLocal), - lazy: () => import('./Backup/LocalBackup.js'), - index: true, + lazy: () => import('./Backup/Local.js'), }, { path: rr(Routes.Backup, Routes.BackupCloud), - lazy: () => import('./Backup/CloudBackup/index.js'), + lazy: () => import('./Backup/Cloud/index.js'), children: [ { index: true, - lazy: () => import('./Backup/CloudBackup/MaskNetworkBackup.js'), + lazy: () => import('./Backup/Cloud/MaskNetwork.js'), }, { path: rr(Routes.BackupCloud, Routes.BackupCloudMaskNetwork), - lazy: () => import('./Backup/CloudBackup/MaskNetworkBackup.js'), + lazy: () => import('./Backup/Cloud/MaskNetwork.js'), }, { path: rr(Routes.BackupCloud, Routes.BackupCloudGoogleDrive), - lazy: () => import('./Backup/CloudBackup/GoogleDriveBackup.js'), + lazy: () => import('./Backup/Cloud/GoogleDrive.js'), }, { path: rr(Routes.BackupCloud, Routes.BackupPreview), - lazy: () => import('./Backup/CloudBackup/Preview.js'), + lazy: () => import('./Backup/Cloud/Preview.js'), + }, + ], + }, + ], + }, + { + path: r(Routes.Recovery), + lazy: () => import('./Recovery/index.js'), + children: [ + { + index: true, + lazy: () => import('./Recovery/Phrase.js'), + }, + { + path: rr(Routes.Recovery, Routes.RecoveryPhrase), + lazy: () => import('./Recovery/Phrase.js'), + }, + { + path: rr(Routes.Recovery, Routes.RecoveryPrivateKey), + lazy: () => import('./Recovery/PrivateKey.js'), + }, + { + path: rr(Routes.Recovery, Routes.RecoveryLocal), + lazy: () => import('./Recovery/Local.js'), + }, + { + path: rr(Routes.Recovery, Routes.RecoveryCloud), + lazy: () => import('./Recovery/Cloud/index.js'), + children: [ + { + index: true, + lazy: () => import('./Recovery/Cloud/MaskNetwork.js'), + }, + { + path: rr(Routes.RecoveryCloud, Routes.RecoveryCloudMaskNetwork), + lazy: () => import('./Recovery/Cloud/MaskNetwork.js'), + }, + { + path: rr(Routes.RecoveryCloud, Routes.RecoveryCloudGoogleDrive), + lazy: () => import('./Recovery/Cloud/GoogleDrive.js'), }, ], }, diff --git a/packages/mask/dashboard/pages/SetupPersona/types.ts b/packages/mask/dashboard/pages/SetupPersona/types.ts new file mode 100644 index 000000000000..7869ac6684e8 --- /dev/null +++ b/packages/mask/dashboard/pages/SetupPersona/types.ts @@ -0,0 +1,4 @@ +export enum StorageType { + Local = 'local', + Cloud = 'cloud', +} diff --git a/packages/mask/dashboard/utils/api.ts b/packages/mask/dashboard/utils/api.ts index 15a88614c043..8febf02eaae2 100644 --- a/packages/mask/dashboard/utils/api.ts +++ b/packages/mask/dashboard/utils/api.ts @@ -1,5 +1,8 @@ +import Services from '#services' +import { t } from '@lingui/core/macro' import type { BackupAccountType } from '@masknet/shared-base' -import type { BackupFileInfo, Scenario, Locale } from './type.js' +import { format as formatDateTime } from 'date-fns' +import type { BackupFileInfo, Locale, Scenario } from './type.js' const BASE_RUL = 'https://vaalh28dbi.execute-api.ap-east-1.amazonaws.com/api' @@ -106,3 +109,69 @@ export function uploadBackupValue(uploadLink: string, content: ArrayBuffer, sign body: content, }) } + +export function downloadBackup(url: string, name?: string) { + const a = document.createElement('a') + a.href = url + if (name) a.download = name + a.click() +} + +export function createBackupName() { + return `mask-network-keystore-backup-${formatDateTime(new Date(), 'yyyy-MM-dd')}.bin` +} + +export function getFileName(url: string) { + try { + const urlObj = new URL(url) + return urlObj.pathname.split('/').pop() + } catch { + return '' + } +} + +/** + * Download general backup file (no need to authenticate) + */ +export async function* progressDownload(request: string | null | (() => Promise), size?: number) { + if (!request) return + const response = + typeof request === 'function' ? + await request() + : await fetch(request, { + method: 'GET', + cache: 'no-store', + }) + + if (!response.ok || response.status !== 200) { + throw new Error(t`The download link is expired`) + } + if (!response.body) return + const reader = response.body.getReader() + const contentLength = response.headers.get('Content-Length') || size + + if (!contentLength || !reader) return + + let received = 0 + const chunks: number[] = [] + while (true) { + const { done, value } = await reader.read() + + if (done || !value) { + yield 100 + break + } + chunks.push(...value) + received += value.length + + yield (received / Number(contentLength)) * 100 + } + return Uint8Array.from(chunks).buffer +} + +export function getGoogleDriveAccessToken(interactive?: boolean) { + return Services.Backup.getAccessToken(interactive) +} +export function clearGoogleDriveAccessToken() { + return Services.Backup.clearAccessToken() +} diff --git a/packages/mask/popups/modals/SwitchPersonaModal/index.tsx b/packages/mask/popups/modals/SwitchPersonaModal/index.tsx index d9faeea286bc..f25c5ed42d21 100644 --- a/packages/mask/popups/modals/SwitchPersonaModal/index.tsx +++ b/packages/mask/popups/modals/SwitchPersonaModal/index.tsx @@ -56,7 +56,7 @@ export const SwitchPersonaModal = memo(function SwitchPers size="small" variant="outlined" startIcon={} - onClick={() => handleOpenDashboard(DashboardRoutes.RecoveryPersona)}> + onClick={() => handleOpenDashboard(DashboardRoutes.Recovery)}> Recovery { browser.tabs.create({ active: true, - url: browser.runtime.getURL(`/dashboard.html#${DashboardRoutes.RecoveryPersona}`), + url: browser.runtime.getURL(`/dashboard.html#${DashboardRoutes.Recovery}`), }) if (navigator.userAgent.includes('Firefox')) { window.close() diff --git a/packages/mask/popups/pages/Settings/index.tsx b/packages/mask/popups/pages/Settings/index.tsx index fa0ba35994b1..245e94496c8d 100644 --- a/packages/mask/popups/pages/Settings/index.tsx +++ b/packages/mask/popups/pages/Settings/index.tsx @@ -273,7 +273,7 @@ export const Component = memo(function SettingsPage() { handleOpenDashboard(DashboardRoutes.RecoveryPersona)}> + onClick={() => handleOpenDashboard(DashboardRoutes.Recovery)}> Restore Database} diff --git a/packages/mask/shared-ui/locale/en-US.json b/packages/mask/shared-ui/locale/en-US.json index 69b623c7f48d..a502db7fb84e 100644 --- a/packages/mask/shared-ui/locale/en-US.json +++ b/packages/mask/shared-ui/locale/en-US.json @@ -65,6 +65,7 @@ "LP+1Z7": ["Add Network"], "68m9Nl": ["Add new address to an existing group"], "1LkMSp": ["Add Suggested Token"], + "O8PsYe": ["Add the file to Chrome's database"], "GtJJAj": ["Add Wallet"], "uv94aG": ["Added by user"], "8RF/Sx": ["Added successfully"], @@ -297,6 +298,8 @@ "9hzYBR": ["Failed to download and merge the backup: ", ["0"]], "0tkvsz": ["Failed to download and merge the backup."], "etATpN": ["Failed to login: ", ["0"]], + "qDIxZ+": ["Failed to restore the backup from Google Drive to your browser. Please try again."], + "e3I0CA": ["Failed to restore the backup: ", ["0"]], "mrAv9J": ["Failed to save network"], "ZsjtYe": ["Failed to set Avatar."], "RWoEqV": ["Failed to transfer token: ", ["message"]], @@ -571,6 +574,7 @@ "TZ0npN": ["ready 🚀"], "nVT2pJ": ["realMaskNetwork"], "lDgVWA": ["Receive"], + "OkofjH": ["Recover"], "XC7RGa": ["Recover your data"], "UBzbea": ["Recover your wallet"], "P9wzG/": ["Recovery"], @@ -592,8 +596,10 @@ "nvAt0H": ["Resource"], "yKu/3Y": ["Restore"], "Z3+V9p": ["Restore backup failed."], + "nGl2Ng": ["Restore Completed"], "AKLbfQ": ["Restore Database"], "uM6jnS": ["Restore failed"], + "KFwID2": ["Restore Failed"], "/LkuGq": ["Restore from a previous database backup"], "KisOjk": ["Restore or Login"], "6gRgw8": ["Retry"], @@ -823,6 +829,7 @@ "dyqtoj": ["You have recovered"], "V8x6o5": ["You have recovered "], "QU9aqK": ["You have signed with your wallet."], + "PeT3a5": ["You have successfully restored the backup from Google Drive to your browser."], "zkEW09": [ "You have verified your cloud password and recovered your backup. Do you want to let your cloud password and local backup password be the same?" ], @@ -832,6 +839,7 @@ "Your connection to this site is not encrypted which can be modified by a hostile third party, we strongly suggest you reject this request." ], "UDKbPj": ["Your file has been successfully merged into the browser data."], + "S2JNMm": ["Your file has been successfully restore into the browser data."], "Q68Nuc": [ "Your payment password encrypts wallet data and is needed to unlocking the wallet, transaction confirmations and signing. The password is never stored, and there is no way to recover it if you forget it." ], diff --git a/packages/mask/shared-ui/locale/en-US.po b/packages/mask/shared-ui/locale/en-US.po index 197632f803e1..c65f9a02fe9f 100644 --- a/packages/mask/shared-ui/locale/en-US.po +++ b/packages/mask/shared-ui/locale/en-US.po @@ -157,7 +157,7 @@ msgstr "" msgid "Add Contact" msgstr "" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/components/GoogleDriveLogin.tsx msgid "Add google Drive" msgstr "" @@ -174,6 +174,10 @@ msgstr "" msgid "Add Suggested Token" msgstr "" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Add the file to Chrome's database" +msgstr "" + #: popups/pages/Wallet/components/StartUp/index.tsx #: popups/pages/Wallet/SwitchWallet/index.tsx #: popups/pages/Wallet/CreateWallet/index.tsx @@ -304,15 +308,15 @@ msgid "Avatar set successfully" msgstr "" #: content-script/components/shared/SelectRecipients/SelectRecipientsDialog.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx #: dashboard/pages/CreateMaskWallet/CreateMnemonic/index.tsx #: popups/pages/Personas/ExportPrivateKey/index.tsx #: popups/pages/Personas/AccountDetail/UI.tsx msgid "Back" msgstr "" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx msgid "Back Up to Google Drive" msgstr "" @@ -351,13 +355,14 @@ msgstr "" msgid "Backup on {0}" msgstr "" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx -#: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx msgid "Backup password" msgstr "" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Local.tsx +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Settings/index.tsx @@ -570,8 +575,8 @@ msgstr "" msgid "Coming soon" msgstr "" +#: dashboard/pages/SetupPersona/Recovery/Local.tsx #: dashboard/components/Restore/RestoreWalletFromLocal.tsx -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx msgid "Completed" msgstr "" @@ -729,17 +734,19 @@ msgstr "" #: dashboard/pages/SignUp/steps/PersonaNameUI.tsx #: dashboard/pages/SetupPersona/SignUp/index.tsx +#: dashboard/pages/SetupPersona/Recovery/PrivateKey.tsx +#: dashboard/pages/SetupPersona/Recovery/Phrase.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx #: dashboard/pages/SetupPersona/Mnemonic/index.tsx #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx #: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx #: dashboard/pages/CreateMaskWallet/AddDeriveWallet/index.tsx #: dashboard/components/Restore/RestoreWalletFromLocal.tsx -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx #: dashboard/components/Restore/RestoreFromPrivateKey.tsx #: dashboard/components/Restore/RestoreFromMnemonic.tsx -#: dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx msgid "Continue" msgstr "" @@ -795,6 +802,7 @@ msgstr "" msgid "Create Password" msgstr "" +#: dashboard/pages/SetupPersona/Recovery/index.tsx #: popups/pages/Personas/Home/UI.tsx msgid "Create Persona" msgstr "" @@ -870,8 +878,8 @@ msgstr "" #~ msgid "Data merged from Mask Cloud Service to local successfully. Re-enter your password to encrypt and upload the new backup to Mask Cloud Service." #~ msgstr "" -#: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx -#: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx msgid "Decrypt failed, please check password" msgstr "" @@ -976,8 +984,8 @@ msgid "Done" msgstr "" #: content-script/components/InjectedComponents/AutoPasteFailedDialog.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx +#: dashboard/components/GoogleDriveFileTable.tsx msgid "Download" msgstr "" @@ -986,10 +994,11 @@ msgstr "" #~ msgstr "" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Local.tsx msgid "Download Backup" msgstr "" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Downloading" msgstr "" @@ -1015,16 +1024,16 @@ msgstr "" msgid "eg: X accounts, persona public keys, wallet addresses or ENS" msgstr "" +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Email" msgstr "" +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Email verification code" msgstr "" @@ -1150,6 +1159,7 @@ msgid "Failed to disconnect wallet" msgstr "" #. placeholder {0}: (err as Error).message +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Failed to download and merge the backup: {0}" msgstr "" @@ -1159,10 +1169,19 @@ msgstr "" #~ msgstr "" #. placeholder {0}: (err as Error).message -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/components/GoogleDriveLogin.tsx msgid "Failed to login: {0}" msgstr "" +#: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +msgid "Failed to restore the backup from Google Drive to your browser. Please try again." +msgstr "" + +#. placeholder {0}: (err as Error).message +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Failed to restore the backup: {0}" +msgstr "" + #: popups/pages/Wallet/EditNetwork/index.tsx msgid "Failed to save network" msgstr "" @@ -1320,8 +1339,10 @@ msgstr "" msgid "Give permission to access <0/> your {0}?" msgstr "" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/index.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/index.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx msgid "Google Drive" msgstr "" @@ -1444,10 +1465,12 @@ msgstr "" msgid "Incorrect backup password." msgstr "" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx msgid "Incorrect Backup Password." msgstr "" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Incorrect cloud backup password, please try again." @@ -1468,7 +1491,7 @@ msgid "Incorrect password" msgstr "" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: dashboard/hooks/useBackupFormState.ts #: dashboard/hooks/useBackupFormState.ts @@ -1488,12 +1511,12 @@ msgstr "" msgid "Incorrect Payment Password." msgstr "" -#: dashboard/pages/SetupPersona/Recovery/index.tsx +#: dashboard/pages/SetupPersona/Recovery/PrivateKey.tsx #: dashboard/pages/CreateMaskWallet/Recovery/index.tsx msgid "Incorrect Private Key" msgstr "" -#: dashboard/pages/SetupPersona/Recovery/index.tsx +#: dashboard/pages/SetupPersona/Recovery/Phrase.tsx msgid "Incorrect recovery phrase." msgstr "" @@ -1506,6 +1529,7 @@ msgstr "" msgid "Incorrect words selected. Please try again!" msgstr "" +#: dashboard/pages/SetupPersona/Recovery/PrivateKey.tsx #: dashboard/components/Restore/RestoreFromPrivateKey.tsx msgid "Input your Private Key" msgstr "" @@ -1524,13 +1548,13 @@ msgid "Invalid Block Explorer URL." msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx msgid "Invalid email address format." msgstr "" -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx msgid "Invalid email address." msgstr "" @@ -1538,7 +1562,7 @@ msgstr "" msgid "Invalid number" msgstr "" -#: dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx msgid "Invalid phone number, please check and try again." msgstr "" @@ -1546,8 +1570,8 @@ msgstr "" msgid "Invalid RPC URL." msgstr "" -#: dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx msgid "Invalid verification code." msgstr "" @@ -1646,8 +1670,9 @@ msgstr "" msgid "Login to Mask Cloud" msgstr "" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx msgid "Logout" msgstr "" @@ -1679,11 +1704,12 @@ msgstr "" #: content-script/components/InjectedComponents/ToolboxUnstyled.tsx #: content-script/components/InjectedComponents/PostDialogHint.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/index.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/index.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/index.tsx msgid "Mask Network" msgstr "" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx msgid "Mask Network Cloud" msgstr "" @@ -1758,18 +1784,21 @@ msgstr "" msgid "Medium" msgstr "" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Merge Completed" msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Merge data to local database" msgstr "" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +#: dashboard/components/GoogleDriveFileTable.tsx msgid "Merge to Browser" msgstr "" @@ -1791,16 +1820,16 @@ msgid "Mnemonic word" msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx msgid "Mobile" msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx msgid "Mobile number" msgstr "" -#: dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx msgid "Mobile verification code" msgstr "" @@ -1914,7 +1943,8 @@ msgid "No back up" msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx +#: dashboard/components/GoogleDriveFileTable.tsx msgid "No backups found" msgstr "" @@ -2045,7 +2075,7 @@ msgid "Paste manually" msgstr "" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Wallet/SetPaymentPassword/index.tsx #: popups/modals/WalletRemoveModal/index.tsx @@ -2127,7 +2157,7 @@ msgid "Personas" msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx msgid "Phone verification code" msgstr "" @@ -2154,6 +2184,7 @@ msgstr "" msgid "Please enter backup password to export persona private key." msgstr "" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Please enter cloud backup password to download file." msgstr "" @@ -2303,6 +2334,11 @@ msgstr "" msgid "Receive" msgstr "" +#: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Recover" +msgstr "" + #: dashboard/pages/SetupPersona/Recovery/index.tsx msgid "Recover your data" msgstr "" @@ -2370,15 +2406,15 @@ msgstr "" msgid "Request Source" msgstr "" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx msgid "Reselect" msgstr "" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Resend" msgstr "" @@ -2390,24 +2426,32 @@ msgstr "" msgid "Resource" msgstr "" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx -#: dashboard/components/Restore/RestoreFromCloud/index.tsx -#: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/MaskNetwork.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx msgid "Restore" msgstr "" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx msgid "Restore backup failed." msgstr "" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Restore Completed" +msgstr "" + #: popups/pages/Settings/index.tsx msgid "Restore Database" msgstr "" -#: dashboard/components/Restore/RestoreFromCloud/index.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/MaskNetwork.tsx msgid "Restore failed" msgstr "" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Restore Failed" +msgstr "" + #: popups/pages/Settings/index.tsx msgid "Restore from a previous database backup" msgstr "" @@ -2493,8 +2537,8 @@ msgstr "" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx #: popups/pages/Wallet/components/ActivityList/ActivityItem.tsx #: popups/pages/Wallet/components/ActionGroup/index.tsx #: popups/pages/Wallet/Transfer/index.tsx @@ -2568,8 +2612,8 @@ msgid "Sign" msgstr "" #: dashboard/pages/SetupPersona/Recovery/index.tsx -msgid "Sign Up" -msgstr "" +#~ msgid "Sign Up" +#~ msgstr "" #: popups/components/SignRequestInfo/index.tsx msgid "Sign-in Request" @@ -2698,7 +2742,7 @@ msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx msgid "Switch other account" msgstr "" @@ -2706,7 +2750,7 @@ msgstr "" msgid "Switch Persona" msgstr "" -#: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx msgid "Switch to other accounts" msgstr "" @@ -2736,19 +2780,20 @@ msgid "The chainID is not equal to the currently connected one." msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts -#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts +#: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts +#: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx #: dashboard/contexts/CloudBackupFormContext.tsx msgid "The code is incorrect." msgstr "" -#: dashboard/pages/SetupPersona/Backup/helpers.tsx +#: dashboard/utils/api.ts msgid "The download link is expired" msgstr "" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/MaskNetwork.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx msgid "The Mask Network Cloud Backup feature will be deactivated on April 30, 2025. Please use alternative cloud backup services or local backup solutions." msgstr "" @@ -2790,7 +2835,7 @@ msgstr "" msgid "The persona name already exists." msgstr "" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts +#: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx msgid "The phone number is incorrect." msgstr "" @@ -3013,13 +3058,13 @@ msgstr "" msgid "Unlock" msgstr "" +#: dashboard/pages/SetupPersona/Recovery/Local.tsx #: dashboard/components/Restore/RestoreWalletFromLocal.tsx -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx msgid "Unpacking" msgstr "" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx msgid "Unsupported data backup" msgstr "" @@ -3067,18 +3112,18 @@ msgstr "" msgid "value" msgstr "" -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx msgid "Verification code has been sent to your email. Please check your mailbox." msgstr "" -#: dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx msgid "Verification code has been sent to your phone." msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Verification code sent" msgstr "" @@ -3200,7 +3245,7 @@ msgstr "" msgid "Welcome to use Mask Network" msgstr "" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/components/GoogleDriveLogin.tsx msgid "when you click Add Google Drive button,you will be forwarded to Google authorization pages." msgstr "" @@ -3232,6 +3277,10 @@ msgstr "" msgid "You have signed with your wallet." msgstr "" +#: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +msgid "You have successfully restored the backup from Google Drive to your browser." +msgstr "" + #: dashboard/components/Restore/ConfirmSynchronizePasswordDialog.tsx msgid "You have verified your cloud password and recovered your backup. Do you want to let your cloud password and local backup password be the same?" msgstr "" @@ -3250,10 +3299,15 @@ msgstr "" msgid "Your connection to this site is not encrypted which can be modified by a hostile third party, we strongly suggest you reject this request." msgstr "" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Your file has been successfully merged into the browser data." msgstr "" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Your file has been successfully restore into the browser data." +msgstr "" + #: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx msgid "Your payment password encrypts wallet data and is needed to unlocking the wallet, transaction confirmations and signing. The password is never stored, and there is no way to recover it if you forget it." msgstr "" diff --git a/packages/mask/shared-ui/locale/ja-JP.json b/packages/mask/shared-ui/locale/ja-JP.json index 11f6c207f7d0..1c6a73b08cd3 100644 --- a/packages/mask/shared-ui/locale/ja-JP.json +++ b/packages/mask/shared-ui/locale/ja-JP.json @@ -65,6 +65,7 @@ "LP+1Z7": ["ネットワークを追加"], "68m9Nl": ["既存のグループに新しいアドレスを追加"], "1LkMSp": ["提案されたトークンを追加"], + "O8PsYe": ["Add the file to Chrome's database"], "GtJJAj": ["ウォレットを追加"], "uv94aG": ["ユーザーが追加しました"], "8RF/Sx": ["正常に追加されました。"], @@ -295,6 +296,8 @@ "9hzYBR": ["Failed to download and merge the backup: ", ["0"]], "0tkvsz": ["Failed to download and merge the backup."], "etATpN": ["Failed to login: ", ["0"]], + "qDIxZ+": ["Failed to restore the backup from Google Drive to your browser. Please try again."], + "e3I0CA": ["Failed to restore the backup: ", ["0"]], "mrAv9J": ["ネットワークを保存できませんでした"], "ZsjtYe": ["アバターを設定できませんでした。"], "RWoEqV": ["Failed to transfer token: ", ["message"]], @@ -567,6 +570,7 @@ "TZ0npN": ["準備完了🚀"], "nVT2pJ": ["realMaskNetwork"], "lDgVWA": ["受取"], + "OkofjH": ["Recover"], "XC7RGa": ["データを復元する"], "UBzbea": ["ウォレットを復元する"], "P9wzG/": ["復旧"], @@ -588,8 +592,10 @@ "nvAt0H": ["リソース"], "yKu/3Y": ["復元"], "Z3+V9p": ["Restore backup failed."], + "nGl2Ng": ["Restore Completed"], "AKLbfQ": ["データベースの復元"], "uM6jnS": ["復元に失敗しました"], + "KFwID2": ["Restore Failed"], "/LkuGq": ["以前のデータベースバックアップから復元します。"], "KisOjk": ["復元またはログイン"], "6gRgw8": ["再試行"], @@ -823,6 +829,7 @@ "dyqtoj": ["You have recovered"], "V8x6o5": ["You have recovered "], "QU9aqK": ["You have signed with your wallet."], + "PeT3a5": ["You have successfully restored the backup from Google Drive to your browser."], "zkEW09": [ "You have verified your cloud password and recovered your backup. Do you want to let your cloud password and local backup password be the same?" ], @@ -832,6 +839,7 @@ "このサイトへの接続は暗号化されていないため、敵対的な第三者によって変更されます。このリクエストを拒否することを強くお勧めします。" ], "UDKbPj": ["Your file has been successfully merged into the browser data."], + "S2JNMm": ["Your file has been successfully restore into the browser data."], "Q68Nuc": [ "Your payment password encrypts wallet data and is needed to unlocking the wallet, transaction confirmations and signing. The password is never stored, and there is no way to recover it if you forget it." ], diff --git a/packages/mask/shared-ui/locale/ja-JP.po b/packages/mask/shared-ui/locale/ja-JP.po index 2bc19234edb9..d19c247bd108 100644 --- a/packages/mask/shared-ui/locale/ja-JP.po +++ b/packages/mask/shared-ui/locale/ja-JP.po @@ -162,7 +162,7 @@ msgstr "資産を追加" msgid "Add Contact" msgstr "連絡先を追加する" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/components/GoogleDriveLogin.tsx msgid "Add google Drive" msgstr "" @@ -179,6 +179,10 @@ msgstr "既存のグループに新しいアドレスを追加" msgid "Add Suggested Token" msgstr "提案されたトークンを追加" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Add the file to Chrome's database" +msgstr "" + #: popups/pages/Wallet/components/StartUp/index.tsx #: popups/pages/Wallet/SwitchWallet/index.tsx #: popups/pages/Wallet/CreateWallet/index.tsx @@ -309,15 +313,15 @@ msgid "Avatar set successfully" msgstr "アバターを設定しました" #: content-script/components/shared/SelectRecipients/SelectRecipientsDialog.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx #: dashboard/pages/CreateMaskWallet/CreateMnemonic/index.tsx #: popups/pages/Personas/ExportPrivateKey/index.tsx #: popups/pages/Personas/AccountDetail/UI.tsx msgid "Back" msgstr "" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx msgid "Back Up to Google Drive" msgstr "" @@ -356,13 +360,14 @@ msgstr "バックアップ失敗" msgid "Backup on {0}" msgstr "" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx -#: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx msgid "Backup password" msgstr "バックアップパスワード" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Local.tsx +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Settings/index.tsx @@ -575,8 +580,8 @@ msgstr "コレクティブ" msgid "Coming soon" msgstr "近日公開" +#: dashboard/pages/SetupPersona/Recovery/Local.tsx #: dashboard/components/Restore/RestoreWalletFromLocal.tsx -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx msgid "Completed" msgstr "完了しました" @@ -734,17 +739,19 @@ msgstr "コンタクト" #: dashboard/pages/SignUp/steps/PersonaNameUI.tsx #: dashboard/pages/SetupPersona/SignUp/index.tsx +#: dashboard/pages/SetupPersona/Recovery/PrivateKey.tsx +#: dashboard/pages/SetupPersona/Recovery/Phrase.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx #: dashboard/pages/SetupPersona/Mnemonic/index.tsx #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx #: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx #: dashboard/pages/CreateMaskWallet/AddDeriveWallet/index.tsx #: dashboard/components/Restore/RestoreWalletFromLocal.tsx -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx #: dashboard/components/Restore/RestoreFromPrivateKey.tsx #: dashboard/components/Restore/RestoreFromMnemonic.tsx -#: dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx msgid "Continue" msgstr "続行" @@ -800,6 +807,7 @@ msgstr "新規Mask IDを作成" msgid "Create Password" msgstr "パスワードを作成" +#: dashboard/pages/SetupPersona/Recovery/index.tsx #: popups/pages/Personas/Home/UI.tsx msgid "Create Persona" msgstr "ペルソナを作成" @@ -875,8 +883,8 @@ msgstr "データの相関値" #~ msgid "Data merged from Mask Cloud Service to local successfully. Re-enter your password to encrypt and upload the new backup to Mask Cloud Service." #~ msgstr "" -#: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx -#: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx msgid "Decrypt failed, please check password" msgstr "復号に失敗しました。パスワードを確認してください。" @@ -981,8 +989,8 @@ msgid "Done" msgstr "完了!" #: content-script/components/InjectedComponents/AutoPasteFailedDialog.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx +#: dashboard/components/GoogleDriveFileTable.tsx msgid "Download" msgstr "ダウンロード" @@ -991,10 +999,11 @@ msgstr "ダウンロード" #~ msgstr "バックアップをダウンロード" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Local.tsx msgid "Download Backup" msgstr "バックアップのダウンロード" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Downloading" msgstr "ダウンロード中" @@ -1020,16 +1029,16 @@ msgstr "連絡先を編集" msgid "eg: X accounts, persona public keys, wallet addresses or ENS" msgstr "" +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Email" msgstr "メールアドレス" +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Email verification code" msgstr "電子メール検証コード" @@ -1155,6 +1164,7 @@ msgid "Failed to disconnect wallet" msgstr "" #. placeholder {0}: (err as Error).message +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Failed to download and merge the backup: {0}" msgstr "" @@ -1164,10 +1174,19 @@ msgstr "" #~ msgstr "" #. placeholder {0}: (err as Error).message -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/components/GoogleDriveLogin.tsx msgid "Failed to login: {0}" msgstr "" +#: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +msgid "Failed to restore the backup from Google Drive to your browser. Please try again." +msgstr "" + +#. placeholder {0}: (err as Error).message +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Failed to restore the backup: {0}" +msgstr "" + #: popups/pages/Wallet/EditNetwork/index.tsx msgid "Failed to save network" msgstr "ネットワークを保存できませんでした" @@ -1325,8 +1344,10 @@ msgstr "" msgid "Give permission to access <0/> your {0}?" msgstr "" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/index.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/index.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx msgid "Google Drive" msgstr "" @@ -1449,10 +1470,12 @@ msgstr "" msgid "Incorrect backup password." msgstr "バックアップパスワードが正しくありません。" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx msgid "Incorrect Backup Password." msgstr "バックアップパスワードが正しくありません。" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Incorrect cloud backup password, please try again." @@ -1473,7 +1496,7 @@ msgid "Incorrect password" msgstr "パスワードが間違っています" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: dashboard/hooks/useBackupFormState.ts #: dashboard/hooks/useBackupFormState.ts @@ -1493,12 +1516,12 @@ msgstr "パスワードが正しくありません。" msgid "Incorrect Payment Password." msgstr "現在のパスワードが正しくありません。" -#: dashboard/pages/SetupPersona/Recovery/index.tsx +#: dashboard/pages/SetupPersona/Recovery/PrivateKey.tsx #: dashboard/pages/CreateMaskWallet/Recovery/index.tsx msgid "Incorrect Private Key" msgstr "IDコードが間違っています" -#: dashboard/pages/SetupPersona/Recovery/index.tsx +#: dashboard/pages/SetupPersona/Recovery/Phrase.tsx msgid "Incorrect recovery phrase." msgstr "アイデンティティニーモニックが正しくありません。" @@ -1511,6 +1534,7 @@ msgstr "ウォレットアドレスが正しくありません。" msgid "Incorrect words selected. Please try again!" msgstr "" +#: dashboard/pages/SetupPersona/Recovery/PrivateKey.tsx #: dashboard/components/Restore/RestoreFromPrivateKey.tsx msgid "Input your Private Key" msgstr "秘密鍵を入力してください" @@ -1529,13 +1553,13 @@ msgid "Invalid Block Explorer URL." msgstr "無効なブロックエクスプローラのURLです。" #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx msgid "Invalid email address format." msgstr "メールアドレスが正しくありません。" -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx msgid "Invalid email address." msgstr "" @@ -1543,7 +1567,7 @@ msgstr "" msgid "Invalid number" msgstr "無効な番号です" -#: dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx msgid "Invalid phone number, please check and try again." msgstr "電話番号が無効です。確認してもう一度お試しください。" @@ -1551,8 +1575,8 @@ msgstr "電話番号が無効です。確認してもう一度お試しくださ msgid "Invalid RPC URL." msgstr "RPCのURLが無効です。" -#: dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx msgid "Invalid verification code." msgstr "認証コードが無効です。" @@ -1651,8 +1675,9 @@ msgstr "ログアウト" msgid "Login to Mask Cloud" msgstr "" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx msgid "Logout" msgstr "" @@ -1684,11 +1709,12 @@ msgstr "マスクには次の権限が必要です" #: content-script/components/InjectedComponents/ToolboxUnstyled.tsx #: content-script/components/InjectedComponents/PostDialogHint.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/index.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/index.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/index.tsx msgid "Mask Network" msgstr "" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx msgid "Mask Network Cloud" msgstr "" @@ -1763,18 +1789,21 @@ msgstr "最大優先手数料は0GWEIより大きくなければなりません" msgid "Medium" msgstr "中間" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Merge Completed" msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Merge data to local database" msgstr "ローカルデータベースにデータを統合" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +#: dashboard/components/GoogleDriveFileTable.tsx msgid "Merge to Browser" msgstr "" @@ -1796,16 +1825,16 @@ msgid "Mnemonic word" msgstr "ニーモニック単語" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx msgid "Mobile" msgstr "モバイル" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx msgid "Mobile number" msgstr "携帯番号" -#: dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx msgid "Mobile verification code" msgstr "モバイル認証コード" @@ -1919,7 +1948,8 @@ msgid "No back up" msgstr "バックアップはありません" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx +#: dashboard/components/GoogleDriveFileTable.tsx msgid "No backups found" msgstr "バックアップが見つかりません" @@ -2050,7 +2080,7 @@ msgid "Paste manually" msgstr "手動でペーストする" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Wallet/SetPaymentPassword/index.tsx #: popups/modals/WalletRemoveModal/index.tsx @@ -2132,7 +2162,7 @@ msgid "Personas" msgstr "ペルソナ" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx msgid "Phone verification code" msgstr "モバイル認証コード" @@ -2159,6 +2189,7 @@ msgstr "" msgid "Please enter backup password to export persona private key." msgstr "ペルソナ秘密鍵をエクスポートするには、バックアップパスワードを入力してください。" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Please enter cloud backup password to download file." msgstr "ファイルをダウンロードするには、クラウドバックアップパスワードを入力してください。" @@ -2308,6 +2339,11 @@ msgstr "" msgid "Receive" msgstr "受取" +#: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Recover" +msgstr "" + #: dashboard/pages/SetupPersona/Recovery/index.tsx msgid "Recover your data" msgstr "データを復元する" @@ -2375,15 +2411,15 @@ msgstr "リクエストは以前には有効ではありません" msgid "Request Source" msgstr "リクエストソース" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx msgid "Reselect" msgstr "選びなおす" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Resend" msgstr "再送信" @@ -2395,24 +2431,32 @@ msgstr "ウォレットをリセットする" msgid "Resource" msgstr "リソース" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx -#: dashboard/components/Restore/RestoreFromCloud/index.tsx -#: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/MaskNetwork.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx msgid "Restore" msgstr "復元" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx msgid "Restore backup failed." msgstr "" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Restore Completed" +msgstr "" + #: popups/pages/Settings/index.tsx msgid "Restore Database" msgstr "データベースの復元" -#: dashboard/components/Restore/RestoreFromCloud/index.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/MaskNetwork.tsx msgid "Restore failed" msgstr "復元に失敗しました" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Restore Failed" +msgstr "" + #: popups/pages/Settings/index.tsx msgid "Restore from a previous database backup" msgstr "以前のデータベースバックアップから復元します。" @@ -2498,8 +2542,8 @@ msgstr "ウォレットを選択" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx #: popups/pages/Wallet/components/ActivityList/ActivityItem.tsx #: popups/pages/Wallet/components/ActionGroup/index.tsx #: popups/pages/Wallet/Transfer/index.tsx @@ -2573,8 +2617,8 @@ msgid "Sign" msgstr "サイン" #: dashboard/pages/SetupPersona/Recovery/index.tsx -msgid "Sign Up" -msgstr "新規登録" +#~ msgid "Sign Up" +#~ msgstr "新規登録" #: popups/components/SignRequestInfo/index.tsx msgid "Sign-in Request" @@ -2703,7 +2747,7 @@ msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx msgid "Switch other account" msgstr "他のアカウントを切り替え" @@ -2711,7 +2755,7 @@ msgstr "他のアカウントを切り替え" msgid "Switch Persona" msgstr "ペルソナを切り替え" -#: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx msgid "Switch to other accounts" msgstr "" @@ -2741,19 +2785,20 @@ msgid "The chainID is not equal to the currently connected one." msgstr "chainIDは現在接続されているものと等しくありません。" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts -#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts +#: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts +#: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx #: dashboard/contexts/CloudBackupFormContext.tsx msgid "The code is incorrect." msgstr "このコードは正しくありません" -#: dashboard/pages/SetupPersona/Backup/helpers.tsx +#: dashboard/utils/api.ts msgid "The download link is expired" msgstr "" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/MaskNetwork.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx msgid "The Mask Network Cloud Backup feature will be deactivated on April 30, 2025. Please use alternative cloud backup services or local backup solutions." msgstr "" @@ -2795,7 +2840,7 @@ msgstr "" msgid "The persona name already exists." msgstr "このペルソナ名は既に存在しています." -#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts +#: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx msgid "The phone number is incorrect." msgstr "電話番号が間違っています。" @@ -3018,13 +3063,13 @@ msgstr "不明なEIP-4361メッセージバージョンです。" msgid "Unlock" msgstr "ロック解除" +#: dashboard/pages/SetupPersona/Recovery/Local.tsx #: dashboard/components/Restore/RestoreWalletFromLocal.tsx -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx msgid "Unpacking" msgstr "" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx msgid "Unsupported data backup" msgstr "サポートされていないバックアップ" @@ -3072,18 +3117,18 @@ msgstr "テキスト暗号化を使用する" msgid "value" msgstr "価値" -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx msgid "Verification code has been sent to your email. Please check your mailbox." msgstr "" -#: dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx msgid "Verification code has been sent to your phone." msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Verification code sent" msgstr "認証コードを送信しました" @@ -3205,7 +3250,7 @@ msgstr "Mask Networkへようこそ" msgid "Welcome to use Mask Network" msgstr "Mask Networkへようこそ" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/components/GoogleDriveLogin.tsx msgid "when you click Add Google Drive button,you will be forwarded to Google authorization pages." msgstr "" @@ -3237,6 +3282,10 @@ msgstr "" msgid "You have signed with your wallet." msgstr "" +#: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +msgid "You have successfully restored the backup from Google Drive to your browser." +msgstr "" + #: dashboard/components/Restore/ConfirmSynchronizePasswordDialog.tsx msgid "You have verified your cloud password and recovered your backup. Do you want to let your cloud password and local backup password be the same?" msgstr "" @@ -3255,10 +3304,15 @@ msgstr "" msgid "Your connection to this site is not encrypted which can be modified by a hostile third party, we strongly suggest you reject this request." msgstr "このサイトへの接続は暗号化されていないため、敵対的な第三者によって変更されます。このリクエストを拒否することを強くお勧めします。" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Your file has been successfully merged into the browser data." msgstr "" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Your file has been successfully restore into the browser data." +msgstr "" + #: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx msgid "Your payment password encrypts wallet data and is needed to unlocking the wallet, transaction confirmations and signing. The password is never stored, and there is no way to recover it if you forget it." msgstr "" diff --git a/packages/mask/shared-ui/locale/ko-KR.json b/packages/mask/shared-ui/locale/ko-KR.json index 01ff9f3c2d71..a853632644b1 100644 --- a/packages/mask/shared-ui/locale/ko-KR.json +++ b/packages/mask/shared-ui/locale/ko-KR.json @@ -65,6 +65,7 @@ "LP+1Z7": ["네트워크 추가"], "68m9Nl": ["현존 그룹에 새로운 주소 추가"], "1LkMSp": ["Add Suggested Token"], + "O8PsYe": ["Add the file to Chrome's database"], "GtJJAj": ["월렛 추가"], "uv94aG": ["사용자별추가"], "8RF/Sx": ["추가 완료"], @@ -295,6 +296,8 @@ "9hzYBR": ["Failed to download and merge the backup: ", ["0"]], "0tkvsz": ["Failed to download and merge the backup."], "etATpN": ["Failed to login: ", ["0"]], + "qDIxZ+": ["Failed to restore the backup from Google Drive to your browser. Please try again."], + "e3I0CA": ["Failed to restore the backup: ", ["0"]], "mrAv9J": ["네트워크 저장 실패"], "ZsjtYe": ["아바타 설정 실패"], "RWoEqV": ["Failed to transfer token: ", ["message"]], @@ -567,6 +570,7 @@ "TZ0npN": ["준비 🚀"], "nVT2pJ": ["realMaskNetwork"], "lDgVWA": ["받기"], + "OkofjH": ["Recover"], "XC7RGa": ["데어터 복구"], "UBzbea": ["월렛 복구"], "P9wzG/": ["복구"], @@ -588,8 +592,10 @@ "nvAt0H": ["Resource"], "yKu/3Y": ["복원하기"], "Z3+V9p": ["Restore backup failed."], + "nGl2Ng": ["Restore Completed"], "AKLbfQ": ["데이터베이스 복원"], "uM6jnS": ["복구 실패"], + "KFwID2": ["Restore Failed"], "/LkuGq": ["이전의 데이터베이스 백업에서 복원하기"], "KisOjk": ["등록 또는 로그인"], "6gRgw8": ["다시 시도"], @@ -819,6 +825,7 @@ "dyqtoj": ["You have recovered"], "V8x6o5": ["You have recovered "], "QU9aqK": ["You have signed with your wallet."], + "PeT3a5": ["You have successfully restored the backup from Google Drive to your browser."], "zkEW09": [ "You have verified your cloud password and recovered your backup. Do you want to let your cloud password and local backup password be the same?" ], @@ -828,6 +835,7 @@ "Your connection to this site is not encrypted which can be modified by a hostile third party, we strongly suggest you reject this request." ], "UDKbPj": ["Your file has been successfully merged into the browser data."], + "S2JNMm": ["Your file has been successfully restore into the browser data."], "Q68Nuc": [ "Your payment password encrypts wallet data and is needed to unlocking the wallet, transaction confirmations and signing. The password is never stored, and there is no way to recover it if you forget it." ], diff --git a/packages/mask/shared-ui/locale/ko-KR.po b/packages/mask/shared-ui/locale/ko-KR.po index 40fc919406c1..b6165db0a109 100644 --- a/packages/mask/shared-ui/locale/ko-KR.po +++ b/packages/mask/shared-ui/locale/ko-KR.po @@ -162,7 +162,7 @@ msgstr "자산 추가" msgid "Add Contact" msgstr "연락처 추가" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/components/GoogleDriveLogin.tsx msgid "Add google Drive" msgstr "" @@ -179,6 +179,10 @@ msgstr "현존 그룹에 새로운 주소 추가" msgid "Add Suggested Token" msgstr "" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Add the file to Chrome's database" +msgstr "" + #: popups/pages/Wallet/components/StartUp/index.tsx #: popups/pages/Wallet/SwitchWallet/index.tsx #: popups/pages/Wallet/CreateWallet/index.tsx @@ -309,15 +313,15 @@ msgid "Avatar set successfully" msgstr "아바타 설정 성공" #: content-script/components/shared/SelectRecipients/SelectRecipientsDialog.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx #: dashboard/pages/CreateMaskWallet/CreateMnemonic/index.tsx #: popups/pages/Personas/ExportPrivateKey/index.tsx #: popups/pages/Personas/AccountDetail/UI.tsx msgid "Back" msgstr "뒤로" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx msgid "Back Up to Google Drive" msgstr "" @@ -356,13 +360,14 @@ msgstr "백업 실패" msgid "Backup on {0}" msgstr "백업 시간 {0}" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx -#: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx msgid "Backup password" msgstr "비밀번호 백업" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Local.tsx +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Settings/index.tsx @@ -575,8 +580,8 @@ msgstr "수집품" msgid "Coming soon" msgstr "" +#: dashboard/pages/SetupPersona/Recovery/Local.tsx #: dashboard/components/Restore/RestoreWalletFromLocal.tsx -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx msgid "Completed" msgstr "완료됨" @@ -734,17 +739,19 @@ msgstr "연락처" #: dashboard/pages/SignUp/steps/PersonaNameUI.tsx #: dashboard/pages/SetupPersona/SignUp/index.tsx +#: dashboard/pages/SetupPersona/Recovery/PrivateKey.tsx +#: dashboard/pages/SetupPersona/Recovery/Phrase.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx #: dashboard/pages/SetupPersona/Mnemonic/index.tsx #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx #: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx #: dashboard/pages/CreateMaskWallet/AddDeriveWallet/index.tsx #: dashboard/components/Restore/RestoreWalletFromLocal.tsx -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx #: dashboard/components/Restore/RestoreFromPrivateKey.tsx #: dashboard/components/Restore/RestoreFromMnemonic.tsx -#: dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx msgid "Continue" msgstr "다음" @@ -800,6 +807,7 @@ msgstr "새로운 Mask 아이디 만들기" msgid "Create Password" msgstr "비밀번호 생성" +#: dashboard/pages/SetupPersona/Recovery/index.tsx #: popups/pages/Personas/Home/UI.tsx msgid "Create Persona" msgstr "페르소나 만들기" @@ -875,8 +883,8 @@ msgstr "데이터 수정" #~ msgid "Data merged from Mask Cloud Service to local successfully. Re-enter your password to encrypt and upload the new backup to Mask Cloud Service." #~ msgstr "" -#: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx -#: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx msgid "Decrypt failed, please check password" msgstr "해독 실패, 비밀번호를 확인하세요" @@ -981,8 +989,8 @@ msgid "Done" msgstr "완료" #: content-script/components/InjectedComponents/AutoPasteFailedDialog.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx +#: dashboard/components/GoogleDriveFileTable.tsx msgid "Download" msgstr "다운로드" @@ -991,10 +999,11 @@ msgstr "다운로드" #~ msgstr "백업 다운로드" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Local.tsx msgid "Download Backup" msgstr "백업 다운로드" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Downloading" msgstr "다운로드 중" @@ -1020,16 +1029,16 @@ msgstr "연락처 편집" msgid "eg: X accounts, persona public keys, wallet addresses or ENS" msgstr "" +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Email" msgstr "이메일" +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Email verification code" msgstr "메일 인증번호" @@ -1155,6 +1164,7 @@ msgid "Failed to disconnect wallet" msgstr "" #. placeholder {0}: (err as Error).message +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Failed to download and merge the backup: {0}" msgstr "" @@ -1164,10 +1174,19 @@ msgstr "" #~ msgstr "" #. placeholder {0}: (err as Error).message -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/components/GoogleDriveLogin.tsx msgid "Failed to login: {0}" msgstr "" +#: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +msgid "Failed to restore the backup from Google Drive to your browser. Please try again." +msgstr "" + +#. placeholder {0}: (err as Error).message +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Failed to restore the backup: {0}" +msgstr "" + #: popups/pages/Wallet/EditNetwork/index.tsx msgid "Failed to save network" msgstr "네트워크 저장 실패" @@ -1325,8 +1344,10 @@ msgstr "" msgid "Give permission to access <0/> your {0}?" msgstr "" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/index.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/index.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx msgid "Google Drive" msgstr "" @@ -1449,10 +1470,12 @@ msgstr "" msgid "Incorrect backup password." msgstr "잘못된 비밀번호." -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx msgid "Incorrect Backup Password." msgstr "잘못된 백업 비밀번호." +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Incorrect cloud backup password, please try again." @@ -1473,7 +1496,7 @@ msgid "Incorrect password" msgstr "잘못된 비밀번호" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: dashboard/hooks/useBackupFormState.ts #: dashboard/hooks/useBackupFormState.ts @@ -1493,12 +1516,12 @@ msgstr "잘못된 결제 비밀번호" msgid "Incorrect Payment Password." msgstr "잘못된 결제 비밀번호" -#: dashboard/pages/SetupPersona/Recovery/index.tsx +#: dashboard/pages/SetupPersona/Recovery/PrivateKey.tsx #: dashboard/pages/CreateMaskWallet/Recovery/index.tsx msgid "Incorrect Private Key" msgstr "잘못된 아이디 코드" -#: dashboard/pages/SetupPersona/Recovery/index.tsx +#: dashboard/pages/SetupPersona/Recovery/Phrase.tsx msgid "Incorrect recovery phrase." msgstr "잘못된 복구 문구" @@ -1511,6 +1534,7 @@ msgstr "잘못된 월렛 주소." msgid "Incorrect words selected. Please try again!" msgstr "" +#: dashboard/pages/SetupPersona/Recovery/PrivateKey.tsx #: dashboard/components/Restore/RestoreFromPrivateKey.tsx msgid "Input your Private Key" msgstr "개인 키 입력하기" @@ -1529,13 +1553,13 @@ msgid "Invalid Block Explorer URL." msgstr "무효한 Block Explorer URL." #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx msgid "Invalid email address format." msgstr "이메일 주소가 잘못되었습니다." -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx msgid "Invalid email address." msgstr "" @@ -1543,7 +1567,7 @@ msgstr "" msgid "Invalid number" msgstr "잘못된 번호" -#: dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx msgid "Invalid phone number, please check and try again." msgstr "무효한 전화 번호입니다. 다시 시도해 보세요." @@ -1551,8 +1575,8 @@ msgstr "무효한 전화 번호입니다. 다시 시도해 보세요." msgid "Invalid RPC URL." msgstr "무효한 RPC URL" -#: dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx msgid "Invalid verification code." msgstr "유효하지 않은 인증 코드입니다." @@ -1651,8 +1675,9 @@ msgstr "로그아웃" msgid "Login to Mask Cloud" msgstr "" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx msgid "Logout" msgstr "" @@ -1684,11 +1709,12 @@ msgstr "Mask가 아래 권한을 요청합니다." #: content-script/components/InjectedComponents/ToolboxUnstyled.tsx #: content-script/components/InjectedComponents/PostDialogHint.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/index.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/index.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/index.tsx msgid "Mask Network" msgstr "" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx msgid "Mask Network Cloud" msgstr "" @@ -1763,18 +1789,21 @@ msgstr "최대 우선 가스비는 0 GWEI보다 높아야 합니다" msgid "Medium" msgstr "보통" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Merge Completed" msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Merge data to local database" msgstr "데이터를 로컬 데이터베이스에 병합하기" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +#: dashboard/components/GoogleDriveFileTable.tsx msgid "Merge to Browser" msgstr "" @@ -1796,16 +1825,16 @@ msgid "Mnemonic word" msgstr "니모닉 단어" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx msgid "Mobile" msgstr "모바일" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx msgid "Mobile number" msgstr "휴대폰 번호" -#: dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx msgid "Mobile verification code" msgstr "모바일 인증번호" @@ -1919,7 +1948,8 @@ msgid "No back up" msgstr "백업 없음" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx +#: dashboard/components/GoogleDriveFileTable.tsx msgid "No backups found" msgstr "백업 없음" @@ -2050,7 +2080,7 @@ msgid "Paste manually" msgstr "수동으로 붙여넣기" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Wallet/SetPaymentPassword/index.tsx #: popups/modals/WalletRemoveModal/index.tsx @@ -2132,7 +2162,7 @@ msgid "Personas" msgstr "나의 페르소나" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx msgid "Phone verification code" msgstr "" @@ -2159,6 +2189,7 @@ msgstr "" msgid "Please enter backup password to export persona private key." msgstr "백업 비밀번호를 입력하고 페르소나 개인키를 내보낼 수 있습니다." +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Please enter cloud backup password to download file." msgstr "파일을 다운로드하려면 클라우드 백업 암호를 입력하세요." @@ -2308,6 +2339,11 @@ msgstr "" msgid "Receive" msgstr "받기" +#: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Recover" +msgstr "" + #: dashboard/pages/SetupPersona/Recovery/index.tsx msgid "Recover your data" msgstr "데어터 복구" @@ -2375,15 +2411,15 @@ msgstr "" msgid "Request Source" msgstr "소스 요청" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx msgid "Reselect" msgstr "다시 선택" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Resend" msgstr "다시 보내기" @@ -2395,24 +2431,32 @@ msgstr "월렛 리셋" msgid "Resource" msgstr "" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx -#: dashboard/components/Restore/RestoreFromCloud/index.tsx -#: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/MaskNetwork.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx msgid "Restore" msgstr "복원하기" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx msgid "Restore backup failed." msgstr "" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Restore Completed" +msgstr "" + #: popups/pages/Settings/index.tsx msgid "Restore Database" msgstr "데이터베이스 복원" -#: dashboard/components/Restore/RestoreFromCloud/index.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/MaskNetwork.tsx msgid "Restore failed" msgstr "복구 실패" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Restore Failed" +msgstr "" + #: popups/pages/Settings/index.tsx msgid "Restore from a previous database backup" msgstr "이전의 데이터베이스 백업에서 복원하기" @@ -2498,8 +2542,8 @@ msgstr "월렛 선택" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx #: popups/pages/Wallet/components/ActivityList/ActivityItem.tsx #: popups/pages/Wallet/components/ActionGroup/index.tsx #: popups/pages/Wallet/Transfer/index.tsx @@ -2573,8 +2617,8 @@ msgid "Sign" msgstr "사인" #: dashboard/pages/SetupPersona/Recovery/index.tsx -msgid "Sign Up" -msgstr "가입하기" +#~ msgid "Sign Up" +#~ msgstr "가입하기" #: popups/components/SignRequestInfo/index.tsx msgid "Sign-in Request" @@ -2703,7 +2747,7 @@ msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx msgid "Switch other account" msgstr "사용자 계정 전환" @@ -2711,7 +2755,7 @@ msgstr "사용자 계정 전환" msgid "Switch Persona" msgstr "페르소나 전환" -#: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx msgid "Switch to other accounts" msgstr "" @@ -2741,19 +2785,20 @@ msgid "The chainID is not equal to the currently connected one." msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts -#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts +#: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts +#: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx #: dashboard/contexts/CloudBackupFormContext.tsx msgid "The code is incorrect." msgstr "코드가 잘못되었습니다." -#: dashboard/pages/SetupPersona/Backup/helpers.tsx +#: dashboard/utils/api.ts msgid "The download link is expired" msgstr "" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/MaskNetwork.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx msgid "The Mask Network Cloud Backup feature will be deactivated on April 30, 2025. Please use alternative cloud backup services or local backup solutions." msgstr "" @@ -2795,7 +2840,7 @@ msgstr "" msgid "The persona name already exists." msgstr "이미 존재된 페르소나입니다" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts +#: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx msgid "The phone number is incorrect." msgstr "전화번호가 잘못되었습니다." @@ -3018,13 +3063,13 @@ msgstr "" msgid "Unlock" msgstr "언락" +#: dashboard/pages/SetupPersona/Recovery/Local.tsx #: dashboard/components/Restore/RestoreWalletFromLocal.tsx -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx msgid "Unpacking" msgstr "" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx msgid "Unsupported data backup" msgstr "지원하지 않는 데이터 백업" @@ -3072,18 +3117,18 @@ msgstr "텍스 암호화 이용" msgid "value" msgstr "값" -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx msgid "Verification code has been sent to your email. Please check your mailbox." msgstr "" -#: dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx msgid "Verification code has been sent to your phone." msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Verification code sent" msgstr "인증 코드가 발송되었습니다" @@ -3205,7 +3250,7 @@ msgstr "환영합니다" msgid "Welcome to use Mask Network" msgstr "환영합니다" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/components/GoogleDriveLogin.tsx msgid "when you click Add Google Drive button,you will be forwarded to Google authorization pages." msgstr "" @@ -3237,6 +3282,10 @@ msgstr "" msgid "You have signed with your wallet." msgstr "" +#: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +msgid "You have successfully restored the backup from Google Drive to your browser." +msgstr "" + #: dashboard/components/Restore/ConfirmSynchronizePasswordDialog.tsx msgid "You have verified your cloud password and recovered your backup. Do you want to let your cloud password and local backup password be the same?" msgstr "" @@ -3255,10 +3304,15 @@ msgstr "" msgid "Your connection to this site is not encrypted which can be modified by a hostile third party, we strongly suggest you reject this request." msgstr "" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Your file has been successfully merged into the browser data." msgstr "" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Your file has been successfully restore into the browser data." +msgstr "" + #: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx msgid "Your payment password encrypts wallet data and is needed to unlocking the wallet, transaction confirmations and signing. The password is never stored, and there is no way to recover it if you forget it." msgstr "" diff --git a/packages/mask/shared-ui/locale/zh-CN.json b/packages/mask/shared-ui/locale/zh-CN.json index 939507ae5abd..e1d6cb76a2f0 100644 --- a/packages/mask/shared-ui/locale/zh-CN.json +++ b/packages/mask/shared-ui/locale/zh-CN.json @@ -65,6 +65,7 @@ "LP+1Z7": ["添加网络"], "68m9Nl": ["向现有组添加新地址"], "1LkMSp": ["Add Suggested Token"], + "O8PsYe": ["Add the file to Chrome's database"], "GtJJAj": ["添加钱包"], "uv94aG": ["由用户添加"], "8RF/Sx": ["添加成功"], @@ -293,6 +294,8 @@ "9hzYBR": ["Failed to download and merge the backup: ", ["0"]], "0tkvsz": ["Failed to download and merge the backup."], "etATpN": ["Failed to login: ", ["0"]], + "qDIxZ+": ["Failed to restore the backup from Google Drive to your browser. Please try again."], + "e3I0CA": ["Failed to restore the backup: ", ["0"]], "mrAv9J": ["无法保存网络"], "ZsjtYe": ["加载头像失败。"], "RWoEqV": ["Failed to transfer token: ", ["message"]], @@ -563,6 +566,7 @@ "TZ0npN": ["准备🚀"], "nVT2pJ": ["realMaskNetwork"], "lDgVWA": ["接收"], + "OkofjH": ["Recover"], "XC7RGa": ["恢复数据"], "UBzbea": ["恢复钱包"], "P9wzG/": ["恢复"], @@ -584,8 +588,10 @@ "nvAt0H": ["Resource"], "yKu/3Y": ["恢复"], "Z3+V9p": ["Restore backup failed."], + "nGl2Ng": ["Restore Completed"], "AKLbfQ": ["恢复数据库"], "uM6jnS": ["恢复失败"], + "KFwID2": ["Restore Failed"], "/LkuGq": ["从以前的数据库备份恢复"], "KisOjk": ["恢复身份"], "6gRgw8": ["重试"], @@ -813,6 +819,7 @@ "dyqtoj": ["You have recovered"], "V8x6o5": ["You have recovered "], "QU9aqK": ["You have signed with your wallet."], + "PeT3a5": ["You have successfully restored the backup from Google Drive to your browser."], "zkEW09": [ "You have verified your cloud password and recovered your backup. Do you want to let your cloud password and local backup password be the same?" ], @@ -822,6 +829,7 @@ "Your connection to this site is not encrypted which can be modified by a hostile third party, we strongly suggest you reject this request." ], "UDKbPj": ["Your file has been successfully merged into the browser data."], + "S2JNMm": ["Your file has been successfully restore into the browser data."], "Q68Nuc": [ "Your payment password encrypts wallet data and is needed to unlocking the wallet, transaction confirmations and signing. The password is never stored, and there is no way to recover it if you forget it." ], diff --git a/packages/mask/shared-ui/locale/zh-CN.po b/packages/mask/shared-ui/locale/zh-CN.po index 149cf850227b..046f4a873e12 100644 --- a/packages/mask/shared-ui/locale/zh-CN.po +++ b/packages/mask/shared-ui/locale/zh-CN.po @@ -162,7 +162,7 @@ msgstr "添加资产" msgid "Add Contact" msgstr "添加联系人" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/components/GoogleDriveLogin.tsx msgid "Add google Drive" msgstr "" @@ -179,6 +179,10 @@ msgstr "向现有组添加新地址" msgid "Add Suggested Token" msgstr "" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Add the file to Chrome's database" +msgstr "" + #: popups/pages/Wallet/components/StartUp/index.tsx #: popups/pages/Wallet/SwitchWallet/index.tsx #: popups/pages/Wallet/CreateWallet/index.tsx @@ -309,15 +313,15 @@ msgid "Avatar set successfully" msgstr "新头像设置成功" #: content-script/components/shared/SelectRecipients/SelectRecipientsDialog.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx #: dashboard/pages/CreateMaskWallet/CreateMnemonic/index.tsx #: popups/pages/Personas/ExportPrivateKey/index.tsx #: popups/pages/Personas/AccountDetail/UI.tsx msgid "Back" msgstr "返回" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx msgid "Back Up to Google Drive" msgstr "" @@ -356,13 +360,14 @@ msgstr "备份失败" msgid "Backup on {0}" msgstr "" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx -#: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx msgid "Backup password" msgstr "备份密码" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Local.tsx +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Settings/index.tsx @@ -575,8 +580,8 @@ msgstr "收藏品" msgid "Coming soon" msgstr "即将上线" +#: dashboard/pages/SetupPersona/Recovery/Local.tsx #: dashboard/components/Restore/RestoreWalletFromLocal.tsx -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx msgid "Completed" msgstr "已完成" @@ -734,17 +739,19 @@ msgstr "联系人" #: dashboard/pages/SignUp/steps/PersonaNameUI.tsx #: dashboard/pages/SetupPersona/SignUp/index.tsx +#: dashboard/pages/SetupPersona/Recovery/PrivateKey.tsx +#: dashboard/pages/SetupPersona/Recovery/Phrase.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx #: dashboard/pages/SetupPersona/Mnemonic/index.tsx #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx #: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx #: dashboard/pages/CreateMaskWallet/AddDeriveWallet/index.tsx #: dashboard/components/Restore/RestoreWalletFromLocal.tsx -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx #: dashboard/components/Restore/RestoreFromPrivateKey.tsx #: dashboard/components/Restore/RestoreFromMnemonic.tsx -#: dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx msgid "Continue" msgstr "继续" @@ -800,6 +807,7 @@ msgstr "创建新的 MASK 身份" msgid "Create Password" msgstr "设置密码" +#: dashboard/pages/SetupPersona/Recovery/index.tsx #: popups/pages/Personas/Home/UI.tsx msgid "Create Persona" msgstr "创建身份" @@ -875,8 +883,8 @@ msgstr "数据关联" #~ msgid "Data merged from Mask Cloud Service to local successfully. Re-enter your password to encrypt and upload the new backup to Mask Cloud Service." #~ msgstr "" -#: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx -#: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx msgid "Decrypt failed, please check password" msgstr "备份解密失败,请检查密码" @@ -981,8 +989,8 @@ msgid "Done" msgstr "完成" #: content-script/components/InjectedComponents/AutoPasteFailedDialog.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx +#: dashboard/components/GoogleDriveFileTable.tsx msgid "Download" msgstr "下载" @@ -991,10 +999,11 @@ msgstr "下载" #~ msgstr "下载备份" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Local.tsx msgid "Download Backup" msgstr "下载备份" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Downloading" msgstr "正在下载" @@ -1020,16 +1029,16 @@ msgstr "编辑联系人" msgid "eg: X accounts, persona public keys, wallet addresses or ENS" msgstr "" +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Email" msgstr "电子邮箱" +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Email verification code" msgstr "邮箱验证码" @@ -1155,6 +1164,7 @@ msgid "Failed to disconnect wallet" msgstr "" #. placeholder {0}: (err as Error).message +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Failed to download and merge the backup: {0}" msgstr "" @@ -1164,10 +1174,19 @@ msgstr "" #~ msgstr "" #. placeholder {0}: (err as Error).message -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/components/GoogleDriveLogin.tsx msgid "Failed to login: {0}" msgstr "" +#: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +msgid "Failed to restore the backup from Google Drive to your browser. Please try again." +msgstr "" + +#. placeholder {0}: (err as Error).message +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Failed to restore the backup: {0}" +msgstr "" + #: popups/pages/Wallet/EditNetwork/index.tsx msgid "Failed to save network" msgstr "无法保存网络" @@ -1325,8 +1344,10 @@ msgstr "" msgid "Give permission to access <0/> your {0}?" msgstr "" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/index.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/index.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx msgid "Google Drive" msgstr "" @@ -1449,10 +1470,12 @@ msgstr "" msgid "Incorrect backup password." msgstr "密码不正确。" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx msgid "Incorrect Backup Password." msgstr "备份密码错误。" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Incorrect cloud backup password, please try again." @@ -1473,7 +1496,7 @@ msgid "Incorrect password" msgstr "密码不正确" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: dashboard/hooks/useBackupFormState.ts #: dashboard/hooks/useBackupFormState.ts @@ -1493,12 +1516,12 @@ msgstr "支付密码错误。" msgid "Incorrect Payment Password." msgstr "支付密码错误。" -#: dashboard/pages/SetupPersona/Recovery/index.tsx +#: dashboard/pages/SetupPersona/Recovery/PrivateKey.tsx #: dashboard/pages/CreateMaskWallet/Recovery/index.tsx msgid "Incorrect Private Key" msgstr "私钥不正确" -#: dashboard/pages/SetupPersona/Recovery/index.tsx +#: dashboard/pages/SetupPersona/Recovery/Phrase.tsx msgid "Incorrect recovery phrase." msgstr "助记词不正确。" @@ -1511,6 +1534,7 @@ msgstr "无效钱包地址。" msgid "Incorrect words selected. Please try again!" msgstr "" +#: dashboard/pages/SetupPersona/Recovery/PrivateKey.tsx #: dashboard/components/Restore/RestoreFromPrivateKey.tsx msgid "Input your Private Key" msgstr "输入您的私钥" @@ -1529,13 +1553,13 @@ msgid "Invalid Block Explorer URL." msgstr "无效的块浏览器URL。" #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx msgid "Invalid email address format." msgstr "邮箱地址不正确。" -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx msgid "Invalid email address." msgstr "" @@ -1543,7 +1567,7 @@ msgstr "" msgid "Invalid number" msgstr "数字无效" -#: dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx msgid "Invalid phone number, please check and try again." msgstr "无效的电话号码,请检查并重试。" @@ -1551,8 +1575,8 @@ msgstr "无效的电话号码,请检查并重试。" msgid "Invalid RPC URL." msgstr "无效 RPC URL 。" -#: dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx msgid "Invalid verification code." msgstr "验证码错误。" @@ -1651,8 +1675,9 @@ msgstr "登出" msgid "Login to Mask Cloud" msgstr "" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx msgid "Logout" msgstr "" @@ -1684,11 +1709,12 @@ msgstr "Mask Network需要以下权限" #: content-script/components/InjectedComponents/ToolboxUnstyled.tsx #: content-script/components/InjectedComponents/PostDialogHint.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/index.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/index.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/index.tsx msgid "Mask Network" msgstr "" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx msgid "Mask Network Cloud" msgstr "" @@ -1763,18 +1789,21 @@ msgstr "Max priority fee必须大于 0 GWEI" msgid "Medium" msgstr "中等" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Merge Completed" msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Merge data to local database" msgstr "合并数据到本地数据库" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +#: dashboard/components/GoogleDriveFileTable.tsx msgid "Merge to Browser" msgstr "" @@ -1796,16 +1825,16 @@ msgid "Mnemonic word" msgstr "助记词" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx msgid "Mobile" msgstr "手机" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx msgid "Mobile number" msgstr "手机号码" -#: dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx msgid "Mobile verification code" msgstr "手机验证码" @@ -1919,7 +1948,8 @@ msgid "No back up" msgstr "没有备份" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx +#: dashboard/components/GoogleDriveFileTable.tsx msgid "No backups found" msgstr "没有发现备份" @@ -2050,7 +2080,7 @@ msgid "Paste manually" msgstr "手动粘贴" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Wallet/SetPaymentPassword/index.tsx #: popups/modals/WalletRemoveModal/index.tsx @@ -2132,7 +2162,7 @@ msgid "Personas" msgstr "身份" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx msgid "Phone verification code" msgstr "验证码" @@ -2159,6 +2189,7 @@ msgstr "" msgid "Please enter backup password to export persona private key." msgstr "请输入导出个人私钥的备份密码。" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Please enter cloud backup password to download file." msgstr "请输入云备份密码以下载文件。" @@ -2308,6 +2339,11 @@ msgstr "" msgid "Receive" msgstr "接收" +#: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Recover" +msgstr "" + #: dashboard/pages/SetupPersona/Recovery/index.tsx msgid "Recover your data" msgstr "恢复数据" @@ -2375,15 +2411,15 @@ msgstr "" msgid "Request Source" msgstr "请求源" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx msgid "Reselect" msgstr "重新选择" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Resend" msgstr "重新发送" @@ -2395,24 +2431,32 @@ msgstr "重置钱包" msgid "Resource" msgstr "" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx -#: dashboard/components/Restore/RestoreFromCloud/index.tsx -#: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/MaskNetwork.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx msgid "Restore" msgstr "恢复" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx msgid "Restore backup failed." msgstr "" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Restore Completed" +msgstr "" + #: popups/pages/Settings/index.tsx msgid "Restore Database" msgstr "恢复数据库" -#: dashboard/components/Restore/RestoreFromCloud/index.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/MaskNetwork.tsx msgid "Restore failed" msgstr "恢复失败" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Restore Failed" +msgstr "" + #: popups/pages/Settings/index.tsx msgid "Restore from a previous database backup" msgstr "从以前的数据库备份恢复" @@ -2498,8 +2542,8 @@ msgstr "选择钱包" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx #: popups/pages/Wallet/components/ActivityList/ActivityItem.tsx #: popups/pages/Wallet/components/ActionGroup/index.tsx #: popups/pages/Wallet/Transfer/index.tsx @@ -2573,8 +2617,8 @@ msgid "Sign" msgstr "签名" #: dashboard/pages/SetupPersona/Recovery/index.tsx -msgid "Sign Up" -msgstr "注册" +#~ msgid "Sign Up" +#~ msgstr "注册" #: popups/components/SignRequestInfo/index.tsx msgid "Sign-in Request" @@ -2703,7 +2747,7 @@ msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx msgid "Switch other account" msgstr "切换帐号" @@ -2711,7 +2755,7 @@ msgstr "切换帐号" msgid "Switch Persona" msgstr "切换 Persona" -#: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx msgid "Switch to other accounts" msgstr "" @@ -2741,19 +2785,20 @@ msgid "The chainID is not equal to the currently connected one." msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts -#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts +#: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts +#: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx #: dashboard/contexts/CloudBackupFormContext.tsx msgid "The code is incorrect." msgstr "验证码不正确" -#: dashboard/pages/SetupPersona/Backup/helpers.tsx +#: dashboard/utils/api.ts msgid "The download link is expired" msgstr "" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/MaskNetwork.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx msgid "The Mask Network Cloud Backup feature will be deactivated on April 30, 2025. Please use alternative cloud backup services or local backup solutions." msgstr "" @@ -2795,7 +2840,7 @@ msgstr "" msgid "The persona name already exists." msgstr "此身份名称已存在" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts +#: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx msgid "The phone number is incorrect." msgstr "此手机号码不正确。" @@ -3018,13 +3063,13 @@ msgstr "" msgid "Unlock" msgstr "解锁" +#: dashboard/pages/SetupPersona/Recovery/Local.tsx #: dashboard/components/Restore/RestoreWalletFromLocal.tsx -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx msgid "Unpacking" msgstr "" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx msgid "Unsupported data backup" msgstr "不支持的数据备份格式" @@ -3072,18 +3117,18 @@ msgstr "使用文本加密" msgid "value" msgstr "价值" -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx msgid "Verification code has been sent to your email. Please check your mailbox." msgstr "" -#: dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx msgid "Verification code has been sent to your phone." msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Verification code sent" msgstr "验证码已发送" @@ -3205,7 +3250,7 @@ msgstr "欢迎来到 Mask Network!" msgid "Welcome to use Mask Network" msgstr "欢迎来到 Mask Network!" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/components/GoogleDriveLogin.tsx msgid "when you click Add Google Drive button,you will be forwarded to Google authorization pages." msgstr "" @@ -3237,6 +3282,10 @@ msgstr "" msgid "You have signed with your wallet." msgstr "" +#: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +msgid "You have successfully restored the backup from Google Drive to your browser." +msgstr "" + #: dashboard/components/Restore/ConfirmSynchronizePasswordDialog.tsx msgid "You have verified your cloud password and recovered your backup. Do you want to let your cloud password and local backup password be the same?" msgstr "" @@ -3255,10 +3304,15 @@ msgstr "" msgid "Your connection to this site is not encrypted which can be modified by a hostile third party, we strongly suggest you reject this request." msgstr "" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Your file has been successfully merged into the browser data." msgstr "" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Your file has been successfully restore into the browser data." +msgstr "" + #: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx msgid "Your payment password encrypts wallet data and is needed to unlocking the wallet, transaction confirmations and signing. The password is never stored, and there is no way to recover it if you forget it." msgstr "" diff --git a/packages/mask/shared-ui/locale/zh-TW.json b/packages/mask/shared-ui/locale/zh-TW.json index 2fa73c62fe40..003ab065cf78 100644 --- a/packages/mask/shared-ui/locale/zh-TW.json +++ b/packages/mask/shared-ui/locale/zh-TW.json @@ -65,6 +65,7 @@ "LP+1Z7": ["添加网络"], "68m9Nl": ["向现有组添加新地址"], "1LkMSp": ["Add Suggested Token"], + "O8PsYe": ["Add the file to Chrome's database"], "GtJJAj": ["添加钱包"], "uv94aG": ["由用户添加"], "8RF/Sx": ["添加成功"], @@ -293,6 +294,8 @@ "9hzYBR": ["Failed to download and merge the backup: ", ["0"]], "0tkvsz": ["Failed to download and merge the backup."], "etATpN": ["Failed to login: ", ["0"]], + "qDIxZ+": ["Failed to restore the backup from Google Drive to your browser. Please try again."], + "e3I0CA": ["Failed to restore the backup: ", ["0"]], "mrAv9J": ["无法保存网络"], "ZsjtYe": ["加载头像失败。"], "RWoEqV": ["Failed to transfer token: ", ["message"]], @@ -563,6 +566,7 @@ "TZ0npN": ["准备🚀"], "nVT2pJ": ["realMaskNetwork"], "lDgVWA": ["接收"], + "OkofjH": ["Recover"], "XC7RGa": ["恢复数据"], "UBzbea": ["恢复钱包"], "P9wzG/": ["恢復"], @@ -584,8 +588,10 @@ "nvAt0H": ["Resource"], "yKu/3Y": ["恢復"], "Z3+V9p": ["Restore backup failed."], + "nGl2Ng": ["Restore Completed"], "AKLbfQ": ["恢复数据库"], "uM6jnS": ["恢復失敗"], + "KFwID2": ["Restore Failed"], "/LkuGq": ["从以前的数据库备份恢复"], "KisOjk": ["恢复身份"], "6gRgw8": ["重試"], @@ -813,6 +819,7 @@ "dyqtoj": ["You have recovered"], "V8x6o5": ["You have recovered "], "QU9aqK": ["You have signed with your wallet."], + "PeT3a5": ["You have successfully restored the backup from Google Drive to your browser."], "zkEW09": [ "You have verified your cloud password and recovered your backup. Do you want to let your cloud password and local backup password be the same?" ], @@ -822,6 +829,7 @@ "Your connection to this site is not encrypted which can be modified by a hostile third party, we strongly suggest you reject this request." ], "UDKbPj": ["Your file has been successfully merged into the browser data."], + "S2JNMm": ["Your file has been successfully restore into the browser data."], "Q68Nuc": [ "Your payment password encrypts wallet data and is needed to unlocking the wallet, transaction confirmations and signing. The password is never stored, and there is no way to recover it if you forget it." ], diff --git a/packages/mask/shared-ui/locale/zh-TW.po b/packages/mask/shared-ui/locale/zh-TW.po index 864ffb6872c9..f82d7473ddae 100644 --- a/packages/mask/shared-ui/locale/zh-TW.po +++ b/packages/mask/shared-ui/locale/zh-TW.po @@ -162,7 +162,7 @@ msgstr "" msgid "Add Contact" msgstr "" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/components/GoogleDriveLogin.tsx msgid "Add google Drive" msgstr "" @@ -179,6 +179,10 @@ msgstr "" msgid "Add Suggested Token" msgstr "" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Add the file to Chrome's database" +msgstr "" + #: popups/pages/Wallet/components/StartUp/index.tsx #: popups/pages/Wallet/SwitchWallet/index.tsx #: popups/pages/Wallet/CreateWallet/index.tsx @@ -309,15 +313,15 @@ msgid "Avatar set successfully" msgstr "" #: content-script/components/shared/SelectRecipients/SelectRecipientsDialog.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx #: dashboard/pages/CreateMaskWallet/CreateMnemonic/index.tsx #: popups/pages/Personas/ExportPrivateKey/index.tsx #: popups/pages/Personas/AccountDetail/UI.tsx msgid "Back" msgstr "返回" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx msgid "Back Up to Google Drive" msgstr "" @@ -356,13 +360,14 @@ msgstr "備份失敗" msgid "Backup on {0}" msgstr "" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx -#: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx msgid "Backup password" msgstr "備份密碼" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Local.tsx +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Settings/index.tsx @@ -575,8 +580,8 @@ msgstr "" msgid "Coming soon" msgstr "" +#: dashboard/pages/SetupPersona/Recovery/Local.tsx #: dashboard/components/Restore/RestoreWalletFromLocal.tsx -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx msgid "Completed" msgstr "" @@ -734,17 +739,19 @@ msgstr "聯繫人" #: dashboard/pages/SignUp/steps/PersonaNameUI.tsx #: dashboard/pages/SetupPersona/SignUp/index.tsx +#: dashboard/pages/SetupPersona/Recovery/PrivateKey.tsx +#: dashboard/pages/SetupPersona/Recovery/Phrase.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx #: dashboard/pages/SetupPersona/Mnemonic/index.tsx #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx #: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx #: dashboard/pages/CreateMaskWallet/AddDeriveWallet/index.tsx #: dashboard/components/Restore/RestoreWalletFromLocal.tsx -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx #: dashboard/components/Restore/RestoreFromPrivateKey.tsx #: dashboard/components/Restore/RestoreFromMnemonic.tsx -#: dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx msgid "Continue" msgstr "" @@ -800,6 +807,7 @@ msgstr "" msgid "Create Password" msgstr "" +#: dashboard/pages/SetupPersona/Recovery/index.tsx #: popups/pages/Personas/Home/UI.tsx msgid "Create Persona" msgstr "" @@ -875,8 +883,8 @@ msgstr "" #~ msgid "Data merged from Mask Cloud Service to local successfully. Re-enter your password to encrypt and upload the new backup to Mask Cloud Service." #~ msgstr "" -#: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx -#: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx msgid "Decrypt failed, please check password" msgstr "備份解密失敗,請檢查密碼" @@ -981,8 +989,8 @@ msgid "Done" msgstr "完成!" #: content-script/components/InjectedComponents/AutoPasteFailedDialog.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx +#: dashboard/components/GoogleDriveFileTable.tsx msgid "Download" msgstr "下載" @@ -991,10 +999,11 @@ msgstr "下載" #~ msgstr "" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Local.tsx msgid "Download Backup" msgstr "" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Downloading" msgstr "" @@ -1020,16 +1029,16 @@ msgstr "" msgid "eg: X accounts, persona public keys, wallet addresses or ENS" msgstr "" +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Email" msgstr "" +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Email verification code" msgstr "" @@ -1155,6 +1164,7 @@ msgid "Failed to disconnect wallet" msgstr "" #. placeholder {0}: (err as Error).message +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Failed to download and merge the backup: {0}" msgstr "" @@ -1164,10 +1174,19 @@ msgstr "" #~ msgstr "" #. placeholder {0}: (err as Error).message -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/components/GoogleDriveLogin.tsx msgid "Failed to login: {0}" msgstr "" +#: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +msgid "Failed to restore the backup from Google Drive to your browser. Please try again." +msgstr "" + +#. placeholder {0}: (err as Error).message +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Failed to restore the backup: {0}" +msgstr "" + #: popups/pages/Wallet/EditNetwork/index.tsx msgid "Failed to save network" msgstr "" @@ -1325,8 +1344,10 @@ msgstr "" msgid "Give permission to access <0/> your {0}?" msgstr "" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/index.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/index.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx msgid "Google Drive" msgstr "" @@ -1449,10 +1470,12 @@ msgstr "" msgid "Incorrect backup password." msgstr "" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx msgid "Incorrect Backup Password." msgstr "" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Incorrect cloud backup password, please try again." @@ -1473,7 +1496,7 @@ msgid "Incorrect password" msgstr "" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: dashboard/hooks/useBackupFormState.ts #: dashboard/hooks/useBackupFormState.ts @@ -1493,12 +1516,12 @@ msgstr "" msgid "Incorrect Payment Password." msgstr "" -#: dashboard/pages/SetupPersona/Recovery/index.tsx +#: dashboard/pages/SetupPersona/Recovery/PrivateKey.tsx #: dashboard/pages/CreateMaskWallet/Recovery/index.tsx msgid "Incorrect Private Key" msgstr "私钥不正确" -#: dashboard/pages/SetupPersona/Recovery/index.tsx +#: dashboard/pages/SetupPersona/Recovery/Phrase.tsx msgid "Incorrect recovery phrase." msgstr "" @@ -1511,6 +1534,7 @@ msgstr "" msgid "Incorrect words selected. Please try again!" msgstr "" +#: dashboard/pages/SetupPersona/Recovery/PrivateKey.tsx #: dashboard/components/Restore/RestoreFromPrivateKey.tsx msgid "Input your Private Key" msgstr "請輸入你的私鑰" @@ -1529,13 +1553,13 @@ msgid "Invalid Block Explorer URL." msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx msgid "Invalid email address format." msgstr "" -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx msgid "Invalid email address." msgstr "" @@ -1543,7 +1567,7 @@ msgstr "" msgid "Invalid number" msgstr "" -#: dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx msgid "Invalid phone number, please check and try again." msgstr "" @@ -1551,8 +1575,8 @@ msgstr "" msgid "Invalid RPC URL." msgstr "" -#: dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx msgid "Invalid verification code." msgstr "" @@ -1651,8 +1675,9 @@ msgstr "" msgid "Login to Mask Cloud" msgstr "" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx msgid "Logout" msgstr "" @@ -1684,11 +1709,12 @@ msgstr "" #: content-script/components/InjectedComponents/ToolboxUnstyled.tsx #: content-script/components/InjectedComponents/PostDialogHint.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/index.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/index.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/index.tsx msgid "Mask Network" msgstr "" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx msgid "Mask Network Cloud" msgstr "" @@ -1763,18 +1789,21 @@ msgstr "" msgid "Medium" msgstr "" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Merge Completed" msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Merge data to local database" msgstr "" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +#: dashboard/components/GoogleDriveFileTable.tsx msgid "Merge to Browser" msgstr "" @@ -1796,16 +1825,16 @@ msgid "Mnemonic word" msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx msgid "Mobile" msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx msgid "Mobile number" msgstr "" -#: dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx msgid "Mobile verification code" msgstr "" @@ -1919,7 +1948,8 @@ msgid "No back up" msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx +#: dashboard/components/GoogleDriveFileTable.tsx msgid "No backups found" msgstr "" @@ -2050,7 +2080,7 @@ msgid "Paste manually" msgstr "手動貼上" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/LocalBackup.tsx +#: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Wallet/SetPaymentPassword/index.tsx #: popups/modals/WalletRemoveModal/index.tsx @@ -2132,7 +2162,7 @@ msgid "Personas" msgstr "角色" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx msgid "Phone verification code" msgstr "" @@ -2159,6 +2189,7 @@ msgstr "" msgid "Please enter backup password to export persona private key." msgstr "" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Please enter cloud backup password to download file." msgstr "" @@ -2308,6 +2339,11 @@ msgstr "" msgid "Receive" msgstr "" +#: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Recover" +msgstr "" + #: dashboard/pages/SetupPersona/Recovery/index.tsx msgid "Recover your data" msgstr "" @@ -2375,15 +2411,15 @@ msgstr "" msgid "Request Source" msgstr "" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx msgid "Reselect" msgstr "" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Resend" msgstr "重新傳送" @@ -2395,24 +2431,32 @@ msgstr "" msgid "Resource" msgstr "" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx -#: dashboard/components/Restore/RestoreFromCloud/index.tsx -#: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/MaskNetwork.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx msgid "Restore" msgstr "恢復" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx msgid "Restore backup failed." msgstr "" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Restore Completed" +msgstr "" + #: popups/pages/Settings/index.tsx msgid "Restore Database" msgstr "" -#: dashboard/components/Restore/RestoreFromCloud/index.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/MaskNetwork.tsx msgid "Restore failed" msgstr "恢復失敗" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Restore Failed" +msgstr "" + #: popups/pages/Settings/index.tsx msgid "Restore from a previous database backup" msgstr "" @@ -2498,8 +2542,8 @@ msgstr "" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx #: popups/pages/Wallet/components/ActivityList/ActivityItem.tsx #: popups/pages/Wallet/components/ActionGroup/index.tsx #: popups/pages/Wallet/Transfer/index.tsx @@ -2573,8 +2617,8 @@ msgid "Sign" msgstr "簽署" #: dashboard/pages/SetupPersona/Recovery/index.tsx -msgid "Sign Up" -msgstr "" +#~ msgid "Sign Up" +#~ msgstr "" #: popups/components/SignRequestInfo/index.tsx msgid "Sign-in Request" @@ -2703,7 +2747,7 @@ msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx msgid "Switch other account" msgstr "" @@ -2711,7 +2755,7 @@ msgstr "" msgid "Switch Persona" msgstr "" -#: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx msgid "Switch to other accounts" msgstr "" @@ -2741,19 +2785,20 @@ msgid "The chainID is not equal to the currently connected one." msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts -#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts +#: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts +#: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx #: dashboard/contexts/CloudBackupFormContext.tsx msgid "The code is incorrect." msgstr "" -#: dashboard/pages/SetupPersona/Backup/helpers.tsx +#: dashboard/utils/api.ts msgid "The download link is expired" msgstr "" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/MaskNetworkBackup.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/MaskNetwork.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx msgid "The Mask Network Cloud Backup feature will be deactivated on April 30, 2025. Please use alternative cloud backup services or local backup solutions." msgstr "" @@ -2795,7 +2840,7 @@ msgstr "" msgid "The persona name already exists." msgstr "" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/CloudBackupFormContext.ts +#: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx msgid "The phone number is incorrect." msgstr "通訊號碼錯誤" @@ -3018,13 +3063,13 @@ msgstr "" msgid "Unlock" msgstr "解鎖" +#: dashboard/pages/SetupPersona/Recovery/Local.tsx #: dashboard/components/Restore/RestoreWalletFromLocal.tsx -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx msgid "Unpacking" msgstr "" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx msgid "Unsupported data backup" msgstr "不支持數據備份格式" @@ -3072,18 +3117,18 @@ msgstr "" msgid "value" msgstr "" -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx msgid "Verification code has been sent to your email. Please check your mailbox." msgstr "" -#: dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx msgid "Verification code has been sent to your phone." msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/Backup/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Verification code sent" msgstr "驗證碼已傳送" @@ -3205,7 +3250,7 @@ msgstr "" msgid "Welcome to use Mask Network" msgstr "" -#: dashboard/pages/SetupPersona/Backup/CloudBackup/GoogleDriveBackup.tsx +#: dashboard/components/GoogleDriveLogin.tsx msgid "when you click Add Google Drive button,you will be forwarded to Google authorization pages." msgstr "" @@ -3237,6 +3282,10 @@ msgstr "" msgid "You have signed with your wallet." msgstr "" +#: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +msgid "You have successfully restored the backup from Google Drive to your browser." +msgstr "" + #: dashboard/components/Restore/ConfirmSynchronizePasswordDialog.tsx msgid "You have verified your cloud password and recovered your backup. Do you want to let your cloud password and local backup password be the same?" msgstr "" @@ -3255,10 +3304,15 @@ msgstr "" msgid "Your connection to this site is not encrypted which can be modified by a hostile third party, we strongly suggest you reject this request." msgstr "" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Your file has been successfully merged into the browser data." msgstr "" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Your file has been successfully restore into the browser data." +msgstr "" + #: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx msgid "Your payment password encrypts wallet data and is needed to unlocking the wallet, transaction confirmations and signing. The password is never stored, and there is no way to recover it if you forget it." msgstr "" diff --git a/packages/shared-base/src/helpers/relativeRouteOf.ts b/packages/shared-base/src/helpers/relativeRouteOf.ts index 2b7d9593b980..4359b60bae01 100644 --- a/packages/shared-base/src/helpers/relativeRouteOf.ts +++ b/packages/shared-base/src/helpers/relativeRouteOf.ts @@ -4,11 +4,11 @@ export function relativeRouteOf(parent: PopupRoutes): (child: PopupRoutes) => st export function relativeRouteOf(parent: DashboardRoutes): (child: DashboardRoutes) => string export function relativeRouteOf(parent: PopupRoutes | DashboardRoutes) { return (child: string) => { - if (!child.startsWith(parent)) throw new Error() + if (!child.startsWith(parent)) throw new Error(`${child} is not a child of ${parent}`) return child.slice(parent.length).replace(/^\//, '') } } export function relativeRoute(parent: string, child: string) { - if (!child.startsWith(parent)) throw new Error() + if (!child.startsWith(parent)) throw new Error(`${child} is not a child of ${parent}`) return child.slice(parent.length).replace(/^\//, '') } diff --git a/packages/shared-base/src/types/Routes.ts b/packages/shared-base/src/types/Routes.ts index baabdb6839b7..d667b5bf70da 100644 --- a/packages/shared-base/src/types/Routes.ts +++ b/packages/shared-base/src/types/Routes.ts @@ -4,7 +4,15 @@ export enum DashboardRoutes { Permissions = '/setup/permissions', PermissionsOnboarding = '/setup/permissions/onboarding', SignUpPersona = '/setup/sign-up', - RecoveryPersona = '/setup/recovery', + + Recovery = '/setup/recovery', + RecoveryPhrase = '/setup/recovery/phrase', + RecoveryPrivateKey = '/setup/recovery/private-key', + RecoveryLocal = '/setup/recovery/local', + RecoveryCloud = '/setup/recovery/cloud', + RecoveryCloudMaskNetwork = '/setup/recovery/cloud/mask-network', + RecoveryCloudGoogleDrive = '/setup/recovery/cloud/google-drive', + SignUpPersonaMnemonic = '/setup/sign-up/mnemonic', SignUpPersonaOnboarding = '/setup/sign-up/onboarding', Backup = '/setup/backup', diff --git a/packages/shared/src/hooks/usePathTab.ts b/packages/shared/src/hooks/usePathTab.ts index f5ffc7e1e75c..977b2bfdc9c7 100644 --- a/packages/shared/src/hooks/usePathTab.ts +++ b/packages/shared/src/hooks/usePathTab.ts @@ -1,20 +1,40 @@ -import { useCallback } from 'react' +import { useRenderPhraseCallbackOnDepsChange } from '@masknet/shared-base-ui' +import { sortBy, uniq } from 'lodash-es' +import { useCallback, useMemo, useState } from 'react' import { useLocation, useNavigate } from 'react-router-dom' -export type TabPathPair = [tab: string, ...paths: string[]] -export function usePathTab(pairs: TabPathPair[], keepSearch = false) { +export type TabPathTuple = [tab: string, ...paths: string[]] +export function usePathTab(tuples: TabPathTuple[], keepSearch = false) { const navigate = useNavigate() const location = useLocation() const { pathname, search } = location - const firstPair = pairs[0] - const tab = pairs.find(([, ...paths]) => paths.includes(pathname))?.[0] || firstPair[0] + + const [history, setHistory] = useState([]) + useRenderPhraseCallbackOnDepsChange(() => { + setHistory((stack) => { + return uniq([pathname, ...stack]) + }) + }, [pathname]) + + // Put the last matched route in the first position of each tuple + // to keep the last visited tab in nested route. + const dynamicTuples = useMemo(() => { + return tuples.map((pair) => { + if (pair.length === 2) return pair + const [tab, ...paths] = pair + return [tab, ...sortBy(paths, (route) => history.indexOf(route))] + }) + }, [tuples, history]) + + const firstTuple = dynamicTuples[0] + const tab = dynamicTuples.find(([, ...paths]) => paths.includes(pathname))?.[0] || firstTuple[0] const handleTabChange = useCallback( (_: unknown, tab: string) => { - const pair = pairs.find((pair) => pair[0] === tab) || firstPair - navigate(keepSearch ? `${pair[1]}${search}` : pair[1], { replace: true }) + const tuple = dynamicTuples.find((pair) => pair[0] === tab) || firstTuple + navigate(keepSearch ? `${tuple[1]}${search}` : tuple[1], { replace: true }) }, - [navigate, keepSearch, search], + [navigate, keepSearch, search, dynamicTuples], ) return [tab, handleTabChange] as const diff --git a/packages/web3-providers/src/GoogleDriveClient/index.ts b/packages/web3-providers/src/GoogleDriveClient/index.ts index ad3c588e6ac7..fb9da920c6db 100644 --- a/packages/web3-providers/src/GoogleDriveClient/index.ts +++ b/packages/web3-providers/src/GoogleDriveClient/index.ts @@ -34,40 +34,58 @@ interface UserInfo { locale?: string } +type Callback = (isLogin: boolean) => void export class GoogleDriveClient { - private getToken: () => Promise + private getToken: (interactive?: boolean) => Promise private clearToken: () => Promise private baseUrl: string = 'https://www.googleapis.com/drive/v3' private uploadUrl: string = 'https://www.googleapis.com/upload/drive/v3' private backupFolderName: string = 'Mask network backup' - private token: string | undefined + private callbacks: Callback[] = [] constructor(getToken: () => Promise, clearToken: () => Promise) { this.getToken = getToken this.clearToken = clearToken } - get hasLogin() { - return !!this.token + async login(interactive?: boolean) { + const userInfo = await this.getUserInfo(interactive) + if (userInfo) { + this.callbacks.forEach((callback) => callback(true)) + } + return userInfo + } + async logout() { + await this.clearToken() + this.callbacks.forEach((callback) => callback(false)) } - private async request(input: string | URL | globalThis.Request, init?: RequestInit): Promise { - this.token = await this.getToken() + private async request( + input: string | URL | globalThis.Request, + init?: RequestInit, + interactive?: boolean, + ): Promise { + const token = await this.getToken(interactive) const response = await fetch(input, { ...init, headers: { ...init?.headers, - Authorization: `Bearer ${this.token}`, + Authorization: `Bearer ${token}`, }, }) if (!response.ok) { if (response.status === 401 || response.status === 403) { - this.token = undefined - await this.clearToken() + await this.logout() } throw new Error(`HTTP error! status: ${response.status}`) } return response } + public subscribe(callback: Callback) { + this.callbacks.push(callback) + return () => { + this.callbacks = this.callbacks.filter((cb) => cb !== callback) + } + } public async listFiles(params: ListFilesParams = {}): Promise { try { @@ -242,13 +260,17 @@ export class GoogleDriveClient { return response } - public async getUserInfo(): Promise { + public async getUserInfo(interactive?: boolean): Promise { try { - const response = await this.request('https://www.googleapis.com/oauth2/v3/userinfo', { - headers: { - 'Content-Type': 'application/json', + const response = await this.request( + 'https://www.googleapis.com/oauth2/v3/userinfo', + { + headers: { + 'Content-Type': 'application/json', + }, }, - }) + interactive, + ) return (await response.json()) as UserInfo } catch (error) { From 01214e350e97df9b913ace66a66b10d75a1e1341 Mon Sep 17 00:00:00 2001 From: Jack Works <5390719+Jack-Works@users.noreply.github.com> Date: Thu, 3 Apr 2025 17:50:22 +0800 Subject: [PATCH 04/20] refactor: rewrite onboarding writer to avoid break words in i18n (#12179) * refactor: rewrite onboarding writer to avoid break words in i18n * fix: run codegen --------- Co-authored-by: Jack-Works --- .../components/OnboardingWriter/index.tsx | 116 +++++++++--------- .../CreateMaskWallet/Onboarding/index.tsx | 12 +- .../pages/SetupPersona/Onboarding/index.tsx | 23 ++-- .../PermissionOnboarding/index.tsx | 8 +- packages/mask/shared-ui/locale/en-US.json | 18 ++- packages/mask/shared-ui/locale/en-US.po | 66 +++++++--- packages/mask/shared-ui/locale/ja-JP.json | 18 ++- packages/mask/shared-ui/locale/ja-JP.po | 66 +++++++--- packages/mask/shared-ui/locale/ko-KR.json | 18 ++- packages/mask/shared-ui/locale/ko-KR.po | 66 +++++++--- packages/mask/shared-ui/locale/zh-CN.json | 18 ++- packages/mask/shared-ui/locale/zh-CN.po | 66 +++++++--- packages/mask/shared-ui/locale/zh-TW.json | 18 ++- packages/mask/shared-ui/locale/zh-TW.po | 66 +++++++--- 14 files changed, 405 insertions(+), 174 deletions(-) diff --git a/packages/mask/dashboard/components/OnboardingWriter/index.tsx b/packages/mask/dashboard/components/OnboardingWriter/index.tsx index 8a4ccba9b162..3642159d0752 100644 --- a/packages/mask/dashboard/components/OnboardingWriter/index.tsx +++ b/packages/mask/dashboard/components/OnboardingWriter/index.tsx @@ -1,8 +1,7 @@ -import { sum } from 'lodash-es' -import { useState, useMemo, useEffect } from 'react' +import { useState, useMemo, useEffect, type JSX } from 'react' import { makeStyles } from '@masknet/theme' import { Typography } from '@mui/material' -import { useRenderPhraseCallbackOnDepsChange } from '@masknet/shared-base-ui' +import { isNonNull } from '@masknet/kit' const useStyles = makeStyles()((theme) => ({ typed: { @@ -13,75 +12,82 @@ const useStyles = makeStyles()((theme) => ({ color: theme.palette.maskColor.highlight, }, }, - endTyping: { + typing: { opacity: 0.5, }, })) interface OnboardingWriterProps extends withClasses<'typed' | 'endTyping'> { - sentence: Array + sentence: Array } -let segmenter: Intl.Segmenter export function OnboardingWriter({ sentence, ...props }: OnboardingWriterProps) { const { classes, cx } = useStyles(undefined, { props }) + const typing = cx(classes.typing, classes.typed) + const [jsx, setJsx] = useState(undefined) - const allChars = useMemo(() => sentence.flat().filter(Boolean).join(''), [sentence]) - const allCharsSegmented = useMemo(() => { - return [...(segmenter ||= new Intl.Segmenter()).segment(allChars)].map((x) => x.segment) - }, [allChars]) - const segmentCount = allCharsSegmented.length - - const [codePointIndex, setCodePointIndex] = useState(0) - const [segmentIndex, setSegmentIndex] = useState(0) - useRenderPhraseCallbackOnDepsChange(() => { - setCodePointIndex(0) - setSegmentIndex(0) - }, [sentence]) + const writer = useMemo(() => onBoardingWriter({ typed: classes.typed, typing }, sentence), [sentence]) useEffect(() => { const timer = setInterval(() => { - setSegmentIndex((segmentIndex) => { - const nextSegmentIndex = segmentIndex + 1 - if (segmentIndex > segmentCount) { - clearInterval(timer) - return segmentIndex - } - setCodePointIndex(allCharsSegmented.slice(0, nextSegmentIndex).join('').length) - return nextSegmentIndex - }) + const next = writer.next() + if (next.done) { + clearInterval(timer) + } else { + setJsx(next.value) + } }, 50) return () => { clearInterval(timer) } - }, [allCharsSegmented, segmentCount]) + }, [writer]) - const jsx = useMemo(() => { - const newJsx = [] - let remain = codePointIndex - for (const fragment of sentence) { - if (!fragment) continue - if (remain <= 0) break - const size = sum(fragment.map((x) => x.length)) - const take = Math.min(size, remain) - - remain -= take - - const [text, strongText] = fragment + return jsx +} +let segmenter: Intl.Segmenter +function* onBoardingWriter(className: { typed: string; typing: string }, sentences: Array) { + segmenter ||= new Intl.Segmenter() + const previousLines: JSX.Element[] = [] + const currentLine: Array<{ type: 'bold' | 'normal'; text: string }> = [{ type: 'normal', text: '' }] - const className = cx(classes.typed, remain !== 0 ? classes.endTyping : undefined) - // the trailing space gets trimmed by i18n marco - if (take <= text.length) newJsx.push({text.slice(0, take)}) - else - newJsx.push( - - {text} - {strongText.slice(0, take - text.length)} - , - ) + for (const sentence of sentences.filter(isNonNull)) { + const chars = [...segmenter.segment(sentence)] + let currentLineJSX: JSX.Element | undefined + for (let index = 0; index < chars.length; index += 1) { + const char = chars[index].segment + const lastPiece = currentLine.at(-1)! + if (char === '*') { + const nextChar = chars[index + 1]?.segment + if (nextChar === '*') { + currentLine.push({ type: lastPiece.type === 'normal' ? 'bold' : 'normal', text: '' }) + index += 1 + continue + } + } + lastPiece.text += char + const children = currentLine.map((x, index) => + x.type === 'normal' ? x.text : {x.text}, + ) + currentLineJSX = ( + + {children} + + ) + yield ( + <> + {previousLines} + { + + {children} + + } + + ) } - - return newJsx - }, [sentence, codePointIndex]) - - return <>{jsx} + if (currentLineJSX) { + previousLines.push(currentLineJSX) + currentLine.length = 0 + currentLine.push({ type: 'normal', text: '' }) + } + yield <>{previousLines} + } } diff --git a/packages/mask/dashboard/pages/CreateMaskWallet/Onboarding/index.tsx b/packages/mask/dashboard/pages/CreateMaskWallet/Onboarding/index.tsx index c2697891ced4..7d53ac5359cd 100644 --- a/packages/mask/dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +++ b/packages/mask/dashboard/pages/CreateMaskWallet/Onboarding/index.tsx @@ -74,14 +74,14 @@ export const Component = memo(function Onboarding() { window.close() }, []) - const sentence: string[][] = useMemo(() => { + const sentence: string[] = useMemo(() => { return [ - [t`Creating your `, t`wallet`], - [t`Generating your `, t`accounts`], - [t`Encrypting your `, t`data`], - [t`Your Wallet is on `, t`ready 🚀`], + t`Creating your **wallet**`, + t`Generating your **accounts**`, + t`Encrypting your **data**`, + t`Your Wallet is on **ready 🚀**`, ] - }, []) + }, [t]) return ( <> diff --git a/packages/mask/dashboard/pages/SetupPersona/Onboarding/index.tsx b/packages/mask/dashboard/pages/SetupPersona/Onboarding/index.tsx index 7d6b73fc1608..feb7b3e59749 100644 --- a/packages/mask/dashboard/pages/SetupPersona/Onboarding/index.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/Onboarding/index.tsx @@ -115,24 +115,21 @@ export const Component = memo(function Onboarding() { }) }, [retry]) - const sentence: Array = useMemo(() => { + const sentence: Array = useMemo(() => { const count = params.get('count') return [ - [t`Creating your `, t`identity`], - [t`Generating your `, t`accounts`], - [t`Encrypting your `, t`data`], - [t`Your Persona is on `, t`ready 🚀`], + t`Creating your **identity**`, + t`Generating your **accounts**`, + t`Encrypting your **data**`, + t`Your Persona is on **ready 🚀**`, count && !isZero(count) ? - [ - t`You have recovered `, - plural(count, { - one: '# Wallet 🚀', - other: '# Wallets 🚀', - }), - ] + plural(count, { + one: 'You have recovered **# Wallet 🚀**', + other: 'You have recovered **# Wallets 🚀**', + }) : undefined, ] - }, []) + }, [t, count]) return ( <> diff --git a/packages/mask/dashboard/pages/SetupPersona/PermissionOnboarding/index.tsx b/packages/mask/dashboard/pages/SetupPersona/PermissionOnboarding/index.tsx index a91b6cd3f847..4600318c071d 100644 --- a/packages/mask/dashboard/pages/SetupPersona/PermissionOnboarding/index.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/PermissionOnboarding/index.tsx @@ -100,13 +100,11 @@ export const Component = memo(function Onboarding() { window.close() }, []) - const sentence: string[][] = useMemo(() => { + const sentence: string[] = useMemo(() => { return [ - [ - t`We are pleased to inform you that the update for X (formerly named Twitter) website has been completed. You can now continue to enjoy all the features of Mask Network as usual. Thank you for your continuous support!`, - ], + t`We are pleased to inform you that the update for X (formerly named Twitter) website has been completed. You can now continue to enjoy all the features of Mask Network as usual. Thank you for your continuous support!`, ] - }, []) + }, [t]) return ( <> diff --git a/packages/mask/shared-ui/locale/en-US.json b/packages/mask/shared-ui/locale/en-US.json index a502db7fb84e..f2b92aaa130d 100644 --- a/packages/mask/shared-ui/locale/en-US.json +++ b/packages/mask/shared-ui/locale/en-US.json @@ -7,6 +7,16 @@ "y6VCOb": [["0"], " Mins"], "MpnSqP": [["0"], " Pending"], "FKrzPv": [["count", "plural", { "one": ["#", " Wallet 🚀"], "other": ["#", " Wallets 🚀"] }]], + "5s6EhU": [ + [ + "count", + "plural", + { + "one": ["You have recovered **", "#", " Wallet 🚀**"], + "other": ["You have recovered **", "#", " Wallets 🚀**"] + } + ] + ], "yx3mb0": [ [ "decryptProgress", @@ -203,6 +213,8 @@ "PjBWOL": ["Create your persona to get started"], "WgawP2": ["Creating your"], "cEnmTp": ["Creating your "], + "L82H5Z": ["Creating your **identity**"], + "F7U8uz": ["Creating your **wallet**"], "Q2lUR2": ["Currency"], "OgPkDe": ["Currency Symbol (Optional)"], "oOQfsI": ["Current account is not the verifying account."], @@ -274,6 +286,7 @@ "w1ctdJ": ["Encrypted Post"], "MRIXE3": ["Encrypting your"], "zutir1": ["Encrypting your "], + "XB3tfc": ["Encrypting your **data**"], "Cz6Lx7": ["Encryption Method"], "N/fqDa": ["Ens or Address(0x)"], "mPxxVq": ["Enter a gas limit"], @@ -335,6 +348,7 @@ "fUn3xA": ["Generate a new wallet address"], "tdZPpe": ["Generating your"], "CiU2m/": ["Generating your "], + "RL5m+x": ["Generating your **accounts**"], "2p7WMm": ["Give permission to access <0/> your ", ["0"], "?"], "w9Xmw/": ["Google Drive"], "76gPWk": ["Got it"], @@ -845,7 +859,9 @@ ], "N19nSk": ["Your Persona is on"], "WC7pDz": ["Your Persona is on "], + "PDW/HG": ["Your Persona is on **ready 🚀**"], "0kr+x1": ["Your Wallet is on"], - "v7OL2k": ["Your Wallet is on "] + "v7OL2k": ["Your Wallet is on "], + "wCtp6y": ["Your Wallet is on **ready 🚀**"] } } diff --git a/packages/mask/shared-ui/locale/en-US.po b/packages/mask/shared-ui/locale/en-US.po index c65f9a02fe9f..477c7cb2873c 100644 --- a/packages/mask/shared-ui/locale/en-US.po +++ b/packages/mask/shared-ui/locale/en-US.po @@ -41,7 +41,11 @@ msgid "{0} Pending" msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx -msgid "{count, plural, one {# Wallet 🚀} other {# Wallets 🚀}}" +#~ msgid "{count, plural, one {# Wallet 🚀} other {# Wallets 🚀}}" +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +msgid "{count, plural, one {You have recovered **# Wallet 🚀**} other {You have recovered **# Wallets 🚀**}}" msgstr "" #: content-script/components/InjectedComponents/DecryptedPost/DecryptPostAwaiting.tsx @@ -127,8 +131,8 @@ msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "accounts" -msgstr "" +#~ msgid "accounts" +#~ msgstr "" #: popups/pages/Wallet/components/WalletAssets/index.tsx msgid "Activities" @@ -818,7 +822,15 @@ msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "Creating your " +#~ msgid "Creating your " +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +msgid "Creating your **identity**" +msgstr "" + +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +msgid "Creating your **wallet**" msgstr "" #: popups/pages/Wallet/WalletSettings/ChangeCurrency.tsx @@ -859,8 +871,8 @@ msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "data" -msgstr "" +#~ msgid "data" +#~ msgstr "" #: popups/pages/Wallet/Interaction/TransactionRequest.tsx msgid "Data" @@ -1064,7 +1076,12 @@ msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "Encrypting your " +#~ msgid "Encrypting your " +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +msgid "Encrypting your **data**" msgstr "" #: content-script/components/CompositionDialog/EncryptionMethodSelector.tsx @@ -1329,7 +1346,12 @@ msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "Generating your " +#~ msgid "Generating your " +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +msgid "Generating your **accounts**" msgstr "" #. placeholder {0}: contract?.symbol || '' @@ -1411,8 +1433,8 @@ msgid "I wrote down those words in the correct order" msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx -msgid "identity" -msgstr "" +#~ msgid "identity" +#~ msgstr "" #: dashboard/pages/SetupPersona/Mnemonic/ComponentToPrint.tsx msgid "Identity ID" @@ -2322,8 +2344,8 @@ msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "ready 🚀" -msgstr "" +#~ msgid "ready 🚀" +#~ msgstr "" #: content-script/components/CompositionDialog/useSubmit.ts msgid "realMaskNetwork" @@ -3176,8 +3198,8 @@ msgid "Waiting for {providerType}" msgstr "" #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "wallet" -msgstr "" +#~ msgid "wallet" +#~ msgstr "" #: popups/pages/Wallet/SwitchWallet/index.tsx #: popups/modals/WalletGroupModal/index.tsx @@ -3270,8 +3292,8 @@ msgstr "" #~ msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx -msgid "You have recovered " -msgstr "" +#~ msgid "You have recovered " +#~ msgstr "" #: popups/pages/Personas/ConnectWallet/index.tsx msgid "You have signed with your wallet." @@ -3317,7 +3339,11 @@ msgstr "" #~ msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx -msgid "Your Persona is on " +#~ msgid "Your Persona is on " +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +msgid "Your Persona is on **ready 🚀**" msgstr "" #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx @@ -3325,5 +3351,9 @@ msgstr "" #~ msgstr "" #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "Your Wallet is on " +#~ msgid "Your Wallet is on " +#~ msgstr "" + +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +msgid "Your Wallet is on **ready 🚀**" msgstr "" diff --git a/packages/mask/shared-ui/locale/ja-JP.json b/packages/mask/shared-ui/locale/ja-JP.json index 1c6a73b08cd3..6597cb1d66b7 100644 --- a/packages/mask/shared-ui/locale/ja-JP.json +++ b/packages/mask/shared-ui/locale/ja-JP.json @@ -7,6 +7,16 @@ "y6VCOb": [["0"], " 分"], "MpnSqP": [["0"], " Pending"], "FKrzPv": [["count", "plural", { "one": ["#", " Wallet 🚀"], "other": ["#", " Wallets 🚀"] }]], + "5s6EhU": [ + [ + "count", + "plural", + { + "one": ["You have recovered **", "#", " Wallet 🚀**"], + "other": ["You have recovered **", "#", " Wallets 🚀**"] + } + ] + ], "yx3mb0": [ [ "decryptProgress", @@ -201,6 +211,8 @@ "PjBWOL": ["あなたのペルソナを作成して始めましょう"], "WgawP2": ["Creating your"], "cEnmTp": ["Creating your "], + "L82H5Z": ["Creating your **identity**"], + "F7U8uz": ["Creating your **wallet**"], "Q2lUR2": ["通貨"], "OgPkDe": ["通貨記号(オプション)"], "oOQfsI": ["Current account is not the verifying account."], @@ -272,6 +284,7 @@ "w1ctdJ": ["Mask: 作成"], "MRIXE3": ["Encrypting your"], "zutir1": ["Encrypting your "], + "XB3tfc": ["Encrypting your **data**"], "Cz6Lx7": ["暗号化方法"], "N/fqDa": ["Ens または Address(0x)"], "mPxxVq": ["ガスの制限を入力してください"], @@ -333,6 +346,7 @@ "fUn3xA": ["新しいウォレットアドレスを生成する"], "tdZPpe": ["Generating your"], "CiU2m/": ["Generating your "], + "RL5m+x": ["Generating your **accounts**"], "2p7WMm": ["Give permission to access <0/> your ", ["0"], "?"], "w9Xmw/": ["Google Drive"], "76gPWk": ["了解"], @@ -845,7 +859,9 @@ ], "N19nSk": ["Your Persona is on"], "WC7pDz": ["Your Persona is on "], + "PDW/HG": ["Your Persona is on **ready 🚀**"], "0kr+x1": ["Your Wallet is on"], - "v7OL2k": ["Your Wallet is on "] + "v7OL2k": ["Your Wallet is on "], + "wCtp6y": ["Your Wallet is on **ready 🚀**"] } } diff --git a/packages/mask/shared-ui/locale/ja-JP.po b/packages/mask/shared-ui/locale/ja-JP.po index d19c247bd108..8cf0b7c371bf 100644 --- a/packages/mask/shared-ui/locale/ja-JP.po +++ b/packages/mask/shared-ui/locale/ja-JP.po @@ -46,7 +46,11 @@ msgid "{0} Pending" msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx -msgid "{count, plural, one {# Wallet 🚀} other {# Wallets 🚀}}" +#~ msgid "{count, plural, one {# Wallet 🚀} other {# Wallets 🚀}}" +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +msgid "{count, plural, one {You have recovered **# Wallet 🚀**} other {You have recovered **# Wallets 🚀**}}" msgstr "" #: content-script/components/InjectedComponents/DecryptedPost/DecryptPostAwaiting.tsx @@ -132,8 +136,8 @@ msgstr "ソーシャルメディアで Web3 dApps の機能を探索してみて #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "accounts" -msgstr "アカウント" +#~ msgid "accounts" +#~ msgstr "アカウント" #: popups/pages/Wallet/components/WalletAssets/index.tsx msgid "Activities" @@ -823,7 +827,15 @@ msgstr "あなたのペルソナを作成して始めましょう" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "Creating your " +#~ msgid "Creating your " +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +msgid "Creating your **identity**" +msgstr "" + +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +msgid "Creating your **wallet**" msgstr "" #: popups/pages/Wallet/WalletSettings/ChangeCurrency.tsx @@ -864,8 +876,8 @@ msgstr "ダーク" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "data" -msgstr "データ" +#~ msgid "data" +#~ msgstr "データ" #: popups/pages/Wallet/Interaction/TransactionRequest.tsx msgid "Data" @@ -1069,7 +1081,12 @@ msgstr "Mask: 作成" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "Encrypting your " +#~ msgid "Encrypting your " +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +msgid "Encrypting your **data**" msgstr "" #: content-script/components/CompositionDialog/EncryptionMethodSelector.tsx @@ -1334,7 +1351,12 @@ msgstr "新しいウォレットアドレスを生成する" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "Generating your " +#~ msgid "Generating your " +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +msgid "Generating your **accounts**" msgstr "" #. placeholder {0}: contract?.symbol || '' @@ -1416,8 +1438,8 @@ msgid "I wrote down those words in the correct order" msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx -msgid "identity" -msgstr "アイデンティティ" +#~ msgid "identity" +#~ msgstr "アイデンティティ" #: dashboard/pages/SetupPersona/Mnemonic/ComponentToPrint.tsx msgid "Identity ID" @@ -2327,8 +2349,8 @@ msgstr "再入力" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "ready 🚀" -msgstr "準備完了🚀" +#~ msgid "ready 🚀" +#~ msgstr "準備完了🚀" #: content-script/components/CompositionDialog/useSubmit.ts msgid "realMaskNetwork" @@ -3181,8 +3203,8 @@ msgid "Waiting for {providerType}" msgstr "" #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "wallet" -msgstr "ウォレット" +#~ msgid "wallet" +#~ msgstr "ウォレット" #: popups/pages/Wallet/SwitchWallet/index.tsx #: popups/modals/WalletGroupModal/index.tsx @@ -3275,8 +3297,8 @@ msgstr "" #~ msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx -msgid "You have recovered " -msgstr "" +#~ msgid "You have recovered " +#~ msgstr "" #: popups/pages/Personas/ConnectWallet/index.tsx msgid "You have signed with your wallet." @@ -3322,7 +3344,11 @@ msgstr "" #~ msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx -msgid "Your Persona is on " +#~ msgid "Your Persona is on " +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +msgid "Your Persona is on **ready 🚀**" msgstr "" #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx @@ -3330,5 +3356,9 @@ msgstr "" #~ msgstr "" #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "Your Wallet is on " +#~ msgid "Your Wallet is on " +#~ msgstr "" + +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +msgid "Your Wallet is on **ready 🚀**" msgstr "" diff --git a/packages/mask/shared-ui/locale/ko-KR.json b/packages/mask/shared-ui/locale/ko-KR.json index a853632644b1..0b9875b3643b 100644 --- a/packages/mask/shared-ui/locale/ko-KR.json +++ b/packages/mask/shared-ui/locale/ko-KR.json @@ -7,6 +7,16 @@ "y6VCOb": [["0"], " 분"], "MpnSqP": [["0"], " Pending"], "FKrzPv": [["count", "plural", { "one": ["#", " Wallet 🚀"], "other": ["#", " Wallets 🚀"] }]], + "5s6EhU": [ + [ + "count", + "plural", + { + "one": ["You have recovered **", "#", " Wallet 🚀**"], + "other": ["You have recovered **", "#", " Wallets 🚀**"] + } + ] + ], "yx3mb0": [ [ "decryptProgress", @@ -201,6 +211,8 @@ "PjBWOL": ["이용하기 전에 페르소나 한번 만들어 보세요"], "WgawP2": ["Creating your"], "cEnmTp": ["Creating your "], + "L82H5Z": ["Creating your **identity**"], + "F7U8uz": ["Creating your **wallet**"], "Q2lUR2": ["통화"], "OgPkDe": ["통화 기호(옵션)"], "oOQfsI": ["Current account is not the verifying account."], @@ -272,6 +284,7 @@ "w1ctdJ": ["Mask: 편집"], "MRIXE3": ["Encrypting your"], "zutir1": ["Encrypting your "], + "XB3tfc": ["Encrypting your **data**"], "Cz6Lx7": ["암호화 방식"], "N/fqDa": ["Ens 나 주소(0x)"], "mPxxVq": ["기스비 한도 입력"], @@ -333,6 +346,7 @@ "fUn3xA": ["새로운 월렛 주소 생성"], "tdZPpe": ["Generating your"], "CiU2m/": ["Generating your "], + "RL5m+x": ["Generating your **accounts**"], "2p7WMm": ["Give permission to access <0/> your ", ["0"], "?"], "w9Xmw/": ["Google Drive"], "76gPWk": ["알겠습니다"], @@ -841,7 +855,9 @@ ], "N19nSk": ["Your Persona is on"], "WC7pDz": ["Your Persona is on "], + "PDW/HG": ["Your Persona is on **ready 🚀**"], "0kr+x1": ["Your Wallet is on"], - "v7OL2k": ["Your Wallet is on "] + "v7OL2k": ["Your Wallet is on "], + "wCtp6y": ["Your Wallet is on **ready 🚀**"] } } diff --git a/packages/mask/shared-ui/locale/ko-KR.po b/packages/mask/shared-ui/locale/ko-KR.po index b6165db0a109..9afd59f5830f 100644 --- a/packages/mask/shared-ui/locale/ko-KR.po +++ b/packages/mask/shared-ui/locale/ko-KR.po @@ -46,7 +46,11 @@ msgid "{0} Pending" msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx -msgid "{count, plural, one {# Wallet 🚀} other {# Wallets 🚀}}" +#~ msgid "{count, plural, one {# Wallet 🚀} other {# Wallets 🚀}}" +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +msgid "{count, plural, one {You have recovered **# Wallet 🚀**} other {You have recovered **# Wallets 🚀**}}" msgstr "" #: content-script/components/InjectedComponents/DecryptedPost/DecryptPostAwaiting.tsx @@ -132,8 +136,8 @@ msgstr "소결 미디어에서 웹3 앱을 탐색해 보세요." #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "accounts" -msgstr "계정" +#~ msgid "accounts" +#~ msgstr "계정" #: popups/pages/Wallet/components/WalletAssets/index.tsx msgid "Activities" @@ -823,7 +827,15 @@ msgstr "이용하기 전에 페르소나 한번 만들어 보세요" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "Creating your " +#~ msgid "Creating your " +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +msgid "Creating your **identity**" +msgstr "" + +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +msgid "Creating your **wallet**" msgstr "" #: popups/pages/Wallet/WalletSettings/ChangeCurrency.tsx @@ -864,8 +876,8 @@ msgstr "다크" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "data" -msgstr "데이터" +#~ msgid "data" +#~ msgstr "데이터" #: popups/pages/Wallet/Interaction/TransactionRequest.tsx msgid "Data" @@ -1069,7 +1081,12 @@ msgstr "Mask: 편집" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "Encrypting your " +#~ msgid "Encrypting your " +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +msgid "Encrypting your **data**" msgstr "" #: content-script/components/CompositionDialog/EncryptionMethodSelector.tsx @@ -1334,7 +1351,12 @@ msgstr "새로운 월렛 주소 생성" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "Generating your " +#~ msgid "Generating your " +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +msgid "Generating your **accounts**" msgstr "" #. placeholder {0}: contract?.symbol || '' @@ -1416,8 +1438,8 @@ msgid "I wrote down those words in the correct order" msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx -msgid "identity" -msgstr "아이덴티티" +#~ msgid "identity" +#~ msgstr "아이덴티티" #: dashboard/pages/SetupPersona/Mnemonic/ComponentToPrint.tsx msgid "Identity ID" @@ -2327,8 +2349,8 @@ msgstr "다시 입력" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "ready 🚀" -msgstr "준비 🚀" +#~ msgid "ready 🚀" +#~ msgstr "준비 🚀" #: content-script/components/CompositionDialog/useSubmit.ts msgid "realMaskNetwork" @@ -3181,8 +3203,8 @@ msgid "Waiting for {providerType}" msgstr "" #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "wallet" -msgstr "월렛" +#~ msgid "wallet" +#~ msgstr "월렛" #: popups/pages/Wallet/SwitchWallet/index.tsx #: popups/modals/WalletGroupModal/index.tsx @@ -3275,8 +3297,8 @@ msgstr "" #~ msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx -msgid "You have recovered " -msgstr "" +#~ msgid "You have recovered " +#~ msgstr "" #: popups/pages/Personas/ConnectWallet/index.tsx msgid "You have signed with your wallet." @@ -3322,7 +3344,11 @@ msgstr "" #~ msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx -msgid "Your Persona is on " +#~ msgid "Your Persona is on " +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +msgid "Your Persona is on **ready 🚀**" msgstr "" #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx @@ -3330,5 +3356,9 @@ msgstr "" #~ msgstr "" #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "Your Wallet is on " +#~ msgid "Your Wallet is on " +#~ msgstr "" + +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +msgid "Your Wallet is on **ready 🚀**" msgstr "" diff --git a/packages/mask/shared-ui/locale/zh-CN.json b/packages/mask/shared-ui/locale/zh-CN.json index e1d6cb76a2f0..8fae14ec954b 100644 --- a/packages/mask/shared-ui/locale/zh-CN.json +++ b/packages/mask/shared-ui/locale/zh-CN.json @@ -7,6 +7,16 @@ "y6VCOb": [["0"], " 分钟"], "MpnSqP": [["0"], " Pending"], "FKrzPv": [["count", "plural", { "one": ["#", " Wallet 🚀"], "other": ["#", " Wallets 🚀"] }]], + "5s6EhU": [ + [ + "count", + "plural", + { + "one": ["You have recovered **", "#", " Wallet 🚀**"], + "other": ["You have recovered **", "#", " Wallets 🚀**"] + } + ] + ], "yx3mb0": [ [ "decryptProgress", @@ -199,6 +209,8 @@ "PjBWOL": ["创建您的身份以开始"], "WgawP2": ["Creating your"], "cEnmTp": ["Creating your "], + "L82H5Z": ["Creating your **identity**"], + "F7U8uz": ["Creating your **wallet**"], "Q2lUR2": ["货币"], "OgPkDe": ["货币符号(可选)"], "oOQfsI": ["Current account is not the verifying account."], @@ -270,6 +282,7 @@ "w1ctdJ": ["加密贴文"], "MRIXE3": ["Encrypting your"], "zutir1": ["Encrypting your "], + "XB3tfc": ["Encrypting your **data**"], "Cz6Lx7": ["加密方式"], "N/fqDa": ["Ens或地址(0x)"], "mPxxVq": ["输入Gas Limit"], @@ -331,6 +344,7 @@ "fUn3xA": ["生成一个新的钱包地址"], "tdZPpe": ["Generating your"], "CiU2m/": ["Generating your "], + "RL5m+x": ["Generating your **accounts**"], "2p7WMm": ["Give permission to access <0/> your ", ["0"], "?"], "w9Xmw/": ["Google Drive"], "76gPWk": ["好的"], @@ -835,7 +849,9 @@ ], "N19nSk": ["Your Persona is on"], "WC7pDz": ["Your Persona is on "], + "PDW/HG": ["Your Persona is on **ready 🚀**"], "0kr+x1": ["Your Wallet is on"], - "v7OL2k": ["Your Wallet is on "] + "v7OL2k": ["Your Wallet is on "], + "wCtp6y": ["Your Wallet is on **ready 🚀**"] } } diff --git a/packages/mask/shared-ui/locale/zh-CN.po b/packages/mask/shared-ui/locale/zh-CN.po index 046f4a873e12..f603e9176efc 100644 --- a/packages/mask/shared-ui/locale/zh-CN.po +++ b/packages/mask/shared-ui/locale/zh-CN.po @@ -46,7 +46,11 @@ msgid "{0} Pending" msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx -msgid "{count, plural, one {# Wallet 🚀} other {# Wallets 🚀}}" +#~ msgid "{count, plural, one {# Wallet 🚀} other {# Wallets 🚀}}" +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +msgid "{count, plural, one {You have recovered **# Wallet 🚀**} other {You have recovered **# Wallets 🚀**}}" msgstr "" #: content-script/components/InjectedComponents/DecryptedPost/DecryptPostAwaiting.tsx @@ -132,8 +136,8 @@ msgstr "尝试探索社交媒体上的 Web3 dApps 功能。" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "accounts" -msgstr "账户" +#~ msgid "accounts" +#~ msgstr "账户" #: popups/pages/Wallet/components/WalletAssets/index.tsx msgid "Activities" @@ -823,7 +827,15 @@ msgstr "创建您的身份以开始" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "Creating your " +#~ msgid "Creating your " +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +msgid "Creating your **identity**" +msgstr "" + +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +msgid "Creating your **wallet**" msgstr "" #: popups/pages/Wallet/WalletSettings/ChangeCurrency.tsx @@ -864,8 +876,8 @@ msgstr "深色" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "data" -msgstr "数据" +#~ msgid "data" +#~ msgstr "数据" #: popups/pages/Wallet/Interaction/TransactionRequest.tsx msgid "Data" @@ -1069,7 +1081,12 @@ msgstr "加密贴文" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "Encrypting your " +#~ msgid "Encrypting your " +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +msgid "Encrypting your **data**" msgstr "" #: content-script/components/CompositionDialog/EncryptionMethodSelector.tsx @@ -1334,7 +1351,12 @@ msgstr "生成一个新的钱包地址" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "Generating your " +#~ msgid "Generating your " +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +msgid "Generating your **accounts**" msgstr "" #. placeholder {0}: contract?.symbol || '' @@ -1416,8 +1438,8 @@ msgid "I wrote down those words in the correct order" msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx -msgid "identity" -msgstr "身份" +#~ msgid "identity" +#~ msgstr "身份" #: dashboard/pages/SetupPersona/Mnemonic/ComponentToPrint.tsx msgid "Identity ID" @@ -2327,8 +2349,8 @@ msgstr "重新输入" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "ready 🚀" -msgstr "准备🚀" +#~ msgid "ready 🚀" +#~ msgstr "准备🚀" #: content-script/components/CompositionDialog/useSubmit.ts msgid "realMaskNetwork" @@ -3181,8 +3203,8 @@ msgid "Waiting for {providerType}" msgstr "" #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "wallet" -msgstr "钱包" +#~ msgid "wallet" +#~ msgstr "钱包" #: popups/pages/Wallet/SwitchWallet/index.tsx #: popups/modals/WalletGroupModal/index.tsx @@ -3275,8 +3297,8 @@ msgstr "" #~ msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx -msgid "You have recovered " -msgstr "" +#~ msgid "You have recovered " +#~ msgstr "" #: popups/pages/Personas/ConnectWallet/index.tsx msgid "You have signed with your wallet." @@ -3322,7 +3344,11 @@ msgstr "" #~ msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx -msgid "Your Persona is on " +#~ msgid "Your Persona is on " +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +msgid "Your Persona is on **ready 🚀**" msgstr "" #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx @@ -3330,5 +3356,9 @@ msgstr "" #~ msgstr "" #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "Your Wallet is on " +#~ msgid "Your Wallet is on " +#~ msgstr "" + +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +msgid "Your Wallet is on **ready 🚀**" msgstr "" diff --git a/packages/mask/shared-ui/locale/zh-TW.json b/packages/mask/shared-ui/locale/zh-TW.json index 003ab065cf78..e503d0544eb7 100644 --- a/packages/mask/shared-ui/locale/zh-TW.json +++ b/packages/mask/shared-ui/locale/zh-TW.json @@ -7,6 +7,16 @@ "y6VCOb": [["0"], " 分钟"], "MpnSqP": [["0"], " Pending"], "FKrzPv": [["count", "plural", { "one": ["#", " Wallet 🚀"], "other": ["#", " Wallets 🚀"] }]], + "5s6EhU": [ + [ + "count", + "plural", + { + "one": ["You have recovered **", "#", " Wallet 🚀**"], + "other": ["You have recovered **", "#", " Wallets 🚀**"] + } + ] + ], "yx3mb0": [ [ "decryptProgress", @@ -199,6 +209,8 @@ "PjBWOL": ["创建您的身份以开始"], "WgawP2": ["Creating your"], "cEnmTp": ["Creating your "], + "L82H5Z": ["Creating your **identity**"], + "F7U8uz": ["Creating your **wallet**"], "Q2lUR2": ["货币"], "OgPkDe": ["货币符号(可选)"], "oOQfsI": ["Current account is not the verifying account."], @@ -270,6 +282,7 @@ "w1ctdJ": ["Mask: 發表貼文"], "MRIXE3": ["Encrypting your"], "zutir1": ["Encrypting your "], + "XB3tfc": ["Encrypting your **data**"], "Cz6Lx7": ["加密方式"], "N/fqDa": ["Ens或地址(0x)"], "mPxxVq": ["輸入礦工費上限"], @@ -331,6 +344,7 @@ "fUn3xA": ["生成一个新的钱包地址"], "tdZPpe": ["Generating your"], "CiU2m/": ["Generating your "], + "RL5m+x": ["Generating your **accounts**"], "2p7WMm": ["Give permission to access <0/> your ", ["0"], "?"], "w9Xmw/": ["Google Drive"], "76gPWk": ["好的"], @@ -835,7 +849,9 @@ ], "N19nSk": ["Your Persona is on"], "WC7pDz": ["Your Persona is on "], + "PDW/HG": ["Your Persona is on **ready 🚀**"], "0kr+x1": ["Your Wallet is on"], - "v7OL2k": ["Your Wallet is on "] + "v7OL2k": ["Your Wallet is on "], + "wCtp6y": ["Your Wallet is on **ready 🚀**"] } } diff --git a/packages/mask/shared-ui/locale/zh-TW.po b/packages/mask/shared-ui/locale/zh-TW.po index f82d7473ddae..3afe4afa771c 100644 --- a/packages/mask/shared-ui/locale/zh-TW.po +++ b/packages/mask/shared-ui/locale/zh-TW.po @@ -46,7 +46,11 @@ msgid "{0} Pending" msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx -msgid "{count, plural, one {# Wallet 🚀} other {# Wallets 🚀}}" +#~ msgid "{count, plural, one {# Wallet 🚀} other {# Wallets 🚀}}" +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +msgid "{count, plural, one {You have recovered **# Wallet 🚀**} other {You have recovered **# Wallets 🚀**}}" msgstr "" #: content-script/components/InjectedComponents/DecryptedPost/DecryptPostAwaiting.tsx @@ -132,8 +136,8 @@ msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "accounts" -msgstr "" +#~ msgid "accounts" +#~ msgstr "" #: popups/pages/Wallet/components/WalletAssets/index.tsx msgid "Activities" @@ -823,7 +827,15 @@ msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "Creating your " +#~ msgid "Creating your " +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +msgid "Creating your **identity**" +msgstr "" + +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +msgid "Creating your **wallet**" msgstr "" #: popups/pages/Wallet/WalletSettings/ChangeCurrency.tsx @@ -864,8 +876,8 @@ msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "data" -msgstr "" +#~ msgid "data" +#~ msgstr "" #: popups/pages/Wallet/Interaction/TransactionRequest.tsx msgid "Data" @@ -1069,7 +1081,12 @@ msgstr "Mask: 發表貼文" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "Encrypting your " +#~ msgid "Encrypting your " +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +msgid "Encrypting your **data**" msgstr "" #: content-script/components/CompositionDialog/EncryptionMethodSelector.tsx @@ -1334,7 +1351,12 @@ msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "Generating your " +#~ msgid "Generating your " +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +msgid "Generating your **accounts**" msgstr "" #. placeholder {0}: contract?.symbol || '' @@ -1416,8 +1438,8 @@ msgid "I wrote down those words in the correct order" msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx -msgid "identity" -msgstr "" +#~ msgid "identity" +#~ msgstr "" #: dashboard/pages/SetupPersona/Mnemonic/ComponentToPrint.tsx msgid "Identity ID" @@ -2327,8 +2349,8 @@ msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "ready 🚀" -msgstr "" +#~ msgid "ready 🚀" +#~ msgstr "" #: content-script/components/CompositionDialog/useSubmit.ts msgid "realMaskNetwork" @@ -3181,8 +3203,8 @@ msgid "Waiting for {providerType}" msgstr "" #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "wallet" -msgstr "" +#~ msgid "wallet" +#~ msgstr "" #: popups/pages/Wallet/SwitchWallet/index.tsx #: popups/modals/WalletGroupModal/index.tsx @@ -3275,8 +3297,8 @@ msgstr "" #~ msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx -msgid "You have recovered " -msgstr "" +#~ msgid "You have recovered " +#~ msgstr "" #: popups/pages/Personas/ConnectWallet/index.tsx msgid "You have signed with your wallet." @@ -3322,7 +3344,11 @@ msgstr "" #~ msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx -msgid "Your Persona is on " +#~ msgid "Your Persona is on " +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +msgid "Your Persona is on **ready 🚀**" msgstr "" #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx @@ -3330,5 +3356,9 @@ msgstr "" #~ msgstr "" #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "Your Wallet is on " +#~ msgid "Your Wallet is on " +#~ msgstr "" + +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +msgid "Your Wallet is on **ready 🚀**" msgstr "" From 838ff38176122c52b5dcc5e685d7df44761dde49 Mon Sep 17 00:00:00 2001 From: Jack Works <5390719+Jack-Works@users.noreply.github.com> Date: Sat, 5 Apr 2025 13:57:43 +0800 Subject: [PATCH 05/20] docs(i18n): sync i18n files from Crowdin (#12182) * New translations en-us.po (Japanese) docs(i18n): sync translation en-us.po for Japanese * New translations en-us.po (Korean) docs(i18n): sync translation en-us.po for Korean * New translations en-us.po (Chinese Simplified) docs(i18n): sync translation en-us.po for Chinese Simplified * New translations en-us.po (Chinese Traditional) docs(i18n): sync translation en-us.po for Chinese Traditional * New translations en-us.po (Quenya) docs(i18n): sync translation en-us.po for Quenya * fix: run codegen --------- Co-authored-by: Jack-Works --- packages/mask/shared-ui/locale/ja-JP.json | 22 +- packages/mask/shared-ui/locale/ja-JP.po | 24 +- packages/mask/shared-ui/locale/ko-KR.json | 20 +- packages/mask/shared-ui/locale/ko-KR.po | 22 +- packages/mask/shared-ui/locale/qya-AA.po | 873 +++++++++++++++------- packages/mask/shared-ui/locale/zh-CN.json | 22 +- packages/mask/shared-ui/locale/zh-CN.po | 24 +- packages/mask/shared-ui/locale/zh-TW.json | 22 +- packages/mask/shared-ui/locale/zh-TW.po | 2 +- 9 files changed, 667 insertions(+), 364 deletions(-) diff --git a/packages/mask/shared-ui/locale/ja-JP.json b/packages/mask/shared-ui/locale/ja-JP.json index 6597cb1d66b7..421f435f1bf0 100644 --- a/packages/mask/shared-ui/locale/ja-JP.json +++ b/packages/mask/shared-ui/locale/ja-JP.json @@ -64,7 +64,7 @@ "pv5v6j": ["About Permit"], "k0USDt": ["Account connected.<0/><1/>Try to explore more features powered by Mask Network."], "R2K7XH": ["ソーシャルメディアで Web3 dApps の機能を探索してみてください。"], - "6c6xyD": ["アカウント"], + "6c6xyD": ["accounts"], "39ohdf": ["アクティビティ"], "I5kL4f": ["行動記録"], "m16xKo": ["追加"], @@ -116,7 +116,7 @@ "V+1pjj": ["Back Up Your Data Your Way"], "rLgPvm": ["バックアップ"], "h7+V7K": ["バックアップと復元"], - "QrHM/A": ["バックアップがダウンロードされ、ローカルに正常に統合されました。"], + "QrHM/A": ["Backup downloaded and merged to local successfully."], "zp7Ha3": ["バックアップ失敗"], "5Cowlg": ["Backup is saved to Mask Cloud Service."], "qZ6p7p": ["Backup on ", ["0"]], @@ -126,7 +126,7 @@ "hUF4dG": ["バックアップパスワードの設定が完了しました"], "UtKGok": ["ペルソナをバックアップする"], "+m7x4e": ["Backup Successful"], - "7Ry254": ["マスククラウドサービスにバックアップ"], + "7Ry254": ["Backup to Mask Cloud Service"], "6IHgRq": ["Backup to the Cloud"], "QQPCqQ": ["ウォレットをバックアップする"], "fsBGk0": ["残高"], @@ -227,7 +227,7 @@ ], "8Tg/JR": ["カスタム"], "pvnfJD": ["ダーク"], - "Sp/me1": ["データ"], + "Sp/me1": ["data"], "HKH+W+": ["データ"], "K8jCIB": ["Data backed up successfully!"], "3B4jmY": ["データの相関値"], @@ -267,7 +267,7 @@ "XZ/B+f": ["NFTが見つかりませんか?"], "DPfwMq": ["完了!"], "mzI/c+": ["ダウンロード"], - "1vSYsG": ["バックアップをダウンロード"], + "1vSYsG": ["Download backup"], "1+6BOG": ["バックアップのダウンロード"], "9hg9mc": ["ダウンロード中"], "F8Wc3I": ["ここにファイルをドラッグ&ドロップしてください"], @@ -367,7 +367,7 @@ "yx/fMc": ["高い"], "0caMy7": ["History"], "uip9JY": ["I wrote down those words in the correct order"], - "b5d759": ["アイデンティティ"], + "b5d759": ["identity"], "RRw7LE": ["アイデンティティ ID"], "/WfDJy": [ "If you forget payment password, you can type 'RESET' to reset your wallet. <0>Remember, this action will erase all your previous wallets." @@ -455,7 +455,7 @@ "lPsa94": ["Merge Completed"], "RH8jSA": ["ローカルデータベースにデータを統合"], "E6YUtc": ["Merge to Browser"], - "QTomF0": ["ローカルに統合"], + "QTomF0": ["Merge to local"], "xDAtGP": ["メッセージ"], "pGElS5": ["ニーモニック"], "yFrxQj": ["ニーモニック単語"], @@ -581,7 +581,7 @@ "3AP6p1": ["Public Key: <0>", ["publicKey"], ""], "82+n6o": ["Quote Route"], "AV+9wg": ["再入力"], - "TZ0npN": ["準備完了🚀"], + "TZ0npN": ["ready 🚀"], "nVT2pJ": ["realMaskNetwork"], "lDgVWA": ["受取"], "OkofjH": ["Recover"], @@ -645,7 +645,7 @@ "iJLEZF": ["方法を確認"], "nOCyT5": ["$1未満のトークンを表示"], "c+Fnce": ["サイン"], - "mErq7F": ["新規登録"], + "mErq7F": ["Sign Up"], "t3rUZr": ["サインインリクエスト"], "py6hU8": ["署名リクエスト"], "9KKhJV": ["署名中..."], @@ -815,7 +815,7 @@ "vVEene": ["View your Tokens and NFTs"], "kbfp5m": ["表示対象:"], "PTXNyo": ["Waiting for ", ["providerType"]], - "6XyieG": ["ウォレット"], + "6XyieG": ["wallet"], "VECuJk": ["ウォレットアカウント"], "KtMMzG": ["Wallet disconnected"], "Kl9gHp": ["ウォレットグループ", ["0"]], @@ -830,7 +830,7 @@ "EGWr+Q": ["Web3 プロフィールカード"], "On0aF2": ["ウェブサイト"], "CWsYB3": ["おかえりなさい"], - "m74yjp": ["マスククラウドサービスへようこそ"], + "m74yjp": ["Welcome to Mask Cloud Services"], "hEpXzO": ["Mask Networkへようこそ"], "fFYJ8f": ["Mask Networkへようこそ"], "OLUEnY": ["when you click Add Google Drive button,you will be forwarded to Google authorization pages."], diff --git a/packages/mask/shared-ui/locale/ja-JP.po b/packages/mask/shared-ui/locale/ja-JP.po index 8cf0b7c371bf..8e8953fef474 100644 --- a/packages/mask/shared-ui/locale/ja-JP.po +++ b/packages/mask/shared-ui/locale/ja-JP.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: mask-network\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2025-01-08 06:53\n" +"PO-Revision-Date: 2025-04-03 11:04\n" "Last-Translator: \n" "Language: ja_JP\n" "Language-Team: Japanese\n" @@ -137,7 +137,7 @@ msgstr "ソーシャルメディアで Web3 dApps の機能を探索してみて #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx #~ msgid "accounts" -#~ msgstr "アカウント" +#~ msgstr "" #: popups/pages/Wallet/components/WalletAssets/index.tsx msgid "Activities" @@ -347,7 +347,7 @@ msgstr "バックアップと復元" #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #~ msgid "Backup downloaded and merged to local successfully." -#~ msgstr "バックアップがダウンロードされ、ローカルに正常に統合されました。" +#~ msgstr "" #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx msgid "Backup Failed" @@ -400,7 +400,7 @@ msgstr "" #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #~ msgid "Backup to Mask Cloud Service" -#~ msgstr "マスククラウドサービスにバックアップ" +#~ msgstr "" #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx msgid "Backup to the Cloud" @@ -877,7 +877,7 @@ msgstr "ダーク" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx #~ msgid "data" -#~ msgstr "データ" +#~ msgstr "" #: popups/pages/Wallet/Interaction/TransactionRequest.tsx msgid "Data" @@ -1008,7 +1008,7 @@ msgstr "ダウンロード" #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #~ msgid "Download backup" -#~ msgstr "バックアップをダウンロード" +#~ msgstr "" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx @@ -1439,7 +1439,7 @@ msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #~ msgid "identity" -#~ msgstr "アイデンティティ" +#~ msgstr "" #: dashboard/pages/SetupPersona/Mnemonic/ComponentToPrint.tsx msgid "Identity ID" @@ -1831,7 +1831,7 @@ msgstr "" #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #~ msgid "Merge to local" -#~ msgstr "ローカルに統合" +#~ msgstr "" #: popups/components/SignRequestInfo/index.tsx msgid "Message" @@ -2350,7 +2350,7 @@ msgstr "再入力" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx #~ msgid "ready 🚀" -#~ msgstr "準備完了🚀" +#~ msgstr "" #: content-script/components/CompositionDialog/useSubmit.ts msgid "realMaskNetwork" @@ -2640,7 +2640,7 @@ msgstr "サイン" #: dashboard/pages/SetupPersona/Recovery/index.tsx #~ msgid "Sign Up" -#~ msgstr "新規登録" +#~ msgstr "" #: popups/components/SignRequestInfo/index.tsx msgid "Sign-in Request" @@ -3204,7 +3204,7 @@ msgstr "" #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx #~ msgid "wallet" -#~ msgstr "ウォレット" +#~ msgstr "" #: popups/pages/Wallet/SwitchWallet/index.tsx #: popups/modals/WalletGroupModal/index.tsx @@ -3262,7 +3262,7 @@ msgstr "おかえりなさい" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #~ msgid "Welcome to Mask Cloud Services" -#~ msgstr "マスククラウドサービスへようこそ" +#~ msgstr "" #: popups/pages/Personas/Home/UI.tsx msgid "Welcome to Mask Network" diff --git a/packages/mask/shared-ui/locale/ko-KR.json b/packages/mask/shared-ui/locale/ko-KR.json index 0b9875b3643b..ec4b75b273c1 100644 --- a/packages/mask/shared-ui/locale/ko-KR.json +++ b/packages/mask/shared-ui/locale/ko-KR.json @@ -64,7 +64,7 @@ "pv5v6j": ["About Permit"], "k0USDt": ["Account connected.<0/><1/>Try to explore more features powered by Mask Network."], "R2K7XH": ["소결 미디어에서 웹3 앱을 탐색해 보세요."], - "6c6xyD": ["계정"], + "6c6xyD": ["accounts"], "39ohdf": ["활동"], "I5kL4f": ["Activity Log"], "m16xKo": ["추가"], @@ -116,7 +116,7 @@ "V+1pjj": ["Back Up Your Data Your Way"], "rLgPvm": ["백업"], "h7+V7K": ["백업 맟 복구"], - "QrHM/A": ["백업을 다운로드하여 로컬로 병합했습니다."], + "QrHM/A": ["Backup downloaded and merged to local successfully."], "zp7Ha3": ["백업 실패"], "5Cowlg": ["Backup is saved to Mask Cloud Service."], "qZ6p7p": ["백업 시간 ", ["0"]], @@ -126,7 +126,7 @@ "hUF4dG": ["백업 비밀번호가 설정되었습니다."], "UtKGok": ["페르소나 백업"], "+m7x4e": ["Backup Successful"], - "7Ry254": ["Mask Cloud Service 백업"], + "7Ry254": ["Backup to Mask Cloud Service"], "6IHgRq": ["Backup to the Cloud"], "QQPCqQ": ["지갑 백업"], "fsBGk0": ["잔액"], @@ -227,7 +227,7 @@ ], "8Tg/JR": ["커스텀"], "pvnfJD": ["다크"], - "Sp/me1": ["데이터"], + "Sp/me1": ["data"], "HKH+W+": ["데이터"], "K8jCIB": ["Data backed up successfully!"], "3B4jmY": ["데이터 수정"], @@ -267,7 +267,7 @@ "XZ/B+f": ["NFT를 보셨나요?"], "DPfwMq": ["완료"], "mzI/c+": ["다운로드"], - "1vSYsG": ["백업 다운로드"], + "1vSYsG": ["Download backup"], "1+6BOG": ["백업 다운로드"], "9hg9mc": ["다운로드 중"], "F8Wc3I": ["파일을 끌어서 여기에 놓으세요"], @@ -367,7 +367,7 @@ "yx/fMc": ["높음"], "0caMy7": ["History"], "uip9JY": ["I wrote down those words in the correct order"], - "b5d759": ["아이덴티티"], + "b5d759": ["identity"], "RRw7LE": ["아이디"], "/WfDJy": [ "If you forget payment password, you can type 'RESET' to reset your wallet. <0>Remember, this action will erase all your previous wallets." @@ -455,7 +455,7 @@ "lPsa94": ["Merge Completed"], "RH8jSA": ["데이터를 로컬 데이터베이스에 병합하기"], "E6YUtc": ["Merge to Browser"], - "QTomF0": ["로컬로 합병하기"], + "QTomF0": ["Merge to local"], "xDAtGP": ["메시지"], "pGElS5": ["니모닉"], "yFrxQj": ["니모닉 단어"], @@ -581,7 +581,7 @@ "3AP6p1": ["Public Key: <0>", ["publicKey"], ""], "82+n6o": ["Quote Route"], "AV+9wg": ["다시 입력"], - "TZ0npN": ["준비 🚀"], + "TZ0npN": ["ready 🚀"], "nVT2pJ": ["realMaskNetwork"], "lDgVWA": ["받기"], "OkofjH": ["Recover"], @@ -645,7 +645,7 @@ "iJLEZF": ["방법을 알려주세요."], "nOCyT5": ["잔액 $1 미만인 토큰 표시"], "c+Fnce": ["사인"], - "mErq7F": ["가입하기"], + "mErq7F": ["Sign Up"], "t3rUZr": ["Sign-in Request"], "py6hU8": ["시그너쳐 요청"], "9KKhJV": ["진행중..."], @@ -811,7 +811,7 @@ "vVEene": ["View your Tokens and NFTs"], "kbfp5m": ["공개 대상"], "PTXNyo": ["Waiting for ", ["providerType"]], - "6XyieG": ["월렛"], + "6XyieG": ["wallet"], "VECuJk": ["월렛 계정"], "KtMMzG": ["Wallet disconnected"], "Kl9gHp": ["월렛 그룹 #", ["0"]], diff --git a/packages/mask/shared-ui/locale/ko-KR.po b/packages/mask/shared-ui/locale/ko-KR.po index 9afd59f5830f..7a1e13e5d1e6 100644 --- a/packages/mask/shared-ui/locale/ko-KR.po +++ b/packages/mask/shared-ui/locale/ko-KR.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: mask-network\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2025-01-08 06:53\n" +"PO-Revision-Date: 2025-04-03 11:04\n" "Last-Translator: \n" "Language: ko_KR\n" "Language-Team: Korean\n" @@ -137,7 +137,7 @@ msgstr "소결 미디어에서 웹3 앱을 탐색해 보세요." #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx #~ msgid "accounts" -#~ msgstr "계정" +#~ msgstr "" #: popups/pages/Wallet/components/WalletAssets/index.tsx msgid "Activities" @@ -347,7 +347,7 @@ msgstr "백업 맟 복구" #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #~ msgid "Backup downloaded and merged to local successfully." -#~ msgstr "백업을 다운로드하여 로컬로 병합했습니다." +#~ msgstr "" #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx msgid "Backup Failed" @@ -400,7 +400,7 @@ msgstr "" #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #~ msgid "Backup to Mask Cloud Service" -#~ msgstr "Mask Cloud Service 백업" +#~ msgstr "" #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx msgid "Backup to the Cloud" @@ -877,7 +877,7 @@ msgstr "다크" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx #~ msgid "data" -#~ msgstr "데이터" +#~ msgstr "" #: popups/pages/Wallet/Interaction/TransactionRequest.tsx msgid "Data" @@ -1008,7 +1008,7 @@ msgstr "다운로드" #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #~ msgid "Download backup" -#~ msgstr "백업 다운로드" +#~ msgstr "" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx @@ -1439,7 +1439,7 @@ msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #~ msgid "identity" -#~ msgstr "아이덴티티" +#~ msgstr "" #: dashboard/pages/SetupPersona/Mnemonic/ComponentToPrint.tsx msgid "Identity ID" @@ -1831,7 +1831,7 @@ msgstr "" #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #~ msgid "Merge to local" -#~ msgstr "로컬로 합병하기" +#~ msgstr "" #: popups/components/SignRequestInfo/index.tsx msgid "Message" @@ -2350,7 +2350,7 @@ msgstr "다시 입력" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx #~ msgid "ready 🚀" -#~ msgstr "준비 🚀" +#~ msgstr "" #: content-script/components/CompositionDialog/useSubmit.ts msgid "realMaskNetwork" @@ -2640,7 +2640,7 @@ msgstr "사인" #: dashboard/pages/SetupPersona/Recovery/index.tsx #~ msgid "Sign Up" -#~ msgstr "가입하기" +#~ msgstr "" #: popups/components/SignRequestInfo/index.tsx msgid "Sign-in Request" @@ -3204,7 +3204,7 @@ msgstr "" #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx #~ msgid "wallet" -#~ msgstr "월렛" +#~ msgstr "" #: popups/pages/Wallet/SwitchWallet/index.tsx #: popups/modals/WalletGroupModal/index.tsx diff --git a/packages/mask/shared-ui/locale/qya-AA.po b/packages/mask/shared-ui/locale/qya-AA.po index bf1bb6be2c2a..d144c939d3fe 100644 --- a/packages/mask/shared-ui/locale/qya-AA.po +++ b/packages/mask/shared-ui/locale/qya-AA.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: mask-network\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2025-01-08 06:53\n" +"PO-Revision-Date: 2025-04-03 11:04\n" "Last-Translator: \n" "Language: qya_AA\n" "Language-Team: Quenya\n" @@ -20,29 +20,38 @@ msgstr "" msgid "(the name is set by the web site)" msgstr "crwdns29840:0crwdne29840:0" +#. placeholder {0}: millisecondsToHours(value) #: popups/pages/Wallet/WalletSettings/AutoLock.tsx msgid "{0, plural, one {# Hour} other {# Hours}}" msgstr "crwdns32756:00={0}crwdne32756:0" +#. placeholder {0}: formatTokenBalance(tokenBalance, token?.decimals) #: popups/pages/Wallet/Transfer/FungibleTokenSection.tsx msgid "{0} available" msgstr "crwdns29842:0{0}crwdne29842:0" +#. placeholder {0}: wallet?.name || 'Your wallet' #: popups/pages/Wallet/ConnectedSites/index.tsx msgid "{0} is connected to these sites, they can view your account address." msgstr "crwdns35868:0{0}crwdne35868:0" +#. placeholder {0}: millisecondsToMinutes(value) #: popups/pages/Wallet/WalletSettings/AutoLock.tsx msgid "{0} Mins" msgstr "crwdns29844:0{0}crwdne29844:0" +#. placeholder {0}: pendingTransactions.length #: content-script/components/InjectedComponents/ToolboxUnstyled.tsx msgid "{0} Pending" msgstr "crwdns32758:0{0}crwdne32758:0" #: dashboard/pages/SetupPersona/Onboarding/index.tsx -msgid "{count, plural, one {# Wallet 🚀} other {# Wallets 🚀}}" -msgstr "crwdns32760:0count={count}crwdne32760:0" +#~ msgid "{count, plural, one {# Wallet 🚀} other {# Wallets 🚀}}" +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +msgid "{count, plural, one {You have recovered **# Wallet 🚀**} other {You have recovered **# Wallets 🚀**}}" +msgstr "crwdns37278:0count={count}crwdne37278:0" #: content-script/components/InjectedComponents/DecryptedPost/DecryptPostAwaiting.tsx msgid "{decryptProgress, select, finding_post_key {Mask is finding the key to decrypt this message. If this last for a long time, this post might not be shared to you.} finding_person_public_key {Mask is looking for the public key of the author...} other {Mask is decrypting...}}" @@ -64,10 +73,15 @@ msgstr "crwdns32766:0websiteCount={websiteCount}crwdnd32766:0websiteCount={websi msgid "<0>@{currentUserId} connected already." msgstr "crwdns32768:0{currentUserId}crwdne32768:0" +#. placeholder {0}: formatEthereumAddress(transaction.formattedTransaction.popup.spender, 4) #: popups/pages/Wallet/Interaction/TransactionRequest.tsx msgid "<0>Granted to <1>{0}" msgstr "crwdns31978:0{0}crwdne31978:0" +#: popups/pages/Wallet/WalletSettings/DisablePermit.tsx +msgid "<0>Permit allows users to authorize an address to access their ERC-20 tokens without requiring a separate approval transaction, providing a more efficient way to manage token permissions.<1>However, if the authorized limit is exceeded or the Permit expires, the authorization automatically becomes invalid. Despite this, security risks remain.<2>To prevent potential misuse, you can disable the Permit feature." +msgstr "crwdns36714:0crwdne36714:0" + #: content-script/components/InjectedComponents/ProfileTabContent.tsx msgid "<0>Powered by<1>Mask Network" msgstr "crwdns31980:0crwdne31980:0" @@ -108,6 +122,10 @@ msgstr "crwdns29850:0crwdne29850:0" msgid "About {collectionName}" msgstr "crwdns31984:0{collectionName}crwdne31984:0" +#: popups/pages/Wallet/WalletSettings/DisablePermit.tsx +msgid "About Permit" +msgstr "crwdns36716:0crwdne36716:0" + #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx msgid "Account connected.<0/><1/>Try to explore more features powered by Mask Network." msgstr "crwdns31986:0crwdne31986:0" @@ -116,10 +134,10 @@ msgstr "crwdns31986:0crwdne31986:0" msgid "Account successfully connected to persona" msgstr "crwdns29854:0crwdne29854:0" -#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx #: dashboard/pages/SetupPersona/Onboarding/index.tsx -msgid "accounts" -msgstr "crwdns29528:0crwdne29528:0" +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +#~ msgid "accounts" +#~ msgstr "" #: popups/pages/Wallet/components/WalletAssets/index.tsx msgid "Activities" @@ -129,9 +147,9 @@ msgstr "crwdns29856:0crwdne29856:0" msgid "Activity Log" msgstr "crwdns29858:0crwdne29858:0" -#: popups/modals/SwitchPersonaModal/index.tsx -#: popups/pages/Friends/ContactCard/index.tsx #: popups/pages/Wallet/CreateWallet/Derive.tsx +#: popups/pages/Friends/ContactCard/index.tsx +#: popups/modals/SwitchPersonaModal/index.tsx msgid "Add" msgstr "crwdns29860:0crwdne29860:0" @@ -143,13 +161,17 @@ msgstr "crwdns31988:0crwdne31988:0" msgid "Add Assets" msgstr "crwdns29864:0crwdne29864:0" -#: popups/components/AddContactInputPanel/index.tsx #: popups/pages/Wallet/ContactList/index.tsx +#: popups/components/AddContactInputPanel/index.tsx msgid "Add Contact" msgstr "crwdns29866:0crwdne29866:0" -#: popups/pages/Wallet/EditNetwork/index.tsx +#: dashboard/components/GoogleDriveLogin.tsx +msgid "Add google Drive" +msgstr "crwdns37222:0crwdne37222:0" + #: popups/pages/Wallet/NetworkManagement/index.tsx +#: popups/pages/Wallet/EditNetwork/index.tsx msgid "Add Network" msgstr "crwdns29870:0crwdne29870:0" @@ -161,15 +183,19 @@ msgstr "crwdns29872:0crwdne29872:0" msgid "Add Suggested Token" msgstr "crwdns29874:0crwdne29874:0" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Add the file to Chrome's database" +msgstr "crwdns37262:0crwdne37262:0" + #: popups/pages/Wallet/components/StartUp/index.tsx -#: popups/pages/Wallet/CreateWallet/Derive.tsx -#: popups/pages/Wallet/CreateWallet/index.tsx #: popups/pages/Wallet/SwitchWallet/index.tsx +#: popups/pages/Wallet/CreateWallet/index.tsx +#: popups/pages/Wallet/CreateWallet/Derive.tsx msgid "Add Wallet" msgstr "crwdns29876:0crwdne29876:0" -#: popups/components/TokenPicker/TokenItem.tsx #: popups/pages/Wallet/components/AssetsList/index.tsx +#: popups/components/TokenPicker/TokenItem.tsx msgid "Added by user" msgstr "crwdns29878:0crwdne29878:0" @@ -197,8 +223,8 @@ msgstr "crwdns29886:0crwdne29886:0" msgid "After logging out, your associated social accounts will no longer decrypt old encrypted messages. If you need to use your account again, you can recover your account with your identity, private key, local or cloud backup." msgstr "crwdns31992:0crwdne31992:0" -#: dashboard/pages/SetupPersona/Permissions/index.tsx #: dashboard/pages/SetupPersona/Welcome/index.tsx +#: dashboard/pages/SetupPersona/Permissions/index.tsx msgid "Agree" msgstr "crwdns29532:0crwdne29532:0" @@ -219,8 +245,8 @@ msgstr "crwdns29894:0crwdne29894:0" msgid "Allow us to collect your usage information to help us improve Mask." msgstr "crwdns31996:0crwdne31996:0" -#: popups/pages/Wallet/TransactionDetail/index.tsx #: popups/pages/Wallet/Transfer/FungibleTokenSection.tsx +#: popups/pages/Wallet/TransactionDetail/index.tsx msgid "Amount" msgstr "crwdns29896:0crwdne29896:0" @@ -228,14 +254,14 @@ msgstr "crwdns29896:0crwdne29896:0" msgid "an NFT" msgstr "crwdns29898:0crwdne29898:0" -#: popups/modals/SelectAppearanceModal/index.tsx #: popups/pages/Settings/index.tsx +#: popups/modals/SelectAppearanceModal/index.tsx msgid "Appearance" msgstr "crwdns29900:0crwdne29900:0" #: content-script/components/InjectedComponents/DisabledPluginSuggestion.tsx -#: popups/modals/UpdatePermissionModal/index.tsx #: popups/pages/RequestPermission/RequestPermission.tsx +#: popups/modals/UpdatePermissionModal/index.tsx msgid "Approve" msgstr "crwdns29902:0crwdne29902:0" @@ -247,6 +273,7 @@ msgstr "crwdns29904:0crwdne29904:0" msgid "Are you sure to overwrite the backups stored on Mask Cloud Service?" msgstr "crwdns31998:0crwdne31998:0" +#. placeholder {0}: formatEthereumAddress(wallet.identity, 4) #: popups/components/ConnectedWallet/index.tsx msgid "Are you sure to remove the connected wallet <0>{0}?" msgstr "crwdns32774:0{0}crwdne32774:0" @@ -272,8 +299,8 @@ msgid "Associated Accounts" msgstr "crwdns29536:0crwdne29536:0" #: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx -#: popups/modals/ChangePaymentPasswordModal/index.tsx #: popups/pages/Wallet/SetPaymentPassword/index.tsx +#: popups/modals/ChangePaymentPasswordModal/index.tsx msgid "At least 6 characters" msgstr "crwdns29538:0crwdne29538:0" @@ -290,15 +317,27 @@ msgid "Avatar set successfully" msgstr "crwdns29920:0crwdne29920:0" #: content-script/components/shared/SelectRecipients/SelectRecipientsDialog.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx #: dashboard/pages/CreateMaskWallet/CreateMnemonic/index.tsx -#: popups/pages/Personas/AccountDetail/UI.tsx #: popups/pages/Personas/ExportPrivateKey/index.tsx +#: popups/pages/Personas/AccountDetail/UI.tsx msgid "Back" msgstr "crwdns29540:0crwdne29540:0" +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx +msgid "Back Up to Google Drive" +msgstr "crwdns37224:0crwdne37224:0" + #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -#: popups/modals/SwitchPersonaModal/index.tsx +#: dashboard/pages/SetupPersona/Backup/index.tsx +msgid "Back Up Your Data Your Way" +msgstr "crwdns37226:0crwdne37226:0" + +#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Personas/Logout/index.tsx +#: popups/modals/SwitchPersonaModal/index.tsx msgid "Backup" msgstr "crwdns29542:0crwdne29542:0" @@ -307,53 +346,61 @@ msgid "Backup & Recovery" msgstr "crwdns29922:0crwdne29922:0" #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Backup downloaded and merged to local successfully." -msgstr "crwdns29546:0crwdne29546:0" +#~ msgid "Backup downloaded and merged to local successfully." +#~ msgstr "" #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx msgid "Backup Failed" msgstr "crwdns29548:0crwdne29548:0" #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx -msgid "Backup is saved to Mask Cloud Service." -msgstr "crwdns32004:0crwdne32004:0" +#~ msgid "Backup is saved to Mask Cloud Service." +#~ msgstr "" +#. placeholder {0}: user.localBackupAt +#. placeholder {0}: user.cloudBackupAt #: popups/pages/Settings/index.tsx #: popups/pages/Settings/index.tsx msgid "Backup on {0}" msgstr "crwdns29924:0{0}crwdne29924:0" -#: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx msgid "Backup password" msgstr "crwdns29550:0crwdne29550:0" -#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -#: popups/modals/SetBackupPasswordModal/index.tsx +#: dashboard/pages/SetupPersona/Backup/Local.tsx +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Settings/index.tsx +#: popups/modals/SetBackupPasswordModal/index.tsx msgid "Backup Password" msgstr "crwdns29552:0crwdne29552:0" -#: popups/modals/ChangeBackupPasswordModal/index.tsx #: popups/modals/SetBackupPasswordModal/index.tsx +#: popups/modals/ChangeBackupPasswordModal/index.tsx msgid "Backup password must be 8-20 characters, including uppercase, lowercase, special characters and numbers." msgstr "crwdns29926:0crwdne29926:0" -#: popups/modals/ChangeBackupPasswordModal/index.tsx #: popups/modals/SetBackupPasswordModal/index.tsx +#: popups/modals/ChangeBackupPasswordModal/index.tsx msgid "Backup password set successfully" msgstr "crwdns29928:0crwdne29928:0" -#: popups/modals/PersonaSettingModal/index.tsx #: popups/modals/VerifyBackupPasswordModal/index.tsx +#: popups/modals/PersonaSettingModal/index.tsx msgid "Backup Persona" msgstr "crwdns29930:0crwdne29930:0" +#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx +msgid "Backup Successful" +msgstr "crwdns37228:0crwdne37228:0" + #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Backup to Mask Cloud Service" -msgstr "crwdns29556:0crwdne29556:0" +#~ msgid "Backup to Mask Cloud Service" +#~ msgstr "" #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx msgid "Backup to the Cloud" @@ -396,8 +443,8 @@ msgstr "crwdns32008:0crwdne32008:0" msgid "Browser File" msgstr "crwdns29948:0crwdne29948:0" -#: dashboard/pages/SetupPersona/Permissions/index.tsx #: dashboard/pages/SetupPersona/Welcome/index.tsx +#: dashboard/pages/SetupPersona/Permissions/index.tsx msgid "By continuing to the app, you agree to these <0>Service Agreement and <1>Privacy Policy." msgstr "crwdns32776:0crwdne32776:0" @@ -418,30 +465,30 @@ msgid "Can't find a valid user address data source." msgstr "crwdns32010:0crwdne32010:0" #: content-script/components/InjectedComponents/SelectPeopleDialog.tsx -#: dashboard/components/Restore/ConfirmSynchronizePasswordDialog.tsx -#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx -#: dashboard/modals/ConfirmModal/index.tsx -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -#: dashboard/pages/SetupPersona/Permissions/index.tsx #: dashboard/pages/SetupPersona/Welcome/index.tsx -#: popups/modals/AddContactModal/index.tsx -#: popups/modals/DeleteContactModal/index.tsx -#: popups/modals/EditContactModal/index.tsx -#: popups/modals/GasSettingModal/index.tsx -#: popups/pages/Personas/ConnectWallet/index.tsx -#: popups/pages/Personas/Logout/index.tsx -#: popups/pages/Personas/PersonaAvatarSetting/index.tsx -#: popups/pages/Personas/PersonaSignRequest/index.tsx -#: popups/pages/RequestPermission/RequestPermission.tsx -#: popups/pages/Wallet/ChangeOwner/index.tsx -#: popups/pages/Wallet/components/ActivityList/ActivityItem.tsx +#: dashboard/pages/SetupPersona/Permissions/index.tsx +#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/modals/ConfirmModal/index.tsx +#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx +#: dashboard/components/Restore/ConfirmSynchronizePasswordDialog.tsx #: popups/pages/Wallet/components/DisconnectModal/index.tsx -#: popups/pages/Wallet/EditNetwork/index.tsx -#: popups/pages/Wallet/Interaction/interaction.tsx -#: popups/pages/Wallet/ResetWallet/index.tsx -#: popups/pages/Wallet/SelectWallet/index.tsx -#: popups/pages/Wallet/TransactionDetail/index.tsx +#: popups/pages/Wallet/components/ActivityList/ActivityItem.tsx #: popups/pages/Wallet/Transfer/FungibleTokenSection.tsx +#: popups/pages/Wallet/TransactionDetail/index.tsx +#: popups/pages/Wallet/SelectWallet/index.tsx +#: popups/pages/Wallet/ResetWallet/index.tsx +#: popups/pages/Wallet/Interaction/interaction.tsx +#: popups/pages/Wallet/EditNetwork/index.tsx +#: popups/pages/Wallet/ChangeOwner/index.tsx +#: popups/pages/RequestPermission/RequestPermission.tsx +#: popups/pages/Personas/PersonaSignRequest/index.tsx +#: popups/pages/Personas/PersonaAvatarSetting/index.tsx +#: popups/pages/Personas/Logout/index.tsx +#: popups/pages/Personas/ConnectWallet/index.tsx +#: popups/modals/GasSettingModal/index.tsx +#: popups/modals/EditContactModal/index.tsx +#: popups/modals/DeleteContactModal/index.tsx +#: popups/modals/AddContactModal/index.tsx msgid "Cancel" msgstr "crwdns29558:0crwdne29558:0" @@ -449,18 +496,20 @@ msgstr "crwdns29558:0crwdne29558:0" msgid "Cannot switch to a unknown network." msgstr "crwdns29956:0crwdne29956:0" -#: popups/components/SignRequestInfo/index.tsx #: popups/pages/Wallet/EditNetwork/index.tsx +#: popups/components/SignRequestInfo/index.tsx msgid "Chain ID" msgstr "crwdns29958:0crwdne29958:0" +#. placeholder {0}: currentNetwork?.chainId ?? currentChainId +#. placeholder {0}: nextNetwork?.chainId ?? nextChainId #: popups/pages/Wallet/Interaction/SwitchChainRequest.tsx #: popups/pages/Wallet/Interaction/SwitchChainRequest.tsx msgid "Chain ID: {0}" msgstr "crwdns32012:0{0}crwdne32012:0" -#: popups/pages/Personas/ConnectWallet/index.tsx #: popups/pages/Wallet/ChangeOwner/index.tsx +#: popups/pages/Personas/ConnectWallet/index.tsx msgid "Change" msgstr "crwdns29960:0crwdne29960:0" @@ -468,8 +517,8 @@ msgstr "crwdns29960:0crwdne29960:0" msgid "Change another account and try again." msgstr "crwdns32014:0crwdne32014:0" -#: popups/modals/ChangeBackupPasswordModal/index.tsx #: popups/pages/Settings/index.tsx +#: popups/modals/ChangeBackupPasswordModal/index.tsx msgid "Change Backup Password" msgstr "crwdns29962:0crwdne29962:0" @@ -477,8 +526,8 @@ msgstr "crwdns29962:0crwdne29962:0" msgid "Change Network" msgstr "crwdns29964:0crwdne29964:0" -#: popups/pages/Wallet/ChangeOwner/index.tsx #: popups/pages/Wallet/WalletSettings/ChangeOwner.tsx +#: popups/pages/Wallet/ChangeOwner/index.tsx msgid "Change Owner" msgstr "crwdns29966:0crwdne29966:0" @@ -491,6 +540,11 @@ msgstr "crwdns29968:0crwdne29968:0" msgid "Choose another wallet" msgstr "crwdns29972:0crwdne29972:0" +#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/index.tsx +msgid "Choose from multiple backup options, now including encrypted storage via your authorized Google Drive for added security and flexibility." +msgstr "crwdns37230:0crwdne37230:0" + #: popups/modals/ChooseToken/index.tsx msgid "Choose Token" msgstr "crwdns29974:0crwdne29974:0" @@ -515,8 +569,9 @@ msgstr "crwdns32018:0crwdne32018:0" msgid "Close" msgstr "crwdns29982:0crwdne29982:0" -#: dashboard/components/Restore/ConfirmSynchronizePasswordDialog.tsx #: dashboard/pages/SetupPersona/Recovery/index.tsx +#: dashboard/pages/SetupPersona/Backup/index.tsx +#: dashboard/components/Restore/ConfirmSynchronizePasswordDialog.tsx #: popups/pages/Settings/index.tsx msgid "Cloud Backup" msgstr "crwdns29560:0crwdne29560:0" @@ -529,36 +584,36 @@ msgstr "crwdns29984:0crwdne29984:0" msgid "Coming soon" msgstr "crwdns29986:0crwdne29986:0" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx #: dashboard/components/Restore/RestoreWalletFromLocal.tsx msgid "Completed" msgstr "crwdns29562:0crwdne29562:0" -#: dashboard/components/Restore/ConfirmSynchronizePasswordDialog.tsx -#: dashboard/modals/ConfirmModal/index.tsx #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -#: popups/components/NFTAvatarPicker/index.tsx -#: popups/modals/AddContactModal/index.tsx -#: popups/modals/ChangeBackupPasswordModal/index.tsx -#: popups/modals/ChangePaymentPasswordModal/index.tsx -#: popups/modals/ConfirmModal/index.tsx -#: popups/modals/EditContactModal/index.tsx -#: popups/modals/GasSettingModal/GasSettingDialog.tsx -#: popups/modals/PersonaRenameModal/index.tsx -#: popups/modals/SetBackupPasswordModal/index.tsx -#: popups/modals/ShowPrivateKeyModal/index.tsx -#: popups/modals/WalletAutoLockSettingModal/index.tsx -#: popups/modals/WalletRenameModal/index.tsx -#: popups/pages/Personas/PersonaAvatarSetting/index.tsx +#: dashboard/modals/ConfirmModal/index.tsx +#: dashboard/components/Restore/ConfirmSynchronizePasswordDialog.tsx #: popups/pages/Wallet/components/DisconnectModal/index.tsx -#: popups/pages/Wallet/EditNetwork/index.tsx -#: popups/pages/Wallet/GasSetting/GasSetting1559.tsx -#: popups/pages/Wallet/GasSetting/Prior1559GasSetting.tsx -#: popups/pages/Wallet/Interaction/interaction.tsx -#: popups/pages/Wallet/ResetWallet/index.tsx -#: popups/pages/Wallet/SelectWallet/index.tsx -#: popups/pages/Wallet/SetPaymentPassword/index.tsx #: popups/pages/Wallet/Transfer/NonFungibleTokenSection.tsx +#: popups/pages/Wallet/SetPaymentPassword/index.tsx +#: popups/pages/Wallet/SelectWallet/index.tsx +#: popups/pages/Wallet/ResetWallet/index.tsx +#: popups/pages/Wallet/Interaction/interaction.tsx +#: popups/pages/Wallet/GasSetting/Prior1559GasSetting.tsx +#: popups/pages/Wallet/GasSetting/GasSetting1559.tsx +#: popups/pages/Wallet/EditNetwork/index.tsx +#: popups/pages/Personas/PersonaAvatarSetting/index.tsx +#: popups/modals/WalletRenameModal/index.tsx +#: popups/modals/WalletAutoLockSettingModal/index.tsx +#: popups/modals/ShowPrivateKeyModal/index.tsx +#: popups/modals/SetBackupPasswordModal/index.tsx +#: popups/modals/PersonaRenameModal/index.tsx +#: popups/modals/GasSettingModal/GasSettingDialog.tsx +#: popups/modals/EditContactModal/index.tsx +#: popups/modals/ConfirmModal/index.tsx +#: popups/modals/ChangePaymentPasswordModal/index.tsx +#: popups/modals/ChangeBackupPasswordModal/index.tsx +#: popups/modals/AddContactModal/index.tsx +#: popups/components/NFTAvatarPicker/index.tsx msgid "Confirm" msgstr "crwdns29564:0crwdne29564:0" @@ -566,8 +621,8 @@ msgstr "crwdns29564:0crwdne29564:0" msgid "Confirm Bridge" msgstr "crwdns35396:0crwdne35396:0" -#: popups/modals/ChangePaymentPasswordModal/index.tsx #: popups/pages/Wallet/SetPaymentPassword/index.tsx +#: popups/modals/ChangePaymentPasswordModal/index.tsx msgid "Confirm Password" msgstr "crwdns29988:0crwdne29988:0" @@ -579,6 +634,7 @@ msgstr "crwdns29566:0crwdne29566:0" msgid "Confirm Swap" msgstr "crwdns35398:0crwdne35398:0" +#. placeholder {0}: asset.symbol #: popups/pages/Wallet/TokenDetail/index.tsx msgid "Confirm to hide {0}? You can redisplay it by re-adding this token at any time." msgstr "crwdns29992:0{0}crwdne29992:0" @@ -587,16 +643,14 @@ msgstr "crwdns29992:0{0}crwdne29992:0" msgid "Confirm to hide {name}? You can redisplay it by re-adding this NFT at any time." msgstr "crwdns32020:0{name}crwdne32020:0" -#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #: popups/pages/Personas/ConnectWallet/index.tsx msgid "Congratulations" msgstr "crwdns29568:0crwdne29568:0" #: content-script/components/CompositionDialog/EncryptionTargetSelector.tsx -#: popups/components/ConnectedWallet/index.tsx -#: popups/components/SocialAccounts/index.tsx #: popups/modals/SelectProviderModal/index.tsx +#: popups/components/SocialAccounts/index.tsx +#: popups/components/ConnectedWallet/index.tsx msgid "Connect" msgstr "crwdns29994:0crwdne29994:0" @@ -621,10 +675,10 @@ msgstr "crwdns30002:0crwdne30002:0" msgid "Connect Wallet" msgstr "crwdns30004:0crwdne30004:0" -#: popups/pages/Wallet/Interaction/AddChainRequest.tsx +#: popups/pages/Wallet/Interaction/SwitchChainRequest.tsx #: popups/pages/Wallet/Interaction/PermissionRequest.tsx #: popups/pages/Wallet/Interaction/PermissionRequest.tsx -#: popups/pages/Wallet/Interaction/SwitchChainRequest.tsx +#: popups/pages/Wallet/Interaction/AddChainRequest.tsx msgid "Connect with Mask Wallet" msgstr "crwdns30006:0crwdne30006:0" @@ -641,15 +695,20 @@ msgstr "crwdns30010:0crwdne30010:0" msgid "Connected" msgstr "crwdns32782:0crwdne32782:0" +#. placeholder {0}: currentPersona?.nickname #: popups/pages/Personas/ConnectWallet/index.tsx msgid "Connected {0} with {walletName}." msgstr "crwdns32022:0{0}crwdnd32022:0{walletName}crwdne32022:0" -#: popups/pages/Wallet/ConnectedSites/index.tsx #: popups/pages/Wallet/WalletSettings/ConnectedOrigins.tsx +#: popups/pages/Wallet/ConnectedSites/index.tsx msgid "Connected sites" msgstr "crwdns30012:0crwdne30012:0" +#: content-script/components/InjectedComponents/SetupGuide/AccountConnectStatus.tsx +msgid "Connected successfully." +msgstr "crwdns36875:0crwdne36875:0" + #: popups/pages/Personas/Home/UI.tsx msgid "Connected Wallet" msgstr "crwdns30014:0crwdne30014:0" @@ -675,30 +734,33 @@ msgid "Contact edited." msgstr "crwdns32030:0crwdne32030:0" #: dashboard/components/BackupPreview/index.tsx -#: popups/pages/Friends/Home/index.tsx +#: popups/pages/Wallet/WalletSettings/Contacts.tsx #: popups/pages/Wallet/ContactList/index.tsx #: popups/pages/Wallet/ContactList/index.tsx -#: popups/pages/Wallet/WalletSettings/Contacts.tsx +#: popups/pages/Friends/Home/index.tsx msgid "Contacts" msgstr "crwdns29570:0crwdne29570:0" -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx -#: dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx -#: dashboard/components/Restore/RestoreFromMnemonic.tsx -#: dashboard/components/Restore/RestoreFromPrivateKey.tsx -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx -#: dashboard/components/Restore/RestoreWalletFromLocal.tsx -#: dashboard/pages/CreateMaskWallet/AddDeriveWallet/index.tsx -#: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx -#: dashboard/pages/SetupPersona/CloudBackup/index.tsx -#: dashboard/pages/SetupPersona/Mnemonic/index.tsx -#: dashboard/pages/SetupPersona/SignUp/index.tsx #: dashboard/pages/SignUp/steps/PersonaNameUI.tsx +#: dashboard/pages/SetupPersona/SignUp/index.tsx +#: dashboard/pages/SetupPersona/Recovery/PrivateKey.tsx +#: dashboard/pages/SetupPersona/Recovery/Phrase.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx +#: dashboard/pages/SetupPersona/Mnemonic/index.tsx +#: dashboard/pages/SetupPersona/CloudBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx +#: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx +#: dashboard/pages/CreateMaskWallet/AddDeriveWallet/index.tsx +#: dashboard/components/Restore/RestoreWalletFromLocal.tsx +#: dashboard/components/Restore/RestoreFromPrivateKey.tsx +#: dashboard/components/Restore/RestoreFromMnemonic.tsx msgid "Continue" msgstr "crwdns29572:0crwdne29572:0" -#: popups/components/UnlockERC20Token/index.tsx #: popups/components/UnlockERC721Token/index.tsx +#: popups/components/UnlockERC20Token/index.tsx msgid "Contract" msgstr "crwdns30022:0crwdne30022:0" @@ -706,8 +768,8 @@ msgstr "crwdns30022:0crwdne30022:0" msgid "Contract Interaction" msgstr "crwdns30024:0crwdne30024:0" -#: popups/components/PrivateKeyDisplay/index.tsx #: popups/pages/Personas/ExportPrivateKey/index.tsx +#: popups/components/PrivateKeyDisplay/index.tsx msgid "Copied" msgstr "crwdns30026:0crwdne30026:0" @@ -732,8 +794,8 @@ msgid "Could not fetch chain ID. Is your RPC URL correct?" msgstr "crwdns30040:0crwdne30040:0" #: content-script/components/CompositionDialog/EncryptionTargetSelector.tsx -#: dashboard/pages/CreateMaskWallet/AddDeriveWallet/index.tsx #: dashboard/pages/CreateMaskWallet/Recovery/index.tsx +#: dashboard/pages/CreateMaskWallet/AddDeriveWallet/index.tsx msgid "Create" msgstr "crwdns29574:0crwdne29574:0" @@ -749,6 +811,7 @@ msgstr "crwdns29576:0crwdne29576:0" msgid "Create Password" msgstr "crwdns30044:0crwdne30044:0" +#: dashboard/pages/SetupPersona/Recovery/index.tsx #: popups/pages/Personas/Home/UI.tsx msgid "Create Persona" msgstr "crwdns30046:0crwdne30046:0" @@ -759,11 +822,24 @@ msgstr "crwdns29578:0crwdne29578:0" #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx #: dashboard/pages/SetupPersona/Onboarding/index.tsx -msgid "Creating your" -msgstr "crwdns29580:0crwdne29580:0" +#~ msgid "Creating your" +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +#~ msgid "Creating your " +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +msgid "Creating your **identity**" +msgstr "crwdns37280:0crwdne37280:0" + +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +msgid "Creating your **wallet**" +msgstr "crwdns37282:0crwdne37282:0" -#: popups/modals/ChooseCurrencyModal/index.tsx #: popups/pages/Wallet/WalletSettings/ChangeCurrency.tsx +#: popups/modals/ChooseCurrencyModal/index.tsx msgid "Currency" msgstr "crwdns30048:0crwdne30048:0" @@ -775,6 +851,7 @@ msgstr "crwdns30050:0crwdne30050:0" msgid "Current account is not the verifying account." msgstr "crwdns32032:0crwdne32032:0" +#. placeholder {0}: formatWeiToGwei(gasOptions.normal.baseFeePerGas).toFixed(2, BigNumber.ROUND_UP) #: popups/modals/GasSettingModal/GasSettingDialog.tsx msgid "Current base fee is {0} Gwei" msgstr "crwdns30052:0{0}crwdne30052:0" @@ -787,35 +864,39 @@ msgstr "crwdns30054:0crwdne30054:0" msgid "Current wallet (<0>{currentWallet}) is the management account of SmartPay wallet (<1>{other_wallets}).<2/>Deleting the current wallet will result in the deletion of the SmartPay wallet simultaneously." msgstr "crwdns32784:0{currentWallet}crwdnd32784:0{other_wallets}crwdne32784:0" -#: popups/components/GasSettingMenu/index.tsx #: popups/hooks/useGasOptionsMenu.tsx +#: popups/components/GasSettingMenu/index.tsx msgid "Custom" msgstr "crwdns30056:0crwdne30056:0" -#: popups/modals/SelectAppearanceModal/index.tsx #: popups/pages/Settings/index.tsx +#: popups/modals/SelectAppearanceModal/index.tsx msgid "Dark" msgstr "crwdns30058:0crwdne30058:0" -#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx #: dashboard/pages/SetupPersona/Onboarding/index.tsx -msgid "data" -msgstr "crwdns29582:0crwdne29582:0" +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +#~ msgid "data" +#~ msgstr "" #: popups/pages/Wallet/Interaction/TransactionRequest.tsx msgid "Data" msgstr "crwdns30060:0crwdne30060:0" +#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx +msgid "Data backed up successfully!" +msgstr "crwdns37232:0crwdne37232:0" + #: popups/pages/Settings/index.tsx msgid "Data correlation" msgstr "crwdns27972:0crwdne27972:0" #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Data merged from Mask Cloud Service to local successfully. Re-enter your password to encrypt and upload the new backup to Mask Cloud Service." -msgstr "crwdns32034:0crwdne32034:0" +#~ msgid "Data merged from Mask Cloud Service to local successfully. Re-enter your password to encrypt and upload the new backup to Mask Cloud Service." +#~ msgstr "" -#: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx -#: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx msgid "Decrypt failed, please check password" msgstr "crwdns29586:0crwdne29586:0" @@ -831,8 +912,8 @@ msgstr "crwdns30062:0crwdne30062:0" msgid "Delete" msgstr "crwdns30066:0crwdne30066:0" -#: popups/modals/DeleteContactModal/index.tsx #: popups/pages/Wallet/ContactList/index.tsx +#: popups/modals/DeleteContactModal/index.tsx msgid "Delete Contact" msgstr "crwdns30068:0crwdne30068:0" @@ -848,6 +929,10 @@ msgstr "crwdns30074:0crwdne30074:0" msgid "Description" msgstr "crwdns30076:0crwdne30076:0" +#: popups/pages/Wallet/WalletSettings/DisablePermit.tsx +msgid "Disable Permit" +msgstr "crwdns36718:0crwdne36718:0" + #: popups/pages/Wallet/components/DisconnectModal/index.tsx msgid "Disconnect" msgstr "crwdns30078:0crwdne30078:0" @@ -887,6 +972,8 @@ msgstr "crwdns30090:0crwdne30090:0" msgid "Do you need to paste encrypted content manually?" msgstr "crwdns30092:0crwdne30092:0" +#. placeholder {0}: selectedAccount?.identifier.userId +#. placeholder {1}: currentPersona.nickname #: popups/pages/Personas/AccountDetail/index.tsx msgid "Do you want to remove the verified association between the X account @<0>{0} and {1}?" msgstr "crwdns32788:0{0}crwdnd32788:0{1}crwdne32788:0" @@ -903,28 +990,32 @@ msgstr "crwdns32038:0crwdne32038:0" msgid "Don't see your NFT?" msgstr "crwdns30098:0crwdne30098:0" -#: content-script/components/InjectedComponents/SelectPeopleDialog.tsx -#: content-script/components/InjectedComponents/SetupGuide/AccountConnectStatus.tsx #: content-script/components/shared/SelectRecipients/SelectRecipientsDialog.tsx #: content-script/components/shared/SelectRecipients/SelectRecipientsDialog.tsx #: content-script/components/shared/SelectRecipients/SelectRecipientsDialog.tsx +#: content-script/components/InjectedComponents/SelectPeopleDialog.tsx +#: content-script/components/InjectedComponents/SetupGuide/AccountConnectStatus.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Personas/ConnectWallet/index.tsx msgid "Done" msgstr "crwdns29588:0crwdne29588:0" #: content-script/components/InjectedComponents/AutoPasteFailedDialog.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx +#: dashboard/components/GoogleDriveFileTable.tsx msgid "Download" msgstr "crwdns30100:0crwdne30100:0" #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Download backup" -msgstr "crwdns29590:0crwdne29590:0" +#~ msgid "Download backup" +#~ msgstr "" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/Local.tsx msgid "Download Backup" msgstr "crwdns29592:0crwdne29592:0" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Downloading" msgstr "crwdns29596:0crwdne29596:0" @@ -945,18 +1036,21 @@ msgstr "crwdns30104:0crwdne30104:0" msgid "Edit Contact" msgstr "crwdns30106:0crwdne30106:0" -#: content-script/components/shared/SelectProfileUI/SelectProfileUI.tsx #: content-script/components/shared/SelectRecipients/SelectRecipientsDialog.tsx +#: content-script/components/shared/SelectProfileUI/SelectProfileUI.tsx msgid "eg: X accounts, persona public keys, wallet addresses or ENS" msgstr "crwdns32040:0crwdne32040:0" -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Email" msgstr "crwdns29600:0crwdne29600:0" -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Email verification code" msgstr "crwdns29602:0crwdne29602:0" @@ -982,8 +1076,18 @@ msgstr "crwdns30120:0crwdne30120:0" #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx #: dashboard/pages/SetupPersona/Onboarding/index.tsx -msgid "Encrypting your" -msgstr "crwdns29604:0crwdne29604:0" +#~ msgid "Encrypting your" +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +#~ msgid "Encrypting your " +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +msgid "Encrypting your **data**" +msgstr "crwdns37284:0crwdne37284:0" #: content-script/components/CompositionDialog/EncryptionMethodSelector.tsx msgid "Encryption Method" @@ -993,8 +1097,8 @@ msgstr "crwdns30122:0crwdne30122:0" msgid "Ens or Address(0x)" msgstr "crwdns30124:0crwdne30124:0" -#: popups/pages/Wallet/GasSetting/GasSetting1559.tsx #: popups/pages/Wallet/GasSetting/Prior1559GasSetting.tsx +#: popups/pages/Wallet/GasSetting/GasSetting1559.tsx msgid "Enter a gas limit" msgstr "crwdns30126:0crwdne30126:0" @@ -1022,6 +1126,7 @@ msgstr "crwdns30136:0crwdne30136:0" msgid "Entered passwords are inconsistent." msgstr "crwdns32046:0crwdne32046:0" +#. placeholder {0}: rejection.message #: content-script/components/InjectedComponents/SelectPeopleDialog.tsx msgid "Error: {0}" msgstr "crwdns32048:0{0}crwdne32048:0" @@ -1043,8 +1148,8 @@ msgstr "crwdns29608:0crwdne29608:0" msgid "Exchange" msgstr "crwdns35400:0crwdne35400:0" -#: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/SetupPersona/PermissionOnboarding/index.tsx +#: dashboard/pages/SetupPersona/Onboarding/index.tsx msgid "Experience in X" msgstr "crwdns29610:0crwdne29610:0" @@ -1052,8 +1157,8 @@ msgstr "crwdns29610:0crwdne29610:0" msgid "Explore multi-chain dApps." msgstr "crwdns30140:0crwdne30140:0" -#: popups/modals/VerifyBackupPasswordModal/index.tsx #: popups/pages/Wallet/ExportPrivateKey/index.tsx +#: popups/modals/VerifyBackupPasswordModal/index.tsx msgid "Export" msgstr "crwdns30142:0crwdne30142:0" @@ -1075,9 +1180,29 @@ msgstr "crwdns32050:0crwdne32050:0" msgid "Failed to disconnect wallet" msgstr "crwdns32052:0crwdne32052:0" +#. placeholder {0}: (err as Error).message +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Failed to download and merge the backup." -msgstr "crwdns32054:0crwdne32054:0" +msgid "Failed to download and merge the backup: {0}" +msgstr "crwdns37234:0{0}crwdne37234:0" + +#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +#~ msgid "Failed to download and merge the backup." +#~ msgstr "" + +#. placeholder {0}: (err as Error).message +#: dashboard/components/GoogleDriveLogin.tsx +msgid "Failed to login: {0}" +msgstr "crwdns37236:0{0}crwdne37236:0" + +#: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +msgid "Failed to restore the backup from Google Drive to your browser. Please try again." +msgstr "crwdns37264:0crwdne37264:0" + +#. placeholder {0}: (err as Error).message +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Failed to restore the backup: {0}" +msgstr "crwdns37266:0{0}crwdne37266:0" #: popups/pages/Wallet/EditNetwork/index.tsx msgid "Failed to save network" @@ -1120,10 +1245,10 @@ msgstr "crwdns35460:0{officialAccount}crwdne35460:0" msgid "Follow @realMaskNetwork to explore Web3." msgstr "crwdns32058:0crwdne32058:0" -#: popups/modals/SelectAppearanceModal/index.tsx -#: popups/modals/SelectLanguageModal/index.tsx #: popups/pages/Settings/index.tsx #: popups/pages/Settings/index.tsx +#: popups/modals/SelectLanguageModal/index.tsx +#: popups/modals/SelectAppearanceModal/index.tsx msgid "Follow System" msgstr "crwdns30164:0crwdne30164:0" @@ -1139,16 +1264,17 @@ msgstr "crwdns30168:0crwdne30168:0" msgid "from <0>{fromAddress}" msgstr "crwdns32790:0{fromAddress}crwdne32790:0" +#. placeholder {0}: transaction.formattedTransaction.popup.method #: popups/pages/Wallet/Interaction/TransactionRequest.tsx msgid "Function: {0}" msgstr "crwdns30170:0{0}crwdne30170:0" -#: popups/components/TransactionPreview/index.tsx -#: popups/components/UnlockERC20Token/index.tsx -#: popups/components/UnlockERC721Token/index.tsx -#: popups/modals/GasSettingModal/index.tsx -#: popups/pages/Wallet/ChangeOwner/index.tsx #: popups/pages/Wallet/Transfer/FungibleTokenSection.tsx +#: popups/pages/Wallet/ChangeOwner/index.tsx +#: popups/modals/GasSettingModal/index.tsx +#: popups/components/UnlockERC721Token/index.tsx +#: popups/components/UnlockERC20Token/index.tsx +#: popups/components/TransactionPreview/index.tsx msgid "Gas Fee" msgstr "crwdns30172:0crwdne30172:0" @@ -1161,9 +1287,9 @@ msgstr "crwdns30174:0crwdne30174:0" msgid "Gas fees are the fees for paying ethereum block builders. Block builders prefer to pack transactions with higher gas fees. Transactions with low gas fees might fail, and the paid gas fees won't be returned." msgstr "crwdns32060:0crwdne32060:0" -#: popups/modals/GasSettingModal/GasSettingDialog.tsx -#: popups/pages/Wallet/GasSetting/GasSetting1559.tsx #: popups/pages/Wallet/GasSetting/Prior1559GasSetting.tsx +#: popups/pages/Wallet/GasSetting/GasSetting1559.tsx +#: popups/modals/GasSettingModal/GasSettingDialog.tsx msgid "Gas Limit" msgstr "crwdns30178:0crwdne30178:0" @@ -1171,8 +1297,9 @@ msgstr "crwdns30178:0crwdne30178:0" msgid "Gas Limit (Units)" msgstr "crwdns30180:0crwdne30180:0" -#: popups/pages/Wallet/GasSetting/GasSetting1559.tsx +#. placeholder {0}: String(minGasLimit) #: popups/pages/Wallet/GasSetting/Prior1559GasSetting.tsx +#: popups/pages/Wallet/GasSetting/GasSetting1559.tsx msgid "Gas limit must be at least {0}" msgstr "crwdns30182:0{0}crwdne30182:0" @@ -1184,8 +1311,8 @@ msgstr "crwdns30184:0{minGas}crwdne30184:0" msgid "Gas limit must be smaller than {maxGas}." msgstr "crwdns30186:0{maxGas}crwdne30186:0" -#: popups/modals/GasSettingModal/GasSettingDialog.tsx #: popups/pages/Wallet/GasSetting/Prior1559GasSetting.tsx +#: popups/modals/GasSettingModal/GasSettingDialog.tsx msgid "Gas Price" msgstr "crwdns30188:0crwdne30188:0" @@ -1219,14 +1346,33 @@ msgstr "crwdns30202:0crwdne30202:0" #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx #: dashboard/pages/SetupPersona/Onboarding/index.tsx -msgid "Generating your" -msgstr "crwdns29614:0crwdne29614:0" +#~ msgid "Generating your" +#~ msgstr "" -#: popups/components/UnlockERC20Token/index.tsx +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +#~ msgid "Generating your " +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +msgid "Generating your **accounts**" +msgstr "crwdns37286:0crwdne37286:0" + +#. placeholder {0}: contract?.symbol || '' +#. placeholder {0}: token?.symbol || '' #: popups/components/UnlockERC721Token/index.tsx +#: popups/components/UnlockERC20Token/index.tsx msgid "Give permission to access <0/> your {0}?" msgstr "crwdns32792:0{0}crwdne32792:0" +#: dashboard/pages/SetupPersona/Recovery/Cloud/index.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/index.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx +msgid "Google Drive" +msgstr "crwdns37238:0crwdne37238:0" + #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx msgid "Got it" msgstr "crwdns29616:0crwdne29616:0" @@ -1255,6 +1401,7 @@ msgstr "crwdns32064:0crwdne32064:0" msgid "Hi friends, I just created {token} Lucky Drop. Download Mask.io to claim." msgstr "crwdns32794:0{token}crwdne32794:0" +#. placeholder {0}: asset.symbol #: popups/pages/Wallet/TokenDetail/index.tsx msgid "Hide {0}" msgstr "crwdns30212:0{0}crwdne30212:0" @@ -1275,10 +1422,10 @@ msgstr "crwdns30216:0crwdne30216:0" msgid "Hiding Scam Transactions" msgstr "crwdns30218:0crwdne30218:0" -#: popups/components/GasSettingMenu/index.tsx -#: popups/hooks/useGasOptionsMenu.tsx -#: popups/pages/Wallet/GasSetting/GasSetting1559.tsx #: popups/pages/Wallet/GasSetting/Prior1559GasSetting.tsx +#: popups/pages/Wallet/GasSetting/GasSetting1559.tsx +#: popups/hooks/useGasOptionsMenu.tsx +#: popups/components/GasSettingMenu/index.tsx msgid "High" msgstr "crwdns30220:0crwdne30220:0" @@ -1291,8 +1438,8 @@ msgid "I wrote down those words in the correct order" msgstr "crwdns32070:0crwdne32070:0" #: dashboard/pages/SetupPersona/Onboarding/index.tsx -msgid "identity" -msgstr "crwdns29620:0crwdne29620:0" +#~ msgid "identity" +#~ msgstr "" #: dashboard/pages/SetupPersona/Mnemonic/ComponentToPrint.tsx msgid "Identity ID" @@ -1336,15 +1483,21 @@ msgstr "crwdns30230:0crwdne30230:0" msgid "Imported Wallets" msgstr "crwdns30232:0crwdne30232:0" -#: popups/modals/ChangeBackupPasswordModal/index.tsx +#: dashboard/hooks/useBackupFormState.ts +msgid "Incorrect Backup Password" +msgstr "crwdns37240:0crwdne37240:0" + #: popups/modals/VerifyBackupPasswordModal/index.tsx +#: popups/modals/ChangeBackupPasswordModal/index.tsx msgid "Incorrect backup password." msgstr "crwdns30234:0crwdne30234:0" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx msgid "Incorrect Backup Password." msgstr "crwdns29626:0crwdne29626:0" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Incorrect cloud backup password, please try again." @@ -1358,21 +1511,21 @@ msgstr "crwdns29630:0crwdne29630:0" msgid "Incorrect Mnemonic Words." msgstr "crwdns32074:0crwdne32074:0" +#: popups/pages/Wallet/Unlock/index.tsx #: popups/pages/Personas/Logout/index.tsx #: popups/pages/Personas/Logout/index.tsx -#: popups/pages/Wallet/Unlock/index.tsx msgid "Incorrect password" msgstr "crwdns30236:0crwdne30236:0" +#: dashboard/pages/SetupPersona/LocalBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/Local.tsx +#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: dashboard/hooks/useBackupFormState.ts #: dashboard/hooks/useBackupFormState.ts #: dashboard/hooks/useBackupFormState.ts #: dashboard/hooks/useBackupFormState.ts #: dashboard/hooks/useBackupFormState.ts #: dashboard/hooks/useBackupFormState.ts -#: dashboard/hooks/useBackupFormState.ts -#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx msgid "Incorrect Password" msgstr "crwdns29634:0crwdne29634:0" @@ -1380,22 +1533,22 @@ msgstr "crwdns29634:0crwdne29634:0" msgid "Incorrect payment password." msgstr "crwdns30238:0crwdne30238:0" -#: popups/modals/ShowPrivateKeyModal/index.tsx #: popups/modals/WalletRemoveModal/index.tsx +#: popups/modals/ShowPrivateKeyModal/index.tsx msgid "Incorrect Payment Password." msgstr "crwdns30240:0crwdne30240:0" +#: dashboard/pages/SetupPersona/Recovery/PrivateKey.tsx #: dashboard/pages/CreateMaskWallet/Recovery/index.tsx -#: dashboard/pages/SetupPersona/Recovery/index.tsx msgid "Incorrect Private Key" msgstr "crwdns29636:0crwdne29636:0" -#: dashboard/pages/SetupPersona/Recovery/index.tsx +#: dashboard/pages/SetupPersona/Recovery/Phrase.tsx msgid "Incorrect recovery phrase." msgstr "crwdns29638:0crwdne29638:0" -#: popups/hooks/useContactsContext.ts #: popups/modals/AddContactModal/index.tsx +#: popups/hooks/useContactsContext.ts msgid "Incorrect wallet address." msgstr "crwdns30242:0crwdne30242:0" @@ -1403,12 +1556,13 @@ msgstr "crwdns30242:0crwdne30242:0" msgid "Incorrect words selected. Please try again!" msgstr "crwdns32076:0crwdne32076:0" +#: dashboard/pages/SetupPersona/Recovery/PrivateKey.tsx #: dashboard/components/Restore/RestoreFromPrivateKey.tsx msgid "Input your Private Key" msgstr "crwdns29640:0crwdne29640:0" -#: popups/components/GasSettingMenu/index.tsx #: popups/hooks/useGasOptionsMenu.tsx +#: popups/components/GasSettingMenu/index.tsx msgid "Instant" msgstr "crwdns30244:0crwdne30244:0" @@ -1420,12 +1574,14 @@ msgstr "crwdns30246:0crwdne30246:0" msgid "Invalid Block Explorer URL." msgstr "crwdns30248:0crwdne30248:0" -#: dashboard/contexts/CloudBackupFormContext.tsx #: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts +#: dashboard/contexts/CloudBackupFormContext.tsx msgid "Invalid email address format." msgstr "crwdns29642:0crwdne29642:0" -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx msgid "Invalid email address." msgstr "crwdns32078:0crwdne32078:0" @@ -1433,7 +1589,7 @@ msgstr "crwdns32078:0crwdne32078:0" msgid "Invalid number" msgstr "crwdns30250:0crwdne30250:0" -#: dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx msgid "Invalid phone number, please check and try again." msgstr "crwdns29644:0crwdne29644:0" @@ -1441,8 +1597,8 @@ msgstr "crwdns29644:0crwdne29644:0" msgid "Invalid RPC URL." msgstr "crwdns30252:0crwdne30252:0" -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx -#: dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx msgid "Invalid verification code." msgstr "crwdns29646:0crwdne29646:0" @@ -1476,10 +1632,10 @@ msgstr "crwdns30262:0crwdne30262:0" msgid "Keystore password" msgstr "crwdns29650:0crwdne29650:0" +#: popups/modals/SetBackupPasswordModal/index.tsx #: popups/modals/ChangeBackupPasswordModal/index.tsx #: popups/modals/ChangeBackupPasswordModal/index.tsx #: popups/modals/ChangeBackupPasswordModal/index.tsx -#: popups/modals/SetBackupPasswordModal/index.tsx msgid "Lack of number, letter or special character." msgstr "crwdns30264:0crwdne30264:0" @@ -1487,8 +1643,8 @@ msgstr "crwdns30264:0crwdne30264:0" msgid "Language" msgstr "crwdns30266:0crwdne30266:0" -#: popups/modals/SelectAppearanceModal/index.tsx #: popups/pages/Settings/index.tsx +#: popups/modals/SelectAppearanceModal/index.tsx msgid "Light" msgstr "crwdns30268:0crwdne30268:0" @@ -1505,8 +1661,8 @@ msgid "Load failed" msgstr "crwdns30272:0crwdne30272:0" #: content-script/components/shared/SelectRecipients/SelectRecipientsDialog.tsx -#: popups/components/WalletSettingList/index.tsx #: popups/pages/Friends/Home/UI.tsx +#: popups/components/WalletSettingList/index.tsx msgid "Loading" msgstr "crwdns30274:0crwdne30274:0" @@ -1523,13 +1679,17 @@ msgstr "crwdns29652:0crwdne29652:0" msgid "Local persona or wallet only" msgstr "crwdns30276:0crwdne30276:0" +#: dashboard/pages/SetupPersona/Backup/index.tsx +msgid "Locale Backup" +msgstr "crwdns37242:0crwdne37242:0" + #: popups/pages/Wallet/SwitchWallet/index.tsx msgid "Lock Wallet" msgstr "crwdns30278:0crwdne30278:0" -#: popups/modals/PersonaSettingModal/index.tsx #: popups/pages/Personas/Logout/index.tsx #: popups/pages/Personas/Logout/index.tsx +#: popups/modals/PersonaSettingModal/index.tsx msgid "Log out" msgstr "crwdns30280:0crwdne30280:0" @@ -1537,6 +1697,12 @@ msgstr "crwdns30280:0crwdne30280:0" msgid "Login to Mask Cloud" msgstr "crwdns32080:0crwdne32080:0" +#: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx +msgid "Logout" +msgstr "crwdns37244:0crwdne37244:0" + #: popups/pages/Personas/Logout/index.tsx msgid "Logout failed" msgstr "crwdns30282:0crwdne30282:0" @@ -1545,13 +1711,13 @@ msgstr "crwdns30282:0crwdne30282:0" msgid "Logout successfully" msgstr "crwdns30284:0crwdne30284:0" -#: popups/pages/Wallet/GasSetting/GasSetting1559.tsx #: popups/pages/Wallet/GasSetting/Prior1559GasSetting.tsx +#: popups/pages/Wallet/GasSetting/GasSetting1559.tsx msgid "Low" msgstr "crwdns30286:0crwdne30286:0" -#: popups/modals/ChooseNetworkModal/index.tsx #: popups/pages/Wallet/NetworkManagement/index.tsx +#: popups/modals/ChooseNetworkModal/index.tsx msgid "Manage Network" msgstr "crwdns30288:0crwdne30288:0" @@ -1563,11 +1729,17 @@ msgstr "crwdns32082:0crwdne32082:0" msgid "Mask needs the following permissions" msgstr "crwdns30300:0crwdne30300:0" -#: content-script/components/InjectedComponents/PostDialogHint.tsx #: content-script/components/InjectedComponents/ToolboxUnstyled.tsx +#: content-script/components/InjectedComponents/PostDialogHint.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/index.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/index.tsx msgid "Mask Network" msgstr "crwdns30302:0crwdne30302:0" +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx +msgid "Mask Network Cloud" +msgstr "crwdns37246:0crwdne37246:0" + #: content-script/components/InjectedComponents/PermissionBoundary.tsx msgid "Mask Network requires you to authorize the following websites before using it." msgstr "crwdns32800:0crwdne32800:0" @@ -1576,13 +1748,13 @@ msgstr "crwdns32800:0crwdne32800:0" msgid "masknetwork" msgstr "crwdns30304:0crwdne30304:0" -#: popups/components/UnlockERC20Token/index.tsx #: popups/pages/Wallet/Transfer/FungibleTokenSection.tsx +#: popups/components/UnlockERC20Token/index.tsx msgid "Max" msgstr "crwdns30306:0crwdne30306:0" -#: popups/modals/GasSettingModal/GasSettingDialog.tsx #: popups/pages/Wallet/GasSetting/GasSetting1559.tsx +#: popups/modals/GasSettingModal/GasSettingDialog.tsx msgid "Max Fee" msgstr "crwdns30308:0crwdne30308:0" @@ -1602,12 +1774,13 @@ msgstr "crwdns30314:0crwdne30314:0" msgid "Max fee is too low for network conditions." msgstr "crwdns30316:0crwdne30316:0" +#. placeholder {0}: formatWeiToGwei(miniumMaxFeePerGas).toFixed(2, BigNumber.ROUND_UP) #: popups/modals/GasSettingModal/GasSettingDialog.tsx msgid "Max fee should be greater than base fee of {0} Gwei." msgstr "crwdns30318:0{0}crwdne30318:0" -#: popups/modals/GasSettingModal/GasSettingDialog.tsx #: popups/pages/Wallet/GasSetting/GasSetting1559.tsx +#: popups/modals/GasSettingModal/GasSettingDialog.tsx msgid "Max Priority Fee" msgstr "crwdns30320:0crwdne30320:0" @@ -1631,22 +1804,34 @@ msgstr "crwdns30328:0crwdne30328:0" msgid "Max priority fee must be greater than 0 GWEI" msgstr "crwdns30330:0crwdne30330:0" -#: popups/components/GasSettingMenu/index.tsx -#: popups/hooks/useGasOptionsMenu.tsx -#: popups/pages/Wallet/GasSetting/GasSetting1559.tsx #: popups/pages/Wallet/GasSetting/Prior1559GasSetting.tsx +#: popups/pages/Wallet/GasSetting/GasSetting1559.tsx +#: popups/hooks/useGasOptionsMenu.tsx +#: popups/components/GasSettingMenu/index.tsx msgid "Medium" msgstr "crwdns30332:0crwdne30332:0" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +msgid "Merge Completed" +msgstr "crwdns37248:0crwdne37248:0" + #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Merge data to local database" msgstr "crwdns29656:0crwdne29656:0" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +#: dashboard/components/GoogleDriveFileTable.tsx +msgid "Merge to Browser" +msgstr "crwdns37250:0crwdne37250:0" + #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -msgid "Merge to local" -msgstr "crwdns29658:0crwdne29658:0" +#~ msgid "Merge to local" +#~ msgstr "" #: popups/components/SignRequestInfo/index.tsx msgid "Message" @@ -1662,17 +1847,21 @@ msgid "Mnemonic word" msgstr "crwdns29660:0crwdne29660:0" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx msgid "Mobile" msgstr "crwdns29662:0crwdne29662:0" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx msgid "Mobile number" msgstr "crwdns29664:0crwdne29664:0" -#: dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx msgid "Mobile verification code" msgstr "crwdns29666:0crwdne29666:0" +#. placeholder {0}: String(currentMessageIndex + 1) +#. placeholder {1}: String(totalMessages) #: popups/pages/Wallet/Interaction/interaction.tsx msgid "Multiple transaction requests {0} / {1}" msgstr "crwdns30338:0{0}crwdnd30338:0{1}crwdne30338:0" @@ -1687,9 +1876,9 @@ msgstr "crwdns30340:0crwdne30340:0" msgid "N/A" msgstr "crwdns30342:0crwdne30342:0" -#: popups/modals/AddContactModal/index.tsx -#: popups/modals/EditContactModal/index.tsx #: popups/modals/PersonaSettingModal/index.tsx +#: popups/modals/EditContactModal/index.tsx +#: popups/modals/AddContactModal/index.tsx msgid "Name" msgstr "crwdns30344:0crwdne30344:0" @@ -1747,8 +1936,8 @@ msgstr "crwdns30358:0crwdne30358:0" #: content-script/components/GuideStep/index.tsx #: dashboard/pages/CreateMaskWallet/AddDeriveWallet/index.tsx -#: popups/pages/Wallet/ContactList/index.tsx #: popups/pages/Wallet/Transfer/FungibleTokenSection.tsx +#: popups/pages/Wallet/ContactList/index.tsx msgid "Next" msgstr "crwdns29670:0crwdne29670:0" @@ -1756,10 +1945,10 @@ msgstr "crwdns29670:0crwdne29670:0" msgid "Next.ID" msgstr "crwdns30360:0crwdne30360:0" -#: popups/pages/Personas/PersonaAvatarSetting/index.tsx -#: popups/pages/Wallet/AddToken/index.tsx #: popups/pages/Wallet/components/WalletAssets/index.tsx #: popups/pages/Wallet/Transfer/index.tsx +#: popups/pages/Wallet/AddToken/index.tsx +#: popups/pages/Personas/PersonaAvatarSetting/index.tsx msgid "NFTs" msgstr "crwdns30362:0crwdne30362:0" @@ -1781,6 +1970,8 @@ msgid "No back up" msgstr "crwdns30366:0crwdne30366:0" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx +#: dashboard/components/GoogleDriveFileTable.tsx msgid "No backups found" msgstr "crwdns29672:0crwdne29672:0" @@ -1792,8 +1983,8 @@ msgstr "crwdns32096:0crwdne32096:0" msgid "No Data" msgstr "crwdns30368:0crwdne30368:0" -#: content-script/components/shared/SelectProfileUI/SelectProfileUI.tsx #: content-script/components/shared/SelectRecipients/SelectRecipientsDialog.tsx +#: content-script/components/shared/SelectProfileUI/SelectProfileUI.tsx msgid "No friends are stored locally, please try search one." msgstr "crwdns32098:0crwdne32098:0" @@ -1821,9 +2012,9 @@ msgstr "crwdns30380:0crwdne30380:0" msgid "No websites connected to this wallet" msgstr "crwdns35874:0crwdne35874:0" -#: popups/components/SignRequestInfo/index.tsx -#: popups/modals/GasSettingModal/GasSettingDialog.tsx #: popups/pages/Wallet/TransactionDetail/index.tsx +#: popups/modals/GasSettingModal/GasSettingDialog.tsx +#: popups/components/SignRequestInfo/index.tsx msgid "Nonce" msgstr "crwdns30382:0crwdne30382:0" @@ -1855,6 +2046,10 @@ msgstr "crwdns30394:0crwdne30394:0" msgid "OK" msgstr "crwdns30396:0crwdne30396:0" +#: popups/pages/Wallet/WalletSettings/DisablePermit.tsx +msgid "Okay" +msgstr "crwdns36720:0crwdne36720:0" + #: popups/modals/ChangePaymentPasswordModal/index.tsx msgid "Old Payment Password" msgstr "crwdns30398:0crwdne30398:0" @@ -1879,6 +2074,7 @@ msgstr "crwdns30404:0crwdne30404:0" msgid "Or create a new wallet group" msgstr "crwdns30406:0crwdne30406:0" +#. placeholder {0}: author.userId #: content-script/components/InjectedComponents/DecryptedPost/authorDifferentMessage.tsx msgid "Originally posted by {0}" msgstr "crwdns30408:0{0}crwdne30408:0" @@ -1887,7 +2083,6 @@ msgstr "crwdns30408:0{0}crwdne30408:0" msgid "Other social networking platforms, such as <0>Instagram, <1>Facebook, and <2>Minds, do not have a verified relationship like X's Next.ID verified connection.<3/><4/>When connecting a persona with an account on these platforms, they only support sending encrypted posts." msgstr "crwdns32806:0crwdne32806:0" -#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx msgid "Overwrite Backup" msgstr "crwdns29676:0crwdne29676:0" @@ -1896,9 +2091,9 @@ msgstr "crwdns29676:0crwdne29676:0" msgid "Overwrite current backup" msgstr "crwdns29678:0crwdne29678:0" -#: popups/modals/ChangeBackupPasswordModal/index.tsx -#: popups/modals/SetBackupPasswordModal/index.tsx #: popups/modals/VerifyBackupPasswordModal/index.tsx +#: popups/modals/SetBackupPasswordModal/index.tsx +#: popups/modals/ChangeBackupPasswordModal/index.tsx msgid "Password" msgstr "crwdns30410:0crwdne30410:0" @@ -1906,11 +2101,12 @@ msgstr "crwdns30410:0crwdne30410:0" msgid "Paste manually" msgstr "crwdns30412:0crwdne30412:0" -#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -#: popups/modals/ShowPrivateKeyModal/index.tsx -#: popups/modals/WalletRemoveModal/index.tsx +#: dashboard/pages/SetupPersona/Backup/Local.tsx +#: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Wallet/SetPaymentPassword/index.tsx +#: popups/modals/WalletRemoveModal/index.tsx +#: popups/modals/ShowPrivateKeyModal/index.tsx msgid "Payment Password" msgstr "crwdns29680:0crwdne29680:0" @@ -1920,9 +2116,9 @@ msgstr "crwdns32102:0crwdne32102:0" #: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx #: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx -#: popups/modals/ChangePaymentPasswordModal/index.tsx #: popups/pages/Wallet/hooks/usePasswordForm.ts #: popups/pages/Wallet/hooks/usePasswordForm.ts +#: popups/modals/ChangePaymentPasswordModal/index.tsx msgid "Payment password must be 6 to 20 characters." msgstr "crwdns32104:0crwdne32104:0" @@ -1962,8 +2158,8 @@ msgstr "crwdns29688:0crwdne29688:0" msgid "Persona created." msgstr "crwdns32112:0crwdne32112:0" -#: dashboard/pages/SetupPersona/SignUp/index.tsx #: dashboard/pages/SignUp/steps/PersonaNameUI.tsx +#: dashboard/pages/SetupPersona/SignUp/index.tsx msgid "Persona Name" msgstr "crwdns29692:0crwdne29692:0" @@ -1988,12 +2184,13 @@ msgid "Personas" msgstr "crwdns29696:0crwdne29696:0" #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx msgid "Phone verification code" msgstr "crwdns29698:0crwdne29698:0" -#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -#: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/SetupPersona/PermissionOnboarding/index.tsx +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx msgid "Pin Mask Network to the toolbar for easier access:" msgstr "crwdns29700:0crwdne29700:0" @@ -2001,8 +2198,8 @@ msgstr "crwdns29700:0crwdne29700:0" msgid "Pinned successfully." msgstr "crwdns30424:0crwdne30424:0" -#: content-script/components/InjectedComponents/SetupGuide/index.tsx #: content-script/site-adaptors/facebook.com/injection/Composition.tsx +#: content-script/components/InjectedComponents/SetupGuide/index.tsx msgid "Please click the \"Post\" button to open the compose dialog." msgstr "crwdns32116:0crwdne32116:0" @@ -2014,6 +2211,7 @@ msgstr "crwdns32118:0crwdne32118:0" msgid "Please enter backup password to export persona private key." msgstr "crwdns30430:0crwdne30430:0" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Please enter cloud backup password to download file." msgstr "crwdns29702:0crwdne29702:0" @@ -2035,13 +2233,14 @@ msgstr "crwdns30434:0crwdne30434:0" msgid "Please install your metamask wallet and set up your first wallet." msgstr "crwdns30436:0crwdne30436:0" +#. placeholder {0}: currentPersona.nickname +#. placeholder {1}: manageWallets.length #: popups/pages/Personas/Logout/index.tsx msgid "Please note: This Persona {0} is the management account of above listed SmartPay {1, plural, one {wallet} other {wallets}}. You cannot use SmartPay wallet to interact with blockchain after logging out persona." msgstr "crwdns32808:00={0}crwdnd32808:01={1}crwdne32808:0" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Recovery/index.tsx +#: dashboard/pages/SetupPersona/LocalBackup/index.tsx msgid "Please select the appropriate method to restore your personal data." msgstr "crwdns29706:0crwdne29706:0" @@ -2116,16 +2315,16 @@ msgstr "crwdns30458:0crwdne30458:0" msgid "Private" msgstr "crwdns30460:0crwdne30460:0" -#: dashboard/pages/CreateMaskWallet/Recovery/index.tsx #: dashboard/pages/SetupPersona/Recovery/index.tsx -#: popups/pages/Personas/ExportPrivateKey/index.tsx +#: dashboard/pages/CreateMaskWallet/Recovery/index.tsx #: popups/pages/Wallet/ExportPrivateKey/index.tsx #: popups/pages/Wallet/ExportPrivateKey/index.tsx +#: popups/pages/Personas/ExportPrivateKey/index.tsx msgid "Private Key" msgstr "crwdns29716:0crwdne29716:0" -#: popups/modals/PersonaSettingModal/index.tsx #: popups/pages/Personas/PersonaAvatarSetting/index.tsx +#: popups/modals/PersonaSettingModal/index.tsx msgid "Profile Photo" msgstr "crwdns30462:0crwdne30462:0" @@ -2143,15 +2342,15 @@ msgstr "crwdns32128:0{publicKey}crwdne32128:0" msgid "Quote Route" msgstr "crwdns35406:0crwdne35406:0" -#: popups/modals/ChangeBackupPasswordModal/index.tsx #: popups/modals/SetBackupPasswordModal/index.tsx +#: popups/modals/ChangeBackupPasswordModal/index.tsx msgid "Re-enter" msgstr "crwdns30466:0crwdne30466:0" -#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx #: dashboard/pages/SetupPersona/Onboarding/index.tsx -msgid "ready 🚀" -msgstr "crwdns29720:0crwdne29720:0" +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +#~ msgid "ready 🚀" +#~ msgstr "" #: content-script/components/CompositionDialog/useSubmit.ts msgid "realMaskNetwork" @@ -2162,6 +2361,11 @@ msgstr "crwdns30468:0crwdne30468:0" msgid "Receive" msgstr "crwdns30470:0crwdne30470:0" +#: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Recover" +msgstr "crwdns37268:0crwdne37268:0" + #: dashboard/pages/SetupPersona/Recovery/index.tsx msgid "Recover your data" msgstr "crwdns29722:0crwdne29722:0" @@ -2170,8 +2374,8 @@ msgstr "crwdns29722:0crwdne29722:0" msgid "Recover your wallet" msgstr "crwdns29724:0crwdne29724:0" -#: dashboard/pages/SetupPersona/Mnemonic/index.tsx #: dashboard/pages/SetupPersona/SignUp/index.tsx +#: dashboard/pages/SetupPersona/Mnemonic/index.tsx #: popups/modals/SwitchPersonaModal/index.tsx msgid "Recovery" msgstr "crwdns29726:0crwdne29726:0" @@ -2180,8 +2384,8 @@ msgstr "crwdns29726:0crwdne29726:0" msgid "Recovery Phrase" msgstr "crwdns29728:0crwdne29728:0" -#: dashboard/pages/CreateMaskWallet/CreateMnemonic/index.tsx #: dashboard/pages/SetupPersona/Mnemonic/index.tsx +#: dashboard/pages/CreateMaskWallet/CreateMnemonic/index.tsx msgid "Refresh" msgstr "crwdns29730:0crwdne29730:0" @@ -2193,8 +2397,8 @@ msgstr "crwdns32130:0{totalMessages}crwdne32130:0" msgid "Reload" msgstr "crwdns30474:0crwdne30474:0" -#: popups/modals/WalletRemoveModal/index.tsx #: popups/pages/Wallet/WalletSettings/index.tsx +#: popups/modals/WalletRemoveModal/index.tsx msgid "Remove" msgstr "crwdns30476:0crwdne30476:0" @@ -2206,10 +2410,10 @@ msgstr "crwdns30478:0crwdne30478:0" msgid "Remove Wallet?" msgstr "crwdns30480:0crwdne30480:0" -#: popups/modals/PersonaRenameModal/index.tsx -#: popups/pages/Wallet/CreateWallet/Derive.tsx #: popups/pages/Wallet/WalletSettings/Rename.tsx #: popups/pages/Wallet/WalletSettings/Rename.tsx +#: popups/pages/Wallet/CreateWallet/Derive.tsx +#: popups/modals/PersonaRenameModal/index.tsx msgid "Rename" msgstr "crwdns30482:0crwdne30482:0" @@ -2229,12 +2433,15 @@ msgstr "crwdns30488:0crwdne30488:0" msgid "Request Source" msgstr "crwdns30490:0crwdne30490:0" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx msgid "Reselect" msgstr "crwdns29732:0crwdne29732:0" -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Resend" msgstr "crwdns29734:0crwdne29734:0" @@ -2246,24 +2453,32 @@ msgstr "crwdns30492:0crwdne30492:0" msgid "Resource" msgstr "crwdns30494:0crwdne30494:0" -#: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx -#: dashboard/components/Restore/RestoreFromCloud/index.tsx -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/MaskNetwork.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx msgid "Restore" msgstr "crwdns29736:0crwdne29736:0" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx msgid "Restore backup failed." msgstr "crwdns32132:0crwdne32132:0" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Restore Completed" +msgstr "crwdns37270:0crwdne37270:0" + #: popups/pages/Settings/index.tsx msgid "Restore Database" msgstr "crwdns30496:0crwdne30496:0" -#: dashboard/components/Restore/RestoreFromCloud/index.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/MaskNetwork.tsx msgid "Restore failed" msgstr "crwdns29740:0crwdne29740:0" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Restore Failed" +msgstr "crwdns37272:0crwdne37272:0" + #: popups/pages/Settings/index.tsx msgid "Restore from a previous database backup" msgstr "crwdns30498:0crwdne30498:0" @@ -2280,8 +2495,8 @@ msgstr "crwdns30502:0crwdne30502:0" msgid "RPC URL" msgstr "crwdns30504:0crwdne30504:0" -#: popups/components/AddContactInputPanel/index.tsx #: popups/pages/Personas/AccountDetail/UI.tsx +#: popups/components/AddContactInputPanel/index.tsx msgid "Save" msgstr "crwdns30506:0crwdne30506:0" @@ -2317,8 +2532,8 @@ msgstr "crwdns35552:0crwdne35552:0" msgid "Select Address" msgstr "crwdns29742:0crwdne29742:0" -#: content-script/components/shared/SelectProfileUI/SelectProfileUI.tsx #: content-script/components/shared/SelectRecipients/SelectRecipientsDialog.tsx +#: content-script/components/shared/SelectProfileUI/SelectProfileUI.tsx msgid "Select All" msgstr "crwdns30528:0crwdne30528:0" @@ -2347,17 +2562,23 @@ msgid "Select Wallet" msgstr "crwdns30536:0crwdne30536:0" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx -#: popups/components/TransactionPreview/index.tsx -#: popups/pages/Wallet/CollectibleDetail/index.tsx -#: popups/pages/Wallet/components/ActionGroup/index.tsx +#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx #: popups/pages/Wallet/components/ActivityList/ActivityItem.tsx -#: popups/pages/Wallet/ContactList/index.tsx +#: popups/pages/Wallet/components/ActionGroup/index.tsx #: popups/pages/Wallet/Transfer/index.tsx +#: popups/pages/Wallet/ContactList/index.tsx +#: popups/pages/Wallet/CollectibleDetail/index.tsx +#: popups/components/TransactionPreview/index.tsx msgid "Send" msgstr "crwdns29746:0crwdne29746:0" +#: content-script/components/InjectedComponents/SetupGuide/AccountConnectStatus.tsx +msgid "Sent verification post successfully." +msgstr "crwdns36877:0crwdne36877:0" + #: popups/pages/Settings/index.tsx msgid "Service Agreement" msgstr "crwdns30538:0crwdne30538:0" @@ -2397,9 +2618,9 @@ msgstr "crwdns29756:0crwdne29756:0" msgid "Settings" msgstr "crwdns30544:0crwdne30544:0" -#: content-script/components/CompositionDialog/EncryptionTargetSelector.tsx -#: content-script/components/InjectedComponents/SelectPeopleDialog.tsx #: content-script/components/shared/SelectRecipients/SelectRecipientsDialog.tsx +#: content-script/components/InjectedComponents/SelectPeopleDialog.tsx +#: content-script/components/CompositionDialog/EncryptionTargetSelector.tsx msgid "Share with" msgstr "crwdns30546:0crwdne30546:0" @@ -2411,15 +2632,15 @@ msgstr "crwdns30548:0crwdne30548:0" msgid "Show tokens with value less than $1" msgstr "crwdns30550:0crwdne30550:0" -#: popups/pages/Personas/ConnectWallet/index.tsx -#: popups/pages/Personas/PersonaSignRequest/index.tsx #: popups/pages/Wallet/Interaction/WalletSignRequest.tsx +#: popups/pages/Personas/PersonaSignRequest/index.tsx +#: popups/pages/Personas/ConnectWallet/index.tsx msgid "Sign" msgstr "crwdns30552:0crwdne30552:0" #: dashboard/pages/SetupPersona/Recovery/index.tsx -msgid "Sign Up" -msgstr "crwdns29758:0crwdne29758:0" +#~ msgid "Sign Up" +#~ msgstr "" #: popups/components/SignRequestInfo/index.tsx msgid "Sign-in Request" @@ -2462,8 +2683,8 @@ msgstr "crwdns29760:0crwdne29760:0" msgid "Slippage" msgstr "crwdns35410:0crwdne35410:0" -#: popups/pages/Personas/AccountDetail/index.tsx #: popups/pages/Personas/Home/UI.tsx +#: popups/pages/Personas/AccountDetail/index.tsx msgid "Social Account" msgstr "crwdns30568:0crwdne30568:0" @@ -2471,14 +2692,14 @@ msgstr "crwdns30568:0crwdne30568:0" msgid "Sorry, signature failed! Please try signing again." msgstr "crwdns30570:0crwdne30570:0" -#: popups/modals/GasSettingModal/index.tsx #: popups/pages/Wallet/components/ActivityList/ActivityItem.tsx #: popups/pages/Wallet/TransactionDetail/index.tsx +#: popups/modals/GasSettingModal/index.tsx msgid "Speed Up" msgstr "crwdns30572:0crwdne30572:0" -#: popups/components/UnlockERC20Token/index.tsx #: popups/components/UnlockERC721Token/index.tsx +#: popups/components/UnlockERC20Token/index.tsx msgid "Spend limit requested by" msgstr "crwdns30574:0crwdne30574:0" @@ -2510,8 +2731,8 @@ msgstr "crwdns29766:0crwdne29766:0" msgid "Step 1/3" msgstr "crwdns29768:0crwdne29768:0" -#: dashboard/pages/CreateMaskWallet/AddDeriveWallet/index.tsx #: dashboard/pages/SetupPersona/Mnemonic/index.tsx +#: dashboard/pages/CreateMaskWallet/AddDeriveWallet/index.tsx msgid "Step 2/2" msgstr "crwdns29770:0crwdne29770:0" @@ -2536,18 +2757,19 @@ msgstr "crwdns30592:0crwdne30592:0" msgid "Support mnemonic phrase, private key or keystore file." msgstr "crwdns32140:0crwdne32140:0" -#: popups/modals/SupportedSitesModal/index.tsx #: popups/pages/Settings/index.tsx +#: popups/modals/SupportedSitesModal/index.tsx msgid "Supported Sites" msgstr "crwdns30596:0crwdne30596:0" -#: popups/pages/Trader/Header.tsx #: popups/pages/Wallet/components/ActionGroup/index.tsx +#: popups/pages/Trader/Header.tsx msgid "Swap" msgstr "crwdns35412:0crwdne35412:0" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx msgid "Switch other account" msgstr "crwdns29776:0crwdne29776:0" @@ -2555,7 +2777,7 @@ msgstr "crwdns29776:0crwdne29776:0" msgid "Switch Persona" msgstr "crwdns30600:0crwdne30600:0" -#: dashboard/components/Restore/RestoreFromCloud/ConfirmBackupInfo.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/ConfirmBackupInfo.tsx msgid "Switch to other accounts" msgstr "crwdns32142:0crwdne32142:0" @@ -2584,16 +2806,24 @@ msgstr "crwdns32146:0crwdne32146:0" msgid "The chainID is not equal to the currently connected one." msgstr "crwdns30606:0crwdne30606:0" +#: dashboard/pages/SetupPersona/CloudBackup/index.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts +#: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx #: dashboard/contexts/CloudBackupFormContext.tsx -#: dashboard/pages/SetupPersona/CloudBackup/index.tsx msgid "The code is incorrect." msgstr "crwdns29780:0crwdne29780:0" -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +#: dashboard/utils/api.ts msgid "The download link is expired" msgstr "crwdns32148:0crwdne32148:0" +#: dashboard/pages/SetupPersona/Recovery/Cloud/MaskNetwork.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx +msgid "The Mask Network Cloud Backup feature will be deactivated on April 30, 2025. Please use alternative cloud backup services or local backup solutions." +msgstr "crwdns37252:0crwdne37252:0" + #: dashboard/pages/CreateMaskWallet/CreateMnemonic/index.tsx msgid "The mnemonic word has been copied, please keep it in a safe place." msgstr "crwdns32150:0crwdne32150:0" @@ -2603,13 +2833,19 @@ msgid "The mnemonic words has been copied, please keep it in a safe place." msgstr "crwdns32152:0crwdne32152:0" #: popups/pages/Wallet/EditNetwork/useWarnings.ts -msgid "The network with chain ID {formChainId} may use a different currency symbol ({0}) than the one you have entered. Please check." -msgstr "crwdns32154:0{formChainId}crwdnd32154:0{0}crwdne32154:0" +#~ msgid "The network with chain ID {formChainId} may use a different currency symbol ({0}) than the one you have entered. Please check." +#~ msgstr "" + +#. placeholder {1}: match.nativeCurrency.symbol +#: popups/pages/Wallet/EditNetwork/useWarnings.ts +msgid "The network with chain ID {formChainId} may use a different currency symbol ({1}) than the one you have entered. Please check." +msgstr "crwdns36382:0{formChainId}crwdnd36382:0{1}crwdne36382:0" #: popups/modals/ChangePaymentPasswordModal/index.tsx msgid "The new passwords don't match" msgstr "crwdns30610:0crwdne30610:0" +#. placeholder {0}: profile.identifier.userId #: content-script/components/shared/SelectRecipients/ProfileInList.tsx msgid "The Persona is connected to the account @${0}." msgstr "crwdns32818:0${0}crwdne32818:0" @@ -2626,6 +2862,7 @@ msgstr "crwdns32822:0crwdne32822:0" msgid "The persona name already exists." msgstr "crwdns30612:0crwdne30612:0" +#: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx msgid "The phone number is incorrect." msgstr "crwdns29784:0crwdne29784:0" @@ -2634,10 +2871,12 @@ msgstr "crwdns29784:0crwdne29784:0" msgid "The RPC URL you have entered returned a different chain ID ({rpcChainId}). Please update the Chain ID to match the RPC URL of the network you are trying to add." msgstr "crwdns32156:0{rpcChainId}crwdne32156:0" +#. placeholder {0}: format(localTransaction.updatedAt, "HH:mm 'on' M/dd/yyyy") #: popups/pages/Wallet/TransactionDetail/useTransactionLogs.ts msgid "The transaction was complete and has been recorded on blockchain at {0}" msgstr "crwdns30616:0{0}crwdne30616:0" +#. placeholder {0}: format(localTransaction.createdAt, "HH:mm 'on' M/dd/yyyy") #: popups/pages/Wallet/TransactionDetail/useTransactionLogs.ts msgid "The transaction was confirmed at {0}" msgstr "crwdns30618:0{0}crwdne30618:0" @@ -2650,9 +2889,9 @@ msgstr "crwdns32158:0crwdne32158:0" msgid "The wallet address already exists." msgstr "crwdns30620:0crwdne30620:0" -#: popups/modals/AddContactModal/index.tsx -#: popups/modals/EditContactModal/index.tsx #: popups/modals/WalletRenameModal/index.tsx +#: popups/modals/EditContactModal/index.tsx +#: popups/modals/AddContactModal/index.tsx msgid "The wallet name already exists." msgstr "crwdns30622:0crwdne30622:0" @@ -2660,6 +2899,7 @@ msgstr "crwdns30622:0crwdne30622:0" msgid "The web site can" msgstr "crwdns30624:0crwdne30624:0" +#. placeholder {0}: message.domain #: popups/components/SignRequestInfo/index.tsx msgid "The website ({messageOrigin}) is asking you to sign in to another domain ({0}). This may be a phishing attack." msgstr "crwdns30626:0{messageOrigin}crwdnd30626:0{0}crwdne30626:0" @@ -2676,6 +2916,7 @@ msgstr "crwdns30630:0crwdne30630:0" msgid "This address may be a scam address." msgstr "crwdns30632:0crwdne30632:0" +#. placeholder {0}: String(token?.symbol) #: popups/components/UnlockERC20Token/index.tsx msgid "This allows the third party to spend {value} {0} from your current balance." msgstr "crwdns30634:0{value}crwdnd30634:0{0}crwdne30634:0" @@ -2685,16 +2926,25 @@ msgid "This allows the third party to spend all your token balance until it reac msgstr "crwdns30636:0crwdne30636:0" #: popups/pages/Wallet/EditNetwork/useWarnings.ts -msgid "This Chain ID is currently used by the {0} network." -msgstr "crwdns30638:0{0}crwdne30638:0" +#~ msgid "This Chain ID is currently used by the {0} network." +#~ msgstr "" + +#. placeholder {0}: duplicated.name +#: popups/pages/Wallet/EditNetwork/useWarnings.ts +msgid "This Chain ID is currently used by the {0} network. " +msgstr "crwdns36384:0{0}crwdne36384:0" #: popups/hooks/useContactsContext.ts msgid "This ENS does not exist or not be resolved." msgstr "crwdns30640:0crwdne30640:0" #: popups/pages/Personas/ExportPrivateKey/index.tsx -msgid "This export is only for exporting private key. We do not export any other data. If you need more data, please go to Settings: <0>Global Backup " -msgstr "crwdns32824:0crwdne32824:0" +msgid "This export is only for exporting private key. We do not export any other data. If you need more data, please go to Settings: <0> Global Backup " +msgstr "crwdns36386:0crwdne36386:0" + +#: popups/pages/Personas/ExportPrivateKey/index.tsx +#~ msgid "This export is only for exporting private key. We do not export any other data. If you need more data, please go to Settings: <0>Global Backup " +#~ msgstr "" #: popups/pages/Wallet/ExportPrivateKey/index.tsx msgid "This JSON file is encrypted with your current payment password. The same password is required for decryption when importing this wallet." @@ -2728,6 +2978,7 @@ msgstr "crwdns30650:0crwdne30650:0" msgid "This request should only be sign in the future." msgstr "crwdns30652:0crwdne30652:0" +#. placeholder {0}: network.name #: popups/pages/Wallet/EditNetwork/network-schema.ts #: popups/pages/Wallet/EditNetwork/network-schema.ts msgid "This RPC URL is currently used by the {0} network" @@ -2737,6 +2988,7 @@ msgstr "crwdns30654:0{0}crwdne30654:0" msgid "This tweet is encrypted with #mask_io (@realMaskNetwork). 📪🔑" msgstr "crwdns35462:0crwdne35462:0" +#. placeholder {0}: String(currentPersona?.nickname) #: popups/pages/Personas/ConnectWallet/index.tsx msgid "This wallet is connected to current persona {0}." msgstr "crwdns30656:0{0}crwdne30656:0" @@ -2745,11 +2997,13 @@ msgstr "crwdns30656:0{0}crwdne30656:0" msgid "This will overwrite the existing cloud backup with the local data, this cannot be undo." msgstr "crwdns32164:0crwdne32164:0" -#: popups/components/AddContactInputPanel/index.tsx #: popups/pages/Wallet/TransactionDetail/index.tsx +#: popups/components/AddContactInputPanel/index.tsx msgid "To" msgstr "crwdns30658:0crwdne30658:0" +#. placeholder {0}: formatDomainName(domain) +#. placeholder {0}: formatEthereumAddress(toAddress, 4) #: popups/pages/Wallet/components/ActivityList/ActivityItem.tsx #: popups/pages/Wallet/components/ActivityList/ActivityItem.tsx msgid "to {0}" @@ -2784,9 +3038,9 @@ msgstr "crwdns32170:0crwdne32170:0" msgid "Token Value" msgstr "crwdns30666:0crwdne30666:0" -#: popups/pages/Wallet/AddToken/index.tsx #: popups/pages/Wallet/components/WalletAssets/index.tsx #: popups/pages/Wallet/Transfer/index.tsx +#: popups/pages/Wallet/AddToken/index.tsx msgid "Tokens" msgstr "crwdns30668:0crwdne30668:0" @@ -2810,12 +3064,16 @@ msgstr "crwdns30672:0crwdne30672:0" msgid "Try" msgstr "crwdns30674:0crwdne30674:0" +#: content-script/components/InjectedComponents/SetupGuide/AccountConnectStatus.tsx +msgid "Trying exploring more features powered by Mask Network." +msgstr "crwdns36879:0crwdne36879:0" + #: popups/modals/ChangeBackupPasswordModal/index.tsx msgid "Two entered passwords are different." msgstr "crwdns32172:0crwdne32172:0" -#: popups/modals/SetBackupPasswordModal/index.tsx #: popups/pages/Wallet/hooks/usePasswordForm.ts +#: popups/modals/SetBackupPasswordModal/index.tsx msgid "Two entered passwords are not the same." msgstr "crwdns32174:0crwdne32174:0" @@ -2827,13 +3085,13 @@ msgstr "crwdns30678:0crwdne30678:0" msgid "Unlock" msgstr "crwdns30680:0crwdne30680:0" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx #: dashboard/components/Restore/RestoreWalletFromLocal.tsx msgid "Unpacking" msgstr "crwdns29794:0crwdne29794:0" -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx -#: dashboard/components/Restore/RestorePersonaFromLocal.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx +#: dashboard/pages/SetupPersona/Recovery/Local.tsx msgid "Unsupported data backup" msgstr "crwdns29796:0crwdne29796:0" @@ -2881,16 +3139,18 @@ msgstr "crwdns30690:0crwdne30690:0" msgid "value" msgstr "crwdns30692:0crwdne30692:0" -#: dashboard/components/Restore/RestoreFromCloud/EmailField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx msgid "Verification code has been sent to your email. Please check your mailbox." msgstr "crwdns32180:0crwdne32180:0" -#: dashboard/components/Restore/RestoreFromCloud/PhoneField.tsx +#: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx msgid "Verification code has been sent to your phone." msgstr "crwdns32182:0crwdne32182:0" -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx +#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Verification code sent" msgstr "crwdns29808:0crwdne29808:0" @@ -2904,8 +3164,8 @@ msgstr "crwdns29812:0crwdne29812:0" msgid "Verify Account" msgstr "crwdns30694:0crwdne30694:0" -#: popups/components/SignRequestInfo/index.tsx #: popups/pages/Settings/index.tsx +#: popups/components/SignRequestInfo/index.tsx msgid "Version" msgstr "crwdns30696:0crwdne30696:0" @@ -2915,10 +3175,10 @@ msgstr "crwdns30698:0crwdne30698:0" #: content-script/components/InjectedComponents/ProfileCard/ProfileBar.tsx #: content-script/components/InjectedComponents/ProfileCard/ProfileBar.tsx -#: popups/pages/Personas/ConnectWallet/index.tsx +#: popups/pages/Wallet/TransactionDetail/index.tsx #: popups/pages/Wallet/ChangeOwner/index.tsx #: popups/pages/Wallet/ChangeOwner/index.tsx -#: popups/pages/Wallet/TransactionDetail/index.tsx +#: popups/pages/Personas/ConnectWallet/index.tsx msgid "View on Explorer" msgstr "crwdns30700:0crwdne30700:0" @@ -2943,11 +3203,11 @@ msgid "Waiting for {providerType}" msgstr "crwdns32190:0{providerType}crwdne32190:0" #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "wallet" -msgstr "crwdns29814:0crwdne29814:0" +#~ msgid "wallet" +#~ msgstr "" -#: popups/modals/WalletGroupModal/index.tsx #: popups/pages/Wallet/SwitchWallet/index.tsx +#: popups/modals/WalletGroupModal/index.tsx msgid "Wallet Account" msgstr "crwdns30706:0crwdne30706:0" @@ -2955,8 +3215,9 @@ msgstr "crwdns30706:0crwdne30706:0" msgid "Wallet disconnected" msgstr "crwdns32192:0crwdne32192:0" -#: popups/modals/WalletGroupModal/index.tsx +#. placeholder {0}: String(index + 1) #: popups/pages/Wallet/CreateWallet/index.tsx +#: popups/modals/WalletGroupModal/index.tsx msgid "Wallet Group #{0}" msgstr "crwdns30712:0#{0}crwdne30712:0" @@ -2973,8 +3234,8 @@ msgstr "crwdns30716:0crwdne30716:0" msgid "Wallet request timed out" msgstr "crwdns30718:0crwdne30718:0" -#: popups/pages/Wallet/SwitchWallet/index.tsx #: popups/pages/Wallet/WalletSettings/index.tsx +#: popups/pages/Wallet/SwitchWallet/index.tsx msgid "Wallet Settings" msgstr "crwdns30720:0crwdne30720:0" @@ -2990,8 +3251,8 @@ msgstr "crwdns32194:0crwdne32194:0" msgid "Web3 Profile Card" msgstr "crwdns30726:0crwdne30726:0" -#: popups/pages/Settings/index.tsx #: popups/pages/Wallet/components/OriginCard/index.tsx +#: popups/pages/Settings/index.tsx msgid "Website" msgstr "crwdns30728:0crwdne30728:0" @@ -3000,8 +3261,8 @@ msgid "Welcome Back" msgstr "crwdns30730:0crwdne30730:0" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -msgid "Welcome to Mask Cloud Services" -msgstr "crwdns29820:0crwdne29820:0" +#~ msgid "Welcome to Mask Cloud Services" +#~ msgstr "" #: popups/pages/Personas/Home/UI.tsx msgid "Welcome to Mask Network" @@ -3011,6 +3272,10 @@ msgstr "crwdns30732:0crwdne30732:0" msgid "Welcome to use Mask Network" msgstr "crwdns29822:0crwdne29822:0" +#: dashboard/components/GoogleDriveLogin.tsx +msgid "when you click Add Google Drive button,you will be forwarded to Google authorization pages." +msgstr "crwdns37254:0crwdne37254:0" + #: popups/pages/Wallet/ExportPrivateKey/index.tsx msgid "Write down mnemonic words" msgstr "crwdns30734:0crwdne30734:0" @@ -3019,18 +3284,30 @@ msgstr "crwdns30734:0crwdne30734:0" msgid "Write down recovery phrase" msgstr "crwdns32196:0crwdne32196:0" +#: content-script/components/InjectedComponents/SetupGuide/AccountConnectStatus.tsx +msgid "You could check the verification result on Mask Pop-up after few minutes. If failed, try sending verification post again." +msgstr "crwdns36881:0crwdne36881:0" + #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx -msgid "You have backed up your data." -msgstr "crwdns32198:0crwdne32198:0" +#~ msgid "You have backed up your data." +#~ msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx -msgid "You have recovered" -msgstr "crwdns32830:0crwdne32830:0" +#~ msgid "You have recovered" +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +#~ msgid "You have recovered " +#~ msgstr "" #: popups/pages/Personas/ConnectWallet/index.tsx msgid "You have signed with your wallet." msgstr "crwdns32200:0crwdne32200:0" +#: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +msgid "You have successfully restored the backup from Google Drive to your browser." +msgstr "crwdns37274:0crwdne37274:0" + #: dashboard/components/Restore/ConfirmSynchronizePasswordDialog.tsx msgid "You have verified your cloud password and recovered your backup. Do you want to let your cloud password and local backup password be the same?" msgstr "crwdns32202:0crwdne32202:0" @@ -3039,6 +3316,7 @@ msgstr "crwdns32202:0crwdne32202:0" msgid "You need to open the dApp to view the specific content." msgstr "crwdns32204:0crwdne32204:0" +#. placeholder {0}: user.email #: dashboard/pages/SetupPersona/CloudBackup/index.tsx #: dashboard/pages/SetupPersona/CloudBackup/index.tsx msgid "You used <0>{0} for the last cloud backup." @@ -3048,15 +3326,40 @@ msgstr "crwdns32832:0{0}crwdne32832:0" msgid "Your connection to this site is not encrypted which can be modified by a hostile third party, we strongly suggest you reject this request." msgstr "crwdns30740:0crwdne30740:0" +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +msgid "Your file has been successfully merged into the browser data." +msgstr "crwdns37256:0crwdne37256:0" + +#: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +msgid "Your file has been successfully restore into the browser data." +msgstr "crwdns37276:0crwdne37276:0" + #: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx msgid "Your payment password encrypts wallet data and is needed to unlocking the wallet, transaction confirmations and signing. The password is never stored, and there is no way to recover it if you forget it." msgstr "crwdns32206:0crwdne32206:0" #: dashboard/pages/SetupPersona/Onboarding/index.tsx -msgid "Your Persona is on" -msgstr "crwdns32834:0crwdne32834:0" +#~ msgid "Your Persona is on" +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +#~ msgid "Your Persona is on " +#~ msgstr "" + +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +msgid "Your Persona is on **ready 🚀**" +msgstr "crwdns37288:0crwdne37288:0" + +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +#~ msgid "Your Wallet is on" +#~ msgstr "" + +#: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx +#~ msgid "Your Wallet is on " +#~ msgstr "" #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx -msgid "Your Wallet is on" -msgstr "crwdns29836:0crwdne29836:0" +msgid "Your Wallet is on **ready 🚀**" +msgstr "crwdns37290:0crwdne37290:0" diff --git a/packages/mask/shared-ui/locale/zh-CN.json b/packages/mask/shared-ui/locale/zh-CN.json index 8fae14ec954b..34fd5d26de54 100644 --- a/packages/mask/shared-ui/locale/zh-CN.json +++ b/packages/mask/shared-ui/locale/zh-CN.json @@ -64,7 +64,7 @@ "pv5v6j": ["About Permit"], "k0USDt": ["Account connected.<0/><1/>Try to explore more features powered by Mask Network."], "R2K7XH": ["尝试探索社交媒体上的 Web3 dApps 功能。"], - "6c6xyD": ["账户"], + "6c6xyD": ["accounts"], "39ohdf": ["活动"], "I5kL4f": ["活动日志"], "m16xKo": ["添加"], @@ -114,7 +114,7 @@ "V+1pjj": ["Back Up Your Data Your Way"], "rLgPvm": ["备份"], "h7+V7K": ["备份恢复"], - "QrHM/A": ["备份下载并成功合并到本地。"], + "QrHM/A": ["Backup downloaded and merged to local successfully."], "zp7Ha3": ["备份失败"], "5Cowlg": ["Backup is saved to Mask Cloud Service."], "qZ6p7p": ["Backup on ", ["0"]], @@ -124,7 +124,7 @@ "hUF4dG": ["备份密码设置成功。"], "UtKGok": ["备份身份"], "+m7x4e": ["Backup Successful"], - "7Ry254": ["备份到 Mask 云服务"], + "7Ry254": ["Backup to Mask Cloud Service"], "6IHgRq": ["Backup to the Cloud"], "QQPCqQ": ["备份钱包"], "fsBGk0": ["余额"], @@ -225,7 +225,7 @@ ], "8Tg/JR": ["自定义"], "pvnfJD": ["深色"], - "Sp/me1": ["数据"], + "Sp/me1": ["data"], "HKH+W+": ["数据"], "K8jCIB": ["Data backed up successfully!"], "3B4jmY": ["数据关联"], @@ -265,7 +265,7 @@ "XZ/B+f": ["找不到您的NFT?"], "DPfwMq": ["完成"], "mzI/c+": ["下载"], - "1vSYsG": ["下载备份"], + "1vSYsG": ["Download backup"], "1+6BOG": ["下载备份"], "9hg9mc": ["正在下载"], "F8Wc3I": ["将您的文件拖放到此处"], @@ -365,7 +365,7 @@ "yx/fMc": ["高速"], "0caMy7": ["History"], "uip9JY": ["I wrote down those words in the correct order"], - "b5d759": ["身份"], + "b5d759": ["identity"], "RRw7LE": ["身份助记词"], "/WfDJy": [ "If you forget payment password, you can type 'RESET' to reset your wallet. <0>Remember, this action will erase all your previous wallets." @@ -453,7 +453,7 @@ "lPsa94": ["Merge Completed"], "RH8jSA": ["合并数据到本地数据库"], "E6YUtc": ["Merge to Browser"], - "QTomF0": ["合并至本地数据"], + "QTomF0": ["Merge to local"], "xDAtGP": ["信息"], "pGElS5": ["助记词"], "yFrxQj": ["助记词"], @@ -577,7 +577,7 @@ "3AP6p1": ["Public Key: <0>", ["publicKey"], ""], "82+n6o": ["Quote Route"], "AV+9wg": ["重新输入"], - "TZ0npN": ["准备🚀"], + "TZ0npN": ["ready 🚀"], "nVT2pJ": ["realMaskNetwork"], "lDgVWA": ["接收"], "OkofjH": ["Recover"], @@ -641,7 +641,7 @@ "iJLEZF": ["教我怎么做"], "nOCyT5": ["显示价值小于$1 的代币"], "c+Fnce": ["签名"], - "mErq7F": ["注册"], + "mErq7F": ["Sign Up"], "t3rUZr": ["Sign-in Request"], "py6hU8": ["签名请求"], "9KKhJV": ["正在签名..."], @@ -805,7 +805,7 @@ "vVEene": ["View your Tokens and NFTs"], "kbfp5m": ["可见范围"], "PTXNyo": ["Waiting for ", ["providerType"]], - "6XyieG": ["钱包"], + "6XyieG": ["wallet"], "VECuJk": ["钱包账户"], "KtMMzG": ["Wallet disconnected"], "Kl9gHp": ["钱包组 #", ["0"]], @@ -820,7 +820,7 @@ "EGWr+Q": ["Web3 名片"], "On0aF2": ["网站"], "CWsYB3": ["欢迎回来"], - "m74yjp": ["欢迎使用 Mask 云服务"], + "m74yjp": ["Welcome to Mask Cloud Services"], "hEpXzO": ["欢迎来到 Mask Network!"], "fFYJ8f": ["欢迎来到 Mask Network!"], "OLUEnY": ["when you click Add Google Drive button,you will be forwarded to Google authorization pages."], diff --git a/packages/mask/shared-ui/locale/zh-CN.po b/packages/mask/shared-ui/locale/zh-CN.po index f603e9176efc..85960d50620e 100644 --- a/packages/mask/shared-ui/locale/zh-CN.po +++ b/packages/mask/shared-ui/locale/zh-CN.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: mask-network\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2025-01-08 06:53\n" +"PO-Revision-Date: 2025-04-03 11:04\n" "Last-Translator: \n" "Language: zh_CN\n" "Language-Team: Chinese Simplified\n" @@ -137,7 +137,7 @@ msgstr "尝试探索社交媒体上的 Web3 dApps 功能。" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx #~ msgid "accounts" -#~ msgstr "账户" +#~ msgstr "" #: popups/pages/Wallet/components/WalletAssets/index.tsx msgid "Activities" @@ -347,7 +347,7 @@ msgstr "备份恢复" #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #~ msgid "Backup downloaded and merged to local successfully." -#~ msgstr "备份下载并成功合并到本地。" +#~ msgstr "" #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx msgid "Backup Failed" @@ -400,7 +400,7 @@ msgstr "" #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #~ msgid "Backup to Mask Cloud Service" -#~ msgstr "备份到 Mask 云服务" +#~ msgstr "" #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx msgid "Backup to the Cloud" @@ -877,7 +877,7 @@ msgstr "深色" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx #~ msgid "data" -#~ msgstr "数据" +#~ msgstr "" #: popups/pages/Wallet/Interaction/TransactionRequest.tsx msgid "Data" @@ -1008,7 +1008,7 @@ msgstr "下载" #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #~ msgid "Download backup" -#~ msgstr "下载备份" +#~ msgstr "" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx @@ -1439,7 +1439,7 @@ msgstr "" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #~ msgid "identity" -#~ msgstr "身份" +#~ msgstr "" #: dashboard/pages/SetupPersona/Mnemonic/ComponentToPrint.tsx msgid "Identity ID" @@ -1831,7 +1831,7 @@ msgstr "" #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #~ msgid "Merge to local" -#~ msgstr "合并至本地数据" +#~ msgstr "" #: popups/components/SignRequestInfo/index.tsx msgid "Message" @@ -2350,7 +2350,7 @@ msgstr "重新输入" #: dashboard/pages/SetupPersona/Onboarding/index.tsx #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx #~ msgid "ready 🚀" -#~ msgstr "准备🚀" +#~ msgstr "" #: content-script/components/CompositionDialog/useSubmit.ts msgid "realMaskNetwork" @@ -2640,7 +2640,7 @@ msgstr "签名" #: dashboard/pages/SetupPersona/Recovery/index.tsx #~ msgid "Sign Up" -#~ msgstr "注册" +#~ msgstr "" #: popups/components/SignRequestInfo/index.tsx msgid "Sign-in Request" @@ -3204,7 +3204,7 @@ msgstr "" #: dashboard/pages/CreateMaskWallet/Onboarding/index.tsx #~ msgid "wallet" -#~ msgstr "钱包" +#~ msgstr "" #: popups/pages/Wallet/SwitchWallet/index.tsx #: popups/modals/WalletGroupModal/index.tsx @@ -3262,7 +3262,7 @@ msgstr "欢迎回来" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #~ msgid "Welcome to Mask Cloud Services" -#~ msgstr "欢迎使用 Mask 云服务" +#~ msgstr "" #: popups/pages/Personas/Home/UI.tsx msgid "Welcome to Mask Network" diff --git a/packages/mask/shared-ui/locale/zh-TW.json b/packages/mask/shared-ui/locale/zh-TW.json index e503d0544eb7..6f2fc5fb6ded 100644 --- a/packages/mask/shared-ui/locale/zh-TW.json +++ b/packages/mask/shared-ui/locale/zh-TW.json @@ -64,7 +64,7 @@ "pv5v6j": ["About Permit"], "k0USDt": ["Account connected.<0/><1/>Try to explore more features powered by Mask Network."], "R2K7XH": ["尝试探索社交媒体上的 Web3 dApps 功能。"], - "6c6xyD": ["账户"], + "6c6xyD": ["accounts"], "39ohdf": ["活动"], "I5kL4f": ["活动日志"], "m16xKo": ["添加"], @@ -114,7 +114,7 @@ "V+1pjj": ["Back Up Your Data Your Way"], "rLgPvm": ["备份"], "h7+V7K": ["备份恢复"], - "QrHM/A": ["备份下载并成功合并到本地。"], + "QrHM/A": ["Backup downloaded and merged to local successfully."], "zp7Ha3": ["備份失敗"], "5Cowlg": ["Backup is saved to Mask Cloud Service."], "qZ6p7p": ["Backup on ", ["0"]], @@ -124,7 +124,7 @@ "hUF4dG": ["备份密码设置成功。"], "UtKGok": ["备份身份"], "+m7x4e": ["Backup Successful"], - "7Ry254": ["备份到 Mask 云服务"], + "7Ry254": ["Backup to Mask Cloud Service"], "6IHgRq": ["Backup to the Cloud"], "QQPCqQ": ["备份钱包"], "fsBGk0": ["余额"], @@ -225,7 +225,7 @@ ], "8Tg/JR": ["自定义"], "pvnfJD": ["深色"], - "Sp/me1": ["数据"], + "Sp/me1": ["data"], "HKH+W+": ["数据"], "K8jCIB": ["Data backed up successfully!"], "3B4jmY": ["数据关联"], @@ -265,7 +265,7 @@ "XZ/B+f": ["找不到您的NFT?"], "DPfwMq": ["完成!"], "mzI/c+": ["下載"], - "1vSYsG": ["下载备份"], + "1vSYsG": ["Download backup"], "1+6BOG": ["下载备份"], "9hg9mc": ["正在下载"], "F8Wc3I": ["将您的文件拖放到此处"], @@ -365,7 +365,7 @@ "yx/fMc": ["高速"], "0caMy7": ["History"], "uip9JY": ["I wrote down those words in the correct order"], - "b5d759": ["身份"], + "b5d759": ["identity"], "RRw7LE": ["身份助记词"], "/WfDJy": [ "If you forget payment password, you can type 'RESET' to reset your wallet. <0>Remember, this action will erase all your previous wallets." @@ -453,7 +453,7 @@ "lPsa94": ["Merge Completed"], "RH8jSA": ["合并数据到本地数据库"], "E6YUtc": ["Merge to Browser"], - "QTomF0": ["合并至本地数据"], + "QTomF0": ["Merge to local"], "xDAtGP": ["信息"], "pGElS5": ["助记词"], "yFrxQj": ["助记词"], @@ -577,7 +577,7 @@ "3AP6p1": ["Public Key: <0>", ["publicKey"], ""], "82+n6o": ["Quote Route"], "AV+9wg": ["重新输入"], - "TZ0npN": ["准备🚀"], + "TZ0npN": ["ready 🚀"], "nVT2pJ": ["realMaskNetwork"], "lDgVWA": ["接收"], "OkofjH": ["Recover"], @@ -641,7 +641,7 @@ "iJLEZF": ["告訴我怎麼做"], "nOCyT5": ["显示价值小于$1 的代币"], "c+Fnce": ["簽署"], - "mErq7F": ["注册"], + "mErq7F": ["Sign Up"], "t3rUZr": ["Sign-in Request"], "py6hU8": ["签名请求"], "9KKhJV": ["正在签名..."], @@ -805,7 +805,7 @@ "vVEene": ["View your Tokens and NFTs"], "kbfp5m": ["可见范围"], "PTXNyo": ["Waiting for ", ["providerType"]], - "6XyieG": ["钱包"], + "6XyieG": ["wallet"], "VECuJk": ["钱包账户"], "KtMMzG": ["Wallet disconnected"], "Kl9gHp": ["钱包组 #", ["0"]], @@ -820,7 +820,7 @@ "EGWr+Q": ["Web3 名片"], "On0aF2": ["网站"], "CWsYB3": ["欢迎回来"], - "m74yjp": ["欢迎使用 Mask 云服务"], + "m74yjp": ["Welcome to Mask Cloud Services"], "hEpXzO": ["欢迎来到 Mask Network!"], "fFYJ8f": ["欢迎来到 Mask Network!"], "OLUEnY": ["when you click Add Google Drive button,you will be forwarded to Google authorization pages."], diff --git a/packages/mask/shared-ui/locale/zh-TW.po b/packages/mask/shared-ui/locale/zh-TW.po index 3afe4afa771c..3748bde2aca6 100644 --- a/packages/mask/shared-ui/locale/zh-TW.po +++ b/packages/mask/shared-ui/locale/zh-TW.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: mask-network\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2025-01-08 06:53\n" +"PO-Revision-Date: 2025-04-03 11:04\n" "Last-Translator: \n" "Language: zh_TW\n" "Language-Team: Chinese Traditional\n" From 4fa32bb88c7b8b9f0016eb63e494647b11a8cdce Mon Sep 17 00:00:00 2001 From: Wukong Sun Date: Mon, 7 Apr 2025 11:55:19 +0800 Subject: [PATCH 06/20] fix: mf-6672 request identity permission (#12183) --- .../mask/background/services/backup/google_drive.ts | 10 +++++----- .../mask/dashboard/components/GoogleDriveLogin.tsx | 6 +++++- .../helpers/checkAndRequestIdentityPermission.ts | 10 ++++++++++ packages/mask/shared/helpers/index.ts | 1 + 4 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 packages/mask/shared/helpers/checkAndRequestIdentityPermission.ts diff --git a/packages/mask/background/services/backup/google_drive.ts b/packages/mask/background/services/backup/google_drive.ts index a5c2c0f32a59..67e50b4e3312 100644 --- a/packages/mask/background/services/backup/google_drive.ts +++ b/packages/mask/background/services/backup/google_drive.ts @@ -1,10 +1,10 @@ +import { checkAndRequestPermission } from '../../../shared/helpers/index.js' + /* eslint-disable @typescript-eslint/ban-ts-comment */ export async function getAccessToken(interactive = false) { - const contained = await browser.permissions.contains({ permissions: ['identity'] }) - if (!contained) { - const granted = await browser.permissions.request({ origins: ['identity'] }) - if (!granted) return - } + const granted = await checkAndRequestPermission() + if (!granted) return + return new Promise((resolve, reject) => { // @ts-expect-error chrome.identity.getAuthToken({ interactive }, (token, error) => { diff --git a/packages/mask/dashboard/components/GoogleDriveLogin.tsx b/packages/mask/dashboard/components/GoogleDriveLogin.tsx index b1a809451c01..9ed045f16eae 100644 --- a/packages/mask/dashboard/components/GoogleDriveLogin.tsx +++ b/packages/mask/dashboard/components/GoogleDriveLogin.tsx @@ -4,9 +4,10 @@ import { ActionButton, makeStyles, useCustomSnackbar } from '@masknet/theme' import { GoogleDriveClient } from '@masknet/web3-providers' import { Box, Typography } from '@mui/material' import { memo, useMemo } from 'react' +import { useAsyncFn } from 'react-use' import { UserContext } from '../../shared-ui/index.js' +import { checkAndRequestPermission } from '../../shared/helpers/index.js' import { clearGoogleDriveAccessToken, getGoogleDriveAccessToken } from '../utils/api.js' -import { useAsyncFn } from 'react-use' const useStyles = makeStyles()((theme) => ({ container: { @@ -38,6 +39,9 @@ export const GoogleDriveLogin = memo(function GoogleDriveLogin() { const [{ loading }, login] = useAsyncFn(async () => { try { + const granted = await checkAndRequestPermission() + if (!granted) return + const userInfo = await googleDriveClient.login(true) updateUser({ googleAccount: userInfo.email || '', diff --git a/packages/mask/shared/helpers/checkAndRequestIdentityPermission.ts b/packages/mask/shared/helpers/checkAndRequestIdentityPermission.ts new file mode 100644 index 000000000000..b3c4f2a45d0d --- /dev/null +++ b/packages/mask/shared/helpers/checkAndRequestIdentityPermission.ts @@ -0,0 +1,10 @@ +import type { Manifest } from 'webextension-polyfill' + +export async function checkAndRequestPermission() { + const contained = await browser.permissions.contains({ permissions: ['identity'] }) + if (!contained) { + const granted = await browser.permissions.request({ permissions: ['identity' as Manifest.OptionalPermission] }) + if (!granted) return + } + return true +} diff --git a/packages/mask/shared/helpers/index.ts b/packages/mask/shared/helpers/index.ts index 483d4de6435d..66661353b28d 100644 --- a/packages/mask/shared/helpers/index.ts +++ b/packages/mask/shared/helpers/index.ts @@ -1,2 +1,3 @@ export * from './download.js' export * from './formatTokenBalance.js' +export * from './checkAndRequestIdentityPermission.js' From e9278daa8d13d66295d67a103e8d38b6dd427945 Mon Sep 17 00:00:00 2001 From: Wukong Sun Date: Mon, 7 Apr 2025 14:05:22 +0800 Subject: [PATCH 07/20] chore: mf-6670 remove x2y2 (#12184) --- packages/icons/brands/X2Y2.svg | 13 -- packages/icons/icon-generated-as-jsx.js | 5 - packages/icons/icon-generated-as-url.js | 1 - .../src/SiteAdaptor/Shared/DetailsCard.tsx | 1 - .../plugins/Collectible/src/helpers/url.ts | 9 - packages/plugins/Collectible/tests/helpers.ts | 12 -- .../components/SourceProviderIcon/index.tsx | 1 - .../SourceProviderSwitcher/index.tsx | 2 +- .../web3-providers/src/Trending/constants.ts | 1 - .../src/Web3/EVM/apis/HubNonFungibleAPI.ts | 3 - packages/web3-providers/src/X2Y2/constants.ts | 2 - packages/web3-providers/src/X2Y2/index.ts | 181 ------------------ packages/web3-providers/src/X2Y2/types.ts | 53 ----- .../web3-shared/base/src/helpers/resolver.ts | 1 - packages/web3-shared/base/src/specs/index.ts | 1 - 15 files changed, 1 insertion(+), 285 deletions(-) delete mode 100644 packages/icons/brands/X2Y2.svg delete mode 100644 packages/web3-providers/src/X2Y2/constants.ts delete mode 100644 packages/web3-providers/src/X2Y2/index.ts delete mode 100644 packages/web3-providers/src/X2Y2/types.ts diff --git a/packages/icons/brands/X2Y2.svg b/packages/icons/brands/X2Y2.svg deleted file mode 100644 index fcf52da5940b..000000000000 --- a/packages/icons/brands/X2Y2.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/packages/icons/icon-generated-as-jsx.js b/packages/icons/icon-generated-as-jsx.js index e410ca933542..599689192651 100644 --- a/packages/icons/icon-generated-as-jsx.js +++ b/packages/icons/icon-generated-as-jsx.js @@ -638,11 +638,6 @@ export const WETH = /*#__PURE__*/ __createIcon('WETH', [ u: () => new URL('./brands/WETH.svg', import.meta.url).href, }, ]) -export const X2Y2 = /*#__PURE__*/ __createIcon('X2Y2', [ - { - u: () => new URL('./brands/X2Y2.svg', import.meta.url).href, - }, -]) export const XLog = /*#__PURE__*/ __createIcon('XLog', [ { u: () => new URL('./brands/XLog.svg', import.meta.url).href, diff --git a/packages/icons/icon-generated-as-url.js b/packages/icons/icon-generated-as-url.js index e6553edb637a..f44f406604e7 100644 --- a/packages/icons/icon-generated-as-url.js +++ b/packages/icons/icon-generated-as-url.js @@ -115,7 +115,6 @@ export function twitter_x_round_dark_url() { return new URL("./brands/TwitterXRo export function twitter_x_round_light_url() { return new URL("./brands/TwitterXRound.light.svg", import.meta.url).href } export function uniswap_url() { return new URL("./brands/Uniswap.svg", import.meta.url).href } export function weth_url() { return new URL("./brands/WETH.svg", import.meta.url).href } -export function x_2_y_2_url() { return new URL("./brands/X2Y2.svg", import.meta.url).href } export function x_log_dark_url() { return new URL("./brands/XLog.dark.svg", import.meta.url).href } export function x_log_url() { return new URL("./brands/XLog.svg", import.meta.url).href } export function you_tube_url() { return new URL("./brands/YouTube.svg", import.meta.url).href } diff --git a/packages/plugins/Collectible/src/SiteAdaptor/Shared/DetailsCard.tsx b/packages/plugins/Collectible/src/SiteAdaptor/Shared/DetailsCard.tsx index 6704c442184e..841da07d6fda 100644 --- a/packages/plugins/Collectible/src/SiteAdaptor/Shared/DetailsCard.tsx +++ b/packages/plugins/Collectible/src/SiteAdaptor/Shared/DetailsCard.tsx @@ -11,7 +11,6 @@ const PLATFORM_COSTS: { [k in SourceType]?: number } = { [SourceType.OpenSea]: 2.5, - [SourceType.X2Y2]: 0.5, [SourceType.LooksRare]: 2, } diff --git a/packages/plugins/Collectible/src/helpers/url.ts b/packages/plugins/Collectible/src/helpers/url.ts index 74a2078cef2e..5761abe073c6 100644 --- a/packages/plugins/Collectible/src/helpers/url.ts +++ b/packages/plugins/Collectible/src/helpers/url.ts @@ -93,15 +93,6 @@ const RULES = [ address: (matched: string) => matched.replace('zora', ZORA_COLLECTION_ADDRESS), }, - // x2y2 - { - hosts: ['x2y2.io'], - pathname: /^\/eth\/(0x[\dA-Fa-f]{40})\/(\d+)/, - pluginID: NetworkPluginID.PLUGIN_EVM, - chainId: ChainIdEVM.Mainnet, - provider: SourceType.X2Y2, - }, - // looksrare { hosts: ['looksrare.org'], diff --git a/packages/plugins/Collectible/tests/helpers.ts b/packages/plugins/Collectible/tests/helpers.ts index 150fdb8218b6..ae44b56a5817 100644 --- a/packages/plugins/Collectible/tests/helpers.ts +++ b/packages/plugins/Collectible/tests/helpers.ts @@ -85,18 +85,6 @@ describe('getPayloadFromURL', () => { }, }, - // x2y2 - { - give: 'https://x2y2.io/eth/0x6d19568A959FCB4211852F6472d3df7b67C6Cd54/332', - expected: { - pluginID: NetworkPluginID.PLUGIN_EVM, - chainId: ChainIdEVM.Mainnet, - address: '0x6d19568A959FCB4211852F6472d3df7b67C6Cd54', - tokenId: '332', - provider: SourceType.X2Y2, - }, - }, - // loosrare { give: 'https://looksrare.org/collections/0x60E4d786628Fea6478F785A6d7e704777c86a7c6/28850', diff --git a/packages/shared/src/UI/components/SourceProviderIcon/index.tsx b/packages/shared/src/UI/components/SourceProviderIcon/index.tsx index e39a1165af71..14bb4fcde767 100644 --- a/packages/shared/src/UI/components/SourceProviderIcon/index.tsx +++ b/packages/shared/src/UI/components/SourceProviderIcon/index.tsx @@ -13,7 +13,6 @@ const IconMap: Partial> = { [SourceType.CoinGecko]: Icons.CoinGecko, [SourceType.Uniswap]: Icons.Uniswap, [SourceType.LooksRare]: Icons.LooksRare, - [SourceType.X2Y2]: Icons.X2Y2, [SourceType.SimpleHash]: Icons.SimpleHash, } diff --git a/packages/shared/src/UI/components/SourceProviderSwitcher/index.tsx b/packages/shared/src/UI/components/SourceProviderSwitcher/index.tsx index a85c8b52d4ff..06cfa8cf8513 100644 --- a/packages/shared/src/UI/components/SourceProviderSwitcher/index.tsx +++ b/packages/shared/src/UI/components/SourceProviderSwitcher/index.tsx @@ -4,7 +4,7 @@ import { SourceType } from '@masknet/web3-shared-base' import { Stack } from '@mui/material' import { SourceProviderIcon } from '../index.js' -const sourceList = [SourceType.LooksRare, SourceType.OpenSea, SourceType.Rarible, SourceType.X2Y2] +const sourceList = [SourceType.LooksRare, SourceType.OpenSea, SourceType.Rarible] interface SourceProviderSwitcherProps { // default is all diff --git a/packages/web3-providers/src/Trending/constants.ts b/packages/web3-providers/src/Trending/constants.ts index ee7f285ff41a..5ca1f6634ab4 100644 --- a/packages/web3-providers/src/Trending/constants.ts +++ b/packages/web3-providers/src/Trending/constants.ts @@ -71,7 +71,6 @@ export const CURRENCIES_MAP: Record { | TokenListAPI.Provider >( { - [SourceType.X2Y2]: X2Y2.X2Y2, [SourceType.Chainbase]: ChainbaseNonFungibleToken.ChainbaseNonFungibleToken, [SourceType.Zerion]: ZerionNonFungibleToken.ZerionNonFungibleToken, [SourceType.NFTScan]: NFTScanNonFungibleTokenEVM.NFTScanNonFungibleTokenEVM, @@ -41,7 +39,6 @@ export class HubNonFungibleAPI extends BaseHubNonFungible { [ SimpleHashEVM.SimpleHashEVM, NFTScanNonFungibleTokenEVM.NFTScanNonFungibleTokenEVM, - X2Y2.X2Y2, ZerionNonFungibleToken.ZerionNonFungibleToken, AlchemyEVM.AlchemyEVM, Zora.Zora, diff --git a/packages/web3-providers/src/X2Y2/constants.ts b/packages/web3-providers/src/X2Y2/constants.ts deleted file mode 100644 index d4bc382811ac..000000000000 --- a/packages/web3-providers/src/X2Y2/constants.ts +++ /dev/null @@ -1,2 +0,0 @@ -export const X2Y2_API_URL = 'https://x2y2-proxy.r2d2.to' -export const X2Y2_PAGE_SIZE = 20 diff --git a/packages/web3-providers/src/X2Y2/index.ts b/packages/web3-providers/src/X2Y2/index.ts deleted file mode 100644 index 8e1ff963ff4d..000000000000 --- a/packages/web3-providers/src/X2Y2/index.ts +++ /dev/null @@ -1,181 +0,0 @@ -import urlcat from 'urlcat' -import { first, last } from 'lodash-es' -import { - OrderSide, - type NonFungibleTokenOrder, - type NonFungibleTokenEvent, - type NonFungibleTokenContract, - SourceType, -} from '@masknet/web3-shared-base' -import { createPageable, createIndicator, createNextIndicator, EMPTY_LIST } from '@masknet/shared-base' -import { ChainId, createERC20Token, isZeroAddress, SchemaType } from '@masknet/web3-shared-evm' -import { EVMChainResolver } from '../Web3/EVM/apis/ResolverAPI.js' -import { X2Y2_API_URL, X2Y2_PAGE_SIZE } from './constants.js' -import type { Contract, Event, Order } from './types.js' -import { resolveActivityType } from '../helpers/resolveActivityType.js' -import { fetchSquashedJSON } from '../helpers/fetchJSON.js' -import type { BaseHubOptions, NonFungibleTokenAPI } from '../entry-types.js' - -async function fetchFromX2Y2(pathname: string) { - const response = await fetchSquashedJSON< - | { - success: boolean - next?: string - data?: T | null - } - | undefined - >(urlcat(X2Y2_API_URL, pathname)) - // The `undefined` can be given a default value when deconstructed, but `null` can't. - return response?.success ? ([response.data ?? undefined, response.next] as const) : EMPTY_LIST -} - -class X2Y2API implements NonFungibleTokenAPI.Provider { - createPermalink(address: string, tokenId: string) { - return urlcat('https://x2y2.io/eth/:contract/:tokenId', { - contract: address, - tokenId, - }) - } - createOrder(address: string, tokenId: string, order: Order): NonFungibleTokenOrder { - return { - id: order.item_hash, - chainId: ChainId.Mainnet, - assetPermalink: this.createPermalink(address, tokenId), - quantity: '1', - hash: order.item_hash, - side: order.type === 'buy' ? OrderSide.Buy : OrderSide.Sell, - maker: - order.maker ? - { - address: order.maker, - } - : undefined, - taker: - order.taker ? - { - address: order.taker, - } - : undefined, - createdAt: Number.parseInt(order.created_at, 10), - expiredAt: Number.parseInt(order.end_at, 10), - priceInToken: { - amount: order.price, - token: - isZeroAddress(order.currency) ? - EVMChainResolver.nativeCurrency(ChainId.Mainnet) - : createERC20Token(ChainId.Mainnet, order.currency), - }, - source: SourceType.X2Y2, - } - } - - createEvent(address: string, tokenId: string, event: Event): NonFungibleTokenEvent { - return { - id: event.id.toString(), - chainId: ChainId.Mainnet, - type: resolveActivityType(event.type), - assetPermalink: this.createPermalink(address, tokenId), - quantity: '1', - hash: event.order.item_hash, - from: { - address: event.from_address, - }, - to: { - address: event.to_address, - }, - timestamp: Number.parseInt(event.created_at, 10) * 1000, - paymentToken: - isZeroAddress(event.order.currency) ? - EVMChainResolver.nativeCurrency(ChainId.Mainnet) - : createERC20Token(ChainId.Mainnet, event.order.currency), - source: SourceType.X2Y2, - } - } - - createContract(address: string, contract: Contract): NonFungibleTokenContract { - return { - chainId: ChainId.Mainnet, - name: contract.name, - symbol: contract.symbol, - address, - schema: contract.erc_type === 721 ? SchemaType.ERC721 : SchemaType.ERC1155, - } - } - - async getOrders(address: string, tokenId: string, side: OrderSide, options?: BaseHubOptions) { - const [data = EMPTY_LIST, next] = await fetchFromX2Y2( - urlcat('/v1/orders', { - cursor: options?.indicator?.id, - contract: address, - token_id: tokenId, - sort: 'created_at', - direction: 'desc', - limit: X2Y2_PAGE_SIZE, - }), - ) - - const orders = data - .filter( - (x) => (x.type === 'sell' && side === OrderSide.Sell) || (x.type === 'buy' && side === OrderSide.Buy), - ) - .map((x) => this.createOrder(address, tokenId, x)) - - return createPageable( - orders, - createIndicator(options?.indicator), - orders.length && next ? createNextIndicator(options?.indicator, next) : undefined, - ) - } - async getEvents(address: string, tokenId: string, options?: BaseHubOptions) { - const cursors = options?.indicator?.id?.split('_') - const listCursor = first(cursors) - const saleCursor = last(cursors) - - const result = await Promise.all([ - listCursor || !options?.indicator?.index ? - fetchFromX2Y2( - urlcat('/v1/events', { - cursor: listCursor ?? '', - contract: address, - token_id: tokenId, - // list, sale, cancel_listing - type: 'list', - }), - ) - : EMPTY_LIST, - saleCursor || !options?.indicator?.index ? - fetchFromX2Y2( - urlcat('/v1/events', { - cursor: saleCursor ?? '', - contract: address, - token_id: tokenId, - // list, sale, cancel_listing - type: 'sale', - }), - ) - : EMPTY_LIST, - ]) - - const [[listData = EMPTY_LIST, listNext], [saleData = EMPTY_LIST, saleNext]] = result - const data = [...listData, ...saleData] - - const next = `${listNext}_${saleNext}` - const events = data.map((x) => this.createEvent(address, tokenId, x)) - - return createPageable( - events, - createIndicator(options?.indicator), - events.length && next ? createNextIndicator(options?.indicator, next) : undefined, - ) - } - async getContract(address: string) { - const [contract] = await fetchFromX2Y2( - urlcat('/v1/contracts/:contract', { - contract: address, - }), - ) - if (!contract) return - return this.createContract(address, contract) - } -} -export const X2Y2 = new X2Y2API() diff --git a/packages/web3-providers/src/X2Y2/types.ts b/packages/web3-providers/src/X2Y2/types.ts deleted file mode 100644 index f3d497948eed..000000000000 --- a/packages/web3-providers/src/X2Y2/types.ts +++ /dev/null @@ -1,53 +0,0 @@ -export interface Order { - maker: string - id: number - currency: string - taker?: string - price: string - created_at: string - item_hash: string - type: 'sell' | 'buy' - token: Token - is_collection_offer: boolean - end_at: string -} - -export interface Contract { - name: string - royalty_fee: number - nsfw: boolean - verified: boolean - erc_type: number - slug: string - contract: string - suspicious: boolean - symbol: string -} - -interface Token { - token_id: number - contract: string -} - -export interface Event { - from_address: string - id: number - order: { - maker: string - id: number - currency: string - taker?: string - price: string - created_at: string - item_hash: string - type: string - token: Token - is_collection_offer: false - end_at: string - } - tx?: string - created_at: string - to_address: string - type: 'offer_listing' - token: Token -} diff --git a/packages/web3-shared/base/src/helpers/resolver.ts b/packages/web3-shared/base/src/helpers/resolver.ts index 4755a631301d..046ab2b4232f 100644 --- a/packages/web3-shared/base/src/helpers/resolver.ts +++ b/packages/web3-shared/base/src/helpers/resolver.ts @@ -48,7 +48,6 @@ export const resolveSourceTypeName = createLookupTableResolver Date: Tue, 8 Apr 2025 11:25:01 +0800 Subject: [PATCH 08/20] fix: backup/recover related issues. (#12187) * fix: mf-6675 adjust background color of file table * fix: mf-6677 back up => backup * fix: mf-6678 backup dialog * refactor: replace merge modal with restore modal * fix: mf-6680 handle failed restore backup * fix: mf-6681 navigate to onboarding page after recovery * fix: mf-6674 mf-6679 adjust login and logout * fix: mf-6682 format datetime * fixup! fix: mf-6674 mf-6679 adjust login and logout * fix: mf-6683 scrollbar in collectible card * fix: mf-6676 actively request drive permission --- .../services/backup/google_drive.ts | 15 +- .../background/services/backup/restore.ts | 4 +- .../components/GoogleDriveFileTable.tsx | 1 + .../dashboard/components/GoogleDriveLogin.tsx | 8 +- .../BackupPreviewDialog.tsx | 8 +- .../MergeBackupModal/MergeBackupDialog.tsx | 198 ------------------ .../modals/MergeBackupModal/index.tsx | 21 -- .../RestoreBackupDialog.tsx | 19 +- .../modals/RestoreBackupModal/index.tsx | 8 +- packages/mask/dashboard/modals/index.tsx | 4 +- packages/mask/dashboard/modals/modals.ts | 6 +- .../SetupPersona/Backup/Cloud/GoogleDrive.tsx | 36 ++-- .../SetupPersona/Backup/Cloud/Preview.tsx | 5 +- .../SetupPersona/CloudBackupPreview/index.tsx | 5 +- .../Recovery/Cloud/GoogleDrive.tsx | 47 +++-- packages/mask/shared-ui/locale/en-US.json | 3 + packages/mask/shared-ui/locale/en-US.po | 33 +-- packages/mask/shared-ui/locale/ja-JP.json | 3 + packages/mask/shared-ui/locale/ja-JP.po | 33 +-- packages/mask/shared-ui/locale/ko-KR.json | 3 + packages/mask/shared-ui/locale/ko-KR.po | 33 +-- packages/mask/shared-ui/locale/zh-CN.json | 3 + packages/mask/shared-ui/locale/zh-CN.po | 33 +-- packages/mask/shared-ui/locale/zh-TW.json | 3 + packages/mask/shared-ui/locale/zh-TW.po | 33 +-- .../checkAndRequestIdentityPermission.ts | 7 + packages/mask/shared/helpers/index.ts | 1 + .../shared/helpers/requestDriveAccessToken.ts | 29 +++ .../src/SiteAdaptor/Card/CollectibleCard.tsx | 1 + .../src/GoogleDriveClient/index.ts | 12 +- 30 files changed, 248 insertions(+), 367 deletions(-) delete mode 100644 packages/mask/dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx delete mode 100644 packages/mask/dashboard/modals/MergeBackupModal/index.tsx create mode 100644 packages/mask/shared/helpers/requestDriveAccessToken.ts diff --git a/packages/mask/background/services/backup/google_drive.ts b/packages/mask/background/services/backup/google_drive.ts index 67e50b4e3312..ccbb4a6c353a 100644 --- a/packages/mask/background/services/backup/google_drive.ts +++ b/packages/mask/background/services/backup/google_drive.ts @@ -1,22 +1,11 @@ -import { checkAndRequestPermission } from '../../../shared/helpers/index.js' +import { checkAndRequestPermission, requestDriveAccessToken } from '../../../shared/helpers/index.js' /* eslint-disable @typescript-eslint/ban-ts-comment */ export async function getAccessToken(interactive = false) { const granted = await checkAndRequestPermission() if (!granted) return - return new Promise((resolve, reject) => { - // @ts-expect-error - chrome.identity.getAuthToken({ interactive }, (token, error) => { - // @ts-expect-error - if (chrome.runtime.lastError) { - // @ts-expect-error - reject(new Error(chrome.runtime.lastError.message)) - return - } - resolve(token) - }) - }) + return requestDriveAccessToken(interactive) } export async function clearAccessToken() { diff --git a/packages/mask/background/services/backup/restore.ts b/packages/mask/background/services/backup/restore.ts index 4529a4c2cb68..233389c7434c 100644 --- a/packages/mask/background/services/backup/restore.ts +++ b/packages/mask/background/services/backup/restore.ts @@ -1,4 +1,4 @@ -import { getBackupSummary, normalizeBackup } from '@masknet/backup-format' +import { getBackupSummary, normalizeBackup, type BackupSummary } from '@masknet/backup-format' import { restoreNormalizedBackup } from './internal_restore.js' import { Result } from 'ts-results-es' import { SmartPayBundler, SmartPayOwner } from '@masknet/web3-providers' @@ -7,7 +7,7 @@ import { bytesToHex, privateToPublic, publicToAddress } from '@ethereumjs/util' import { fromBase64URL } from '@masknet/shared-base' export async function generateBackupSummary(raw: string) { - return Result.wrapAsync(async () => { + return Result.wrapAsync(async (): Promise => { const backupObj: unknown = JSON.parse(raw) const backup = await normalizeBackup(backupObj) diff --git a/packages/mask/dashboard/components/GoogleDriveFileTable.tsx b/packages/mask/dashboard/components/GoogleDriveFileTable.tsx index cae73c5cf4c2..aa70d2b9e04b 100644 --- a/packages/mask/dashboard/components/GoogleDriveFileTable.tsx +++ b/packages/mask/dashboard/components/GoogleDriveFileTable.tsx @@ -26,6 +26,7 @@ const useStyles = makeStyles()((theme) => ({ border: `1px solid ${theme.palette.maskColor.line}`, borderRadius: 8, overflow: 'hidden', + backgroundColor: theme.palette.maskColor.bottom, }, table: { borderRadius: 8, diff --git a/packages/mask/dashboard/components/GoogleDriveLogin.tsx b/packages/mask/dashboard/components/GoogleDriveLogin.tsx index 9ed045f16eae..ed0119d92642 100644 --- a/packages/mask/dashboard/components/GoogleDriveLogin.tsx +++ b/packages/mask/dashboard/components/GoogleDriveLogin.tsx @@ -6,7 +6,7 @@ import { Box, Typography } from '@mui/material' import { memo, useMemo } from 'react' import { useAsyncFn } from 'react-use' import { UserContext } from '../../shared-ui/index.js' -import { checkAndRequestPermission } from '../../shared/helpers/index.js' +import { checkAndRequestPermission, requestDriveAccessToken } from '../../shared/helpers/index.js' import { clearGoogleDriveAccessToken, getGoogleDriveAccessToken } from '../utils/api.js' const useStyles = makeStyles()((theme) => ({ @@ -43,11 +43,15 @@ export const GoogleDriveLogin = memo(function GoogleDriveLogin() { if (!granted) return const userInfo = await googleDriveClient.login(true) + await requestDriveAccessToken(true) // request permission to manipulate files updateUser({ googleAccount: userInfo.email || '', }) } catch (err) { - showSnackbar(t`Failed to login: ${(err as Error).message}`, { variant: 'error' }) + showSnackbar(t`Authorization Failed`, { + variant: 'warning', + message: t`Failed to authorize Google Drive. Please try again.`, + }) } }, [googleDriveClient, updateUser, showSnackbar]) return ( diff --git a/packages/mask/dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx b/packages/mask/dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx index f2f6047e55ad..6c5e0ccc2f9b 100644 --- a/packages/mask/dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx +++ b/packages/mask/dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx @@ -63,8 +63,9 @@ export interface BackupPreviewDialogProps { type: BackupAccountType account: string abstract?: string - onClose: () => void + title?: React.ReactNode | string uploadButtonLabel?: React.ReactNode | string + onClose: () => void onUpload?: (content: ArrayBuffer, signal: AbortSignal) => Promise } export const BackupPreviewDialog = memo(function BackupPreviewDialog({ @@ -74,8 +75,9 @@ export const BackupPreviewDialog = memo(function Backu type, account, abstract, - onClose, + title, uploadButtonLabel, + onClose, onUpload, }) { const { _ } = useLingui() @@ -259,7 +261,7 @@ export const BackupPreviewDialog = memo(function Backu ]) return ( - Upload backup} open={open} onClose={handleClose}> + Upload backup} open={open} onClose={handleClose}> {content} {action} diff --git a/packages/mask/dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx b/packages/mask/dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx deleted file mode 100644 index 5ca5115cc1cb..000000000000 --- a/packages/mask/dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx +++ /dev/null @@ -1,198 +0,0 @@ -import Services from '#services' -import { Trans, useLingui } from '@lingui/react/macro' -import { decryptBackup } from '@masknet/backup-format' -import { Icons } from '@masknet/icons' -import { formatFileSize, InjectedDialog } from '@masknet/shared' -import { ActionButton, makeStyles, useCustomSnackbar } from '@masknet/theme' -import { decode, encode } from '@msgpack/msgpack' -import { Box, DialogActions, DialogContent, LinearProgress, Typography } from '@mui/material' -import { format as formatDateTime, fromUnixTime } from 'date-fns' -import { memo, useCallback, useState, type ReactNode } from 'react' -import { useAsync, useAsyncFn } from 'react-use' -import PasswordField from '../../components/PasswordField/index.js' -import { passwordRegexp } from '../../utils/regexp.js' - -const useStyles = makeStyles()((theme) => ({ - dialog: { - height: 620, - width: 600, - }, - account: { - padding: theme.spacing(0.5, 2), - fontSize: 14, - fontWeight: 700, - }, - box: { - background: theme.palette.maskColor.bottom, - borderRadius: 8, - boxShadow: theme.palette.maskColor.bottomBg, - backdropFilter: 'blur(8px)', - padding: theme.spacing(1.5), - display: 'flex', - alignItems: 'center', - margin: theme.spacing(1.5, 0), - columnGap: 8, - }, - fileName: { - fontSize: 14, - lineHeight: '18px', - }, -})) - -export interface MergeBackupDialogProps { - account: string - /** - * A generator that yield progress of download, - * and return the content of the downloaded file at the end - */ - download: () => AsyncGenerator - fileName: string - onClose: () => void - open: boolean - size: string - /** unix time */ - uploadedAt: string | number -} - -export const MergeBackupDialog = memo(function MergeBackupDialog({ - open, - onClose, - fileName, - download, - account, - uploadedAt, - size, -}) { - const { t } = useLingui() - const { classes, theme } = useStyles() - const [progress, setProgress] = useState(0) - const [backupPassword, setBackupPassword] = useState('') - const [backupPasswordError, setBackupPasswordError] = useState() - const { showSnackbar } = useCustomSnackbar() - - const handleClose = useCallback(() => { - setBackupPassword('') - setBackupPasswordError('') - onClose() - }, [onClose]) - - const { value: encrypted } = useAsync(async () => { - if (!open) return - const generator = download() - try { - let step: IteratorResult - while (!(step = await generator.next()).done) { - setProgress(step.value) - } - return step.value - } catch (err) { - showSnackbar((err as Error).message, { variant: 'error' }) - handleClose() - throw err - } - }, [handleClose, open, download]) - - const [{ loading }, handleClickMerge] = useAsyncFn(async () => { - try { - if (!encrypted) return - const decrypted = await decryptBackup(encode(account + backupPassword), encrypted) - const backupText = JSON.stringify(decode(decrypted)) - const summary = await Services.Backup.generateBackupSummary(backupText) - if (summary.isErr()) { - setBackupPasswordError(Incorrect cloud backup password, please try again.) - return - } - const backupSummary = summary.unwrapOr(undefined) - if (!backupSummary) return - if (backupSummary.countOfWallets) { - const hasPassword = await Services.Wallet.hasPassword() - if (!hasPassword) await Services.Wallet.setDefaultPassword() - } - await Services.Backup.restoreBackup(backupText) - showSnackbar(Merge Completed, { - variant: 'success', - message: Your file has been successfully merged into the browser data., - }) - } catch (err) { - showSnackbar(Failed to download and merge the backup: {(err as Error).message}) - } - }, [encrypted, backupPassword, account]) - - return ( - Merge data to local database} - open={open} - onClose={onClose}> - - {account} - - - - {fileName} - - - {progress !== 100 ? - Downloading - : <> - - {formatFileSize(Number(size))} - - - {formatDateTime(fromUnixTime(Number(uploadedAt)), 'yyyy-MM-dd HH:mm')} - - - } - - - - - { - setBackupPassword(e.target.value) - setBackupPasswordError('') - }} - onBlur={(e) => { - if (!passwordRegexp.test(e.target.value)) { - setBackupPasswordError(Incorrect cloud backup password, please try again.) - } - }} - error={!!backupPasswordError} - helperText={ - backupPasswordError ? backupPasswordError : ( - Please enter cloud backup password to download file. - ) - } - /> - - - } - onClick={handleClickMerge} - loading={loading} - disabled={!!backupPasswordError || !backupPassword || !encrypted}> - Merge to Browser - - - - ) -}) diff --git a/packages/mask/dashboard/modals/MergeBackupModal/index.tsx b/packages/mask/dashboard/modals/MergeBackupModal/index.tsx deleted file mode 100644 index 857b3714f8eb..000000000000 --- a/packages/mask/dashboard/modals/MergeBackupModal/index.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import type { SingletonModalProps } from '@masknet/shared-base' -import { useSingletonModal } from '@masknet/shared-base-ui' -import { useState } from 'react' -import { MergeBackupDialog, type MergeBackupDialogProps } from './MergeBackupDialog.js' - -export interface MergeBackupModalOpenProps extends Omit {} - -export function MergeBackupModal({ ref }: SingletonModalProps) { - const [props, setProps] = useState(null) - const [open, dispatch] = useSingletonModal(ref, { - onOpen(props) { - setProps(props) - }, - onClose(props) { - setProps(null) - }, - }) - if (!props) return null - - return dispatch?.close()} {...props} /> -} diff --git a/packages/mask/dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx b/packages/mask/dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx index 756256ff9b9f..facebb29f18d 100644 --- a/packages/mask/dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +++ b/packages/mask/dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx @@ -1,12 +1,12 @@ import Services from '#services' import { Trans, useLingui } from '@lingui/react/macro' -import { decryptBackup } from '@masknet/backup-format' +import { decryptBackup, type BackupSummary } from '@masknet/backup-format' import { Icons } from '@masknet/icons' import { formatFileSize, InjectedDialog } from '@masknet/shared' import { ActionButton, makeStyles, useCustomSnackbar } from '@masknet/theme' import { decode, encode } from '@msgpack/msgpack' import { Box, DialogActions, DialogContent, LinearProgress, Typography } from '@mui/material' -import { format as formatDateTime, fromUnixTime } from 'date-fns' +import { format as formatDateTime } from 'date-fns' import { memo, useCallback, useState, type ReactNode } from 'react' import { useAsync, useAsyncFn } from 'react-use' import PasswordField from '../../components/PasswordField/index.js' @@ -54,7 +54,7 @@ export interface RestoreBackupDialogProps { * and return the content of the downloaded file at the end */ download: () => AsyncGenerator - onClose: () => void + onClose: (summary?: BackupSummary) => void } export const RestoreBackupDialog = memo(function RestoreBackupDialog({ @@ -124,7 +124,7 @@ export const RestoreBackupDialog = memo(function Resto Your file has been successfully restore into the browser data. : Your file has been successfully merged into the browser data.), }) - onClose() + onClose(backupSummary) } catch (err) { if (isImport) { showSnackbar(Restore Failed, { @@ -133,10 +133,11 @@ export const RestoreBackupDialog = memo(function Resto Failed to restore the backup: {(err as Error).message} ), }) + } else { + showSnackbar(Failed to download and merge the backup: {(err as Error).message}, { + variant: 'error', + }) } - showSnackbar(Failed to download and merge the backup: {(err as Error).message}, { - variant: 'error', - }) } }, [ encrypted, @@ -158,7 +159,7 @@ export const RestoreBackupDialog = memo(function Resto : Merge data to local database } open={open} - onClose={onClose}> + onClose={() => onClose()}> {account} @@ -189,7 +190,7 @@ export const RestoreBackupDialog = memo(function Resto fontSize={12} lineHeight="16px" color={theme.palette.maskColor.third}> - {formatDateTime(fromUnixTime(Number(uploadedAt)), 'yyyy-MM-dd HH:mm')} + {formatDateTime(new Date(Number(uploadedAt)), 'yyyy-mm-dd HH:mm')} } diff --git a/packages/mask/dashboard/modals/RestoreBackupModal/index.tsx b/packages/mask/dashboard/modals/RestoreBackupModal/index.tsx index 8afb2ecfd6c5..e1d2c94855c0 100644 --- a/packages/mask/dashboard/modals/RestoreBackupModal/index.tsx +++ b/packages/mask/dashboard/modals/RestoreBackupModal/index.tsx @@ -1,11 +1,15 @@ +import type { BackupSummary } from '@masknet/backup-format' import type { SingletonModalProps } from '@masknet/shared-base' import { useSingletonModal } from '@masknet/shared-base-ui' import { useState } from 'react' import { RestoreBackupDialog, type RestoreBackupDialogProps } from './RestoreBackupDialog.js' export interface RestoreBackupModalOpenProps extends Omit {} +export type RestoreBackupModalCloseResult = BackupSummary | undefined -export function RestoreBackupModal({ ref }: SingletonModalProps) { +export function RestoreBackupModal({ + ref, +}: SingletonModalProps) { const [props, setProps] = useState(null) const [open, dispatch] = useSingletonModal(ref, { onOpen(props) { @@ -17,5 +21,5 @@ export function RestoreBackupModal({ ref }: SingletonModalProps dispatch?.close()} {...props} /> + return dispatch?.close(success)} {...props} /> } diff --git a/packages/mask/dashboard/modals/index.tsx b/packages/mask/dashboard/modals/index.tsx index 95f2644043a6..7c2c9bb0c440 100644 --- a/packages/mask/dashboard/modals/index.tsx +++ b/packages/mask/dashboard/modals/index.tsx @@ -1,8 +1,7 @@ import { memo } from 'react' -import { ConfirmDialog } from './ConfirmModal/index.js' import { BackupPreviewModal } from './BackupPreviewModal/index.js' -import { MergeBackupModal } from './MergeBackupModal/index.js' +import { ConfirmDialog } from './ConfirmModal/index.js' import * as modals from './modals.js' import { RestoreBackupModal } from './RestoreBackupModal/index.js' @@ -12,7 +11,6 @@ export const Modals = memo(function Modals() { <> - ) diff --git a/packages/mask/dashboard/modals/modals.ts b/packages/mask/dashboard/modals/modals.ts index 9b40dc5e6ed1..9494fed43d4f 100644 --- a/packages/mask/dashboard/modals/modals.ts +++ b/packages/mask/dashboard/modals/modals.ts @@ -1,10 +1,8 @@ import { SingletonModal } from '@masknet/shared-base' import type { ConfirmDialogOpenProps } from './ConfirmModal/index.js' import type { BackupPreviewModalOpenProps } from './BackupPreviewModal/index.js' -import type { MergeBackupModalOpenProps } from './MergeBackupModal/index.js' -import type { RestoreBackupModalOpenProps } from './RestoreBackupModal/index.js' +import type { RestoreBackupModalCloseResult, RestoreBackupModalOpenProps } from './RestoreBackupModal/index.js' export const ConfirmDialog = new SingletonModal() export const BackupPreviewModal = new SingletonModal() -export const MergeBackupModal = new SingletonModal() -export const RestoreBackupModal = new SingletonModal() +export const RestoreBackupModal = new SingletonModal() diff --git a/packages/mask/dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx b/packages/mask/dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx index 6050161fa944..ed1507e9599b 100644 --- a/packages/mask/dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx @@ -1,9 +1,9 @@ import { Trans } from '@lingui/react/macro' import { Icons } from '@masknet/icons' import { BackupAccountType, EMPTY_LIST } from '@masknet/shared-base' -import { makeStyles } from '@masknet/theme' +import { ActionButton, makeStyles } from '@masknet/theme' import { GoogleDriveClient, type DriveFile } from '@masknet/web3-providers' -import { Box, Button, Typography } from '@mui/material' +import { Box, Typography } from '@mui/material' import { compact, uniqBy } from 'lodash-es' import { memo, useMemo, useState } from 'react' import { useAsyncFn } from 'react-use' @@ -13,7 +13,7 @@ import { GoogleDriveLogin } from '../../../../components/GoogleDriveLogin.js' import { OutletPortal } from '../../../../components/OutletPortal.js' import { PrimaryButton } from '../../../../components/PrimaryButton/index.js' import { useGoogleDriveFiles } from '../../../../hooks/useGoogleDriveFiles.js' -import { BackupPreviewModal, MergeBackupModal } from '../../../../modals/modals.js' +import { BackupPreviewModal, RestoreBackupModal } from '../../../../modals/modals.js' import { clearGoogleDriveAccessToken, createBackupName, @@ -27,7 +27,6 @@ const useStyles = makeStyles()((theme) => ({ display: 'flex', flexDirection: 'column', gap: theme.spacing(1.5), - paddingBottom: theme.spacing(6), }, header: { display: 'flex', @@ -93,6 +92,14 @@ export const Component = memo(function GoogleDriveBackup() { [googleDriveClient], ) + const [{ loading: logoutLoading }, logout] = useAsyncFn(async () => { + await googleDriveClient.logout() + updateUser({ + googleAccount: '', + googleToken: '', + }) + }, [googleDriveClient]) + const mergedFiles = useMemo(() => uniqBy(compact([...files, uploadedFile]), (x) => x.id), [files, uploadedFile]) if (!user.googleAccount) { @@ -100,7 +107,8 @@ export const Component = memo(function GoogleDriveBackup() { } const downloadAndMerge = async (file: DriveFile) => { - await MergeBackupModal.openAndWaitForClose({ + await RestoreBackupModal.openAndWaitForClose({ + strategy: 'merge', download: () => { return progressDownload(() => googleDriveClient.requestFile(file.id), file.size ? +file.size : 0) }, @@ -119,17 +127,14 @@ export const Component = memo(function GoogleDriveBackup() { {user.googleAccount} - + MaskBackup file @@ -161,11 +166,12 @@ export const Component = memo(function GoogleDriveBackup() { type: BackupAccountType.Email, account: user.googleAccount!, isUpload: true, + title: Backup to Google Drive, + uploadButtonLabel: Backup, onUpload: uploadFile, - uploadButtonLabel: Back Up to Google Drive, }) }}> - Back Up to Google Drive + Backup to Google Drive diff --git a/packages/mask/dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx b/packages/mask/dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx index 1fa1da1da517..bd825d00501d 100644 --- a/packages/mask/dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx @@ -10,7 +10,7 @@ import { memo, useCallback, useMemo } from 'react' import { useNavigate, useSearchParams } from 'react-router-dom' import { useAsyncFn } from 'react-use' import { OutletPortal } from '../../../../components/OutletPortal.js' -import { BackupPreviewModal, MergeBackupModal } from '../../../../modals/modals.js' +import { BackupPreviewModal, RestoreBackupModal } from '../../../../modals/modals.js' import { createBackupName, downloadBackup, getFileName, progressDownload } from '../../../../utils/api.js' const useStyles = makeStyles()((theme) => ({ @@ -83,7 +83,8 @@ export const Component = memo(function CloudBackupPreview() { const [{ loading: mergeLoading }, handleMergeClick] = useAsyncFn(async () => { if (!previewInfo.downloadLink || !previewInfo.account || !previewInfo.size || !previewInfo.uploadedAt) return - await MergeBackupModal.openAndWaitForClose({ + await RestoreBackupModal.openAndWaitForClose({ + strategy: 'merge', download: () => progressDownload(previewInfo.downloadLink), fileName: getFileName(previewInfo.downloadLink) || createBackupName(), account: previewInfo.account, diff --git a/packages/mask/dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx b/packages/mask/dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx index e3decb43bd6f..474f6f1e0b83 100644 --- a/packages/mask/dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx @@ -10,7 +10,7 @@ import { memo, useCallback, useMemo } from 'react' import { useNavigate, useSearchParams } from 'react-router-dom' import { useAsyncFn } from 'react-use' import { SetupFrameController } from '../../../components/SetupFrame/index.js' -import { BackupPreviewModal, ConfirmDialog, MergeBackupModal } from '../../../modals/modals.js' +import { BackupPreviewModal, ConfirmDialog, RestoreBackupModal } from '../../../modals/modals.js' import { createBackupName, getFileName, progressDownload } from '../../../utils/api.js' const useStyles = makeStyles()((theme) => ({ @@ -78,7 +78,8 @@ export const Component = memo(function CloudBackupPreview() { !previewInfo.code ) return - await MergeBackupModal.openAndWaitForClose({ + await RestoreBackupModal.openAndWaitForClose({ + strategy: 'merge', download: () => progressDownload(previewInfo.downloadLink), fileName: getFileName(previewInfo.downloadLink) || createBackupName(), account: previewInfo.account, diff --git a/packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx b/packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx index e0c6b0338948..fcdb3b84fbd8 100644 --- a/packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx @@ -1,17 +1,20 @@ import { Trans } from '@lingui/react/macro' import { Icons } from '@masknet/icons' -import { EMPTY_LIST } from '@masknet/shared-base' -import { makeStyles } from '@masknet/theme' +import { DashboardRoutes, EMPTY_LIST } from '@masknet/shared-base' +import { ActionButton, makeStyles } from '@masknet/theme' import { GoogleDriveClient, type DriveFile } from '@masknet/web3-providers' -import { Box, Button, Typography } from '@mui/material' +import { Box, Typography } from '@mui/material' import { memo, useMemo, useState } from 'react' +import { useNavigate } from 'react-router-dom' +import { useAsyncFn } from 'react-use' +import urlcat from 'urlcat' import { UserContext } from '../../../../../shared-ui/index.js' import { GoogleDriveFileTable } from '../../../../components/GoogleDriveFileTable.js' import { GoogleDriveLogin } from '../../../../components/GoogleDriveLogin.js' import { OutletPortal } from '../../../../components/OutletPortal.js' import { PrimaryButton } from '../../../../components/PrimaryButton/index.js' import { useGoogleDriveFiles } from '../../../../hooks/useGoogleDriveFiles.js' -import { MergeBackupModal, RestoreBackupModal } from '../../../../modals/modals.js' +import { RestoreBackupModal } from '../../../../modals/modals.js' import { clearGoogleDriveAccessToken, downloadBackup, @@ -62,12 +65,20 @@ const useStyles = makeStyles()((theme) => ({ export const Component = memo(function GoogleDriveRecovery() { const { classes } = useStyles() + const navigate = useNavigate() const { user, updateUser } = UserContext.useContainer() const googleDriveClient = useMemo( () => new GoogleDriveClient(getGoogleDriveAccessToken, clearGoogleDriveAccessToken), [], ) const { data: files = EMPTY_LIST, isLoading } = useGoogleDriveFiles(googleDriveClient) + const [{ loading: logoutLoading }, logout] = useAsyncFn(async () => { + await googleDriveClient.logout() + updateUser({ + googleAccount: '', + googleToken: '', + }) + }, [googleDriveClient]) const [selectedFile, setSelectedFile] = useState(null) @@ -76,7 +87,8 @@ export const Component = memo(function GoogleDriveRecovery() { } const downloadAndMerge = async (file: DriveFile) => { - await MergeBackupModal.openAndWaitForClose({ + await RestoreBackupModal.openAndWaitForClose({ + strategy: 'merge', download: () => { return progressDownload(() => googleDriveClient.requestFile(file.id), file.size ? +file.size : 0) }, @@ -95,17 +107,14 @@ export const Component = memo(function GoogleDriveRecovery() { {user.googleAccount} - + MaskBackup file @@ -136,7 +145,7 @@ export const Component = memo(function GoogleDriveRecovery() { disabled={!selectedFile} onClick={async () => { if (!user.googleAccount || !selectedFile?.id) return - await RestoreBackupModal.openAndWaitForClose({ + const result = await RestoreBackupModal.openAndWaitForClose({ download: () => { return progressDownload( () => googleDriveClient.requestFile(selectedFile.id), @@ -159,6 +168,16 @@ export const Component = memo(function GoogleDriveRecovery() { ), }) setSelectedFile(null) + if (result) { + navigate( + urlcat(DashboardRoutes.SignUpPersonaOnboarding, { + count: result.countOfWallets, + }), + { + replace: true, + }, + ) + } }}> Recover diff --git a/packages/mask/shared-ui/locale/en-US.json b/packages/mask/shared-ui/locale/en-US.json index f2b92aaa130d..19a148f55482 100644 --- a/packages/mask/shared-ui/locale/en-US.json +++ b/packages/mask/shared-ui/locale/en-US.json @@ -108,6 +108,7 @@ "iTiwqa": ["Asset is hidden."], "2jQko7": ["Associated Accounts"], "CEk7Nc": ["At least 6 characters"], + "gp6A8z": ["Authorization Failed"], "Wvnsx1": ["Auto-lock"], "7QptC5": ["Auto-lock Time"], "nTFx7o": ["Avatar set successfully"], @@ -128,6 +129,7 @@ "hUF4dG": ["Backup password set successfully"], "UtKGok": ["Backup Persona"], "+m7x4e": ["Backup Successful"], + "3iUAE7": ["Backup to Google Drive"], "7Ry254": ["Backup to Mask Cloud Service"], "6IHgRq": ["Backup to the Cloud"], "QQPCqQ": ["Backup Wallet"], @@ -306,6 +308,7 @@ "GS+Mus": ["Export"], "7Bj3x9": ["Failed"], "SLEDBF": ["Failed to add the wallet, please try again."], + "r92tNP": ["Failed to authorize Google Drive. Please try again."], "09vHB+": ["Failed to decrypt."], "jK7nvW": ["Failed to disconnect wallet"], "9hzYBR": ["Failed to download and merge the backup: ", ["0"]], diff --git a/packages/mask/shared-ui/locale/en-US.po b/packages/mask/shared-ui/locale/en-US.po index 477c7cb2873c..9dd1ff979c87 100644 --- a/packages/mask/shared-ui/locale/en-US.po +++ b/packages/mask/shared-ui/locale/en-US.po @@ -299,6 +299,10 @@ msgstr "" msgid "At least 6 characters" msgstr "" +#: dashboard/components/GoogleDriveLogin.tsx +msgid "Authorization Failed" +msgstr "" + #: popups/pages/Wallet/WalletSettings/AutoLock.tsx msgid "Auto-lock" msgstr "" @@ -321,8 +325,8 @@ msgstr "" #: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx -msgid "Back Up to Google Drive" -msgstr "" +#~ msgid "Back Up to Google Drive" +#~ msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/index.tsx @@ -330,6 +334,7 @@ msgid "Back Up Your Data Your Way" msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Personas/Logout/index.tsx #: popups/modals/SwitchPersonaModal/index.tsx @@ -367,7 +372,6 @@ msgstr "" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Settings/index.tsx #: popups/modals/SetBackupPasswordModal/index.tsx @@ -393,6 +397,11 @@ msgstr "" msgid "Backup Successful" msgstr "" +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx +msgid "Backup to Google Drive" +msgstr "" + #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #~ msgid "Backup to Mask Cloud Service" #~ msgstr "" @@ -1011,7 +1020,6 @@ msgid "Download Backup" msgstr "" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Downloading" msgstr "" @@ -1167,6 +1175,10 @@ msgstr "" msgid "Failed to add the wallet, please try again." msgstr "" +#: dashboard/components/GoogleDriveLogin.tsx +msgid "Failed to authorize Google Drive. Please try again." +msgstr "" + #: content-script/components/InjectedComponents/DecryptedPost/DecryptPostFailed.tsx msgid "Failed to decrypt." msgstr "" @@ -1177,7 +1189,6 @@ msgstr "" #. placeholder {0}: (err as Error).message #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Failed to download and merge the backup: {0}" msgstr "" @@ -1185,10 +1196,9 @@ msgstr "" #~ msgid "Failed to download and merge the backup." #~ msgstr "" -#. placeholder {0}: (err as Error).message #: dashboard/components/GoogleDriveLogin.tsx -msgid "Failed to login: {0}" -msgstr "" +#~ msgid "Failed to login: {0}" +#~ msgstr "" #: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx msgid "Failed to restore the backup from Google Drive to your browser. Please try again." @@ -1493,8 +1503,6 @@ msgstr "" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Incorrect cloud backup password, please try again." msgstr "" @@ -1807,19 +1815,16 @@ msgid "Medium" msgstr "" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Merge Completed" msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Merge data to local database" msgstr "" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #: dashboard/components/GoogleDriveFileTable.tsx msgid "Merge to Browser" msgstr "" @@ -2207,7 +2212,6 @@ msgid "Please enter backup password to export persona private key." msgstr "" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Please enter cloud backup password to download file." msgstr "" @@ -3322,7 +3326,6 @@ msgid "Your connection to this site is not encrypted which can be modified by a msgstr "" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Your file has been successfully merged into the browser data." msgstr "" diff --git a/packages/mask/shared-ui/locale/ja-JP.json b/packages/mask/shared-ui/locale/ja-JP.json index 421f435f1bf0..88a55d8f399b 100644 --- a/packages/mask/shared-ui/locale/ja-JP.json +++ b/packages/mask/shared-ui/locale/ja-JP.json @@ -108,6 +108,7 @@ "iTiwqa": ["Asset is hidden."], "2jQko7": ["関連アカウント"], "CEk7Nc": ["6 文字以上"], + "gp6A8z": ["Authorization Failed"], "Wvnsx1": ["自動ロック"], "7QptC5": ["自動ロック時間"], "nTFx7o": ["アバターを設定しました"], @@ -126,6 +127,7 @@ "hUF4dG": ["バックアップパスワードの設定が完了しました"], "UtKGok": ["ペルソナをバックアップする"], "+m7x4e": ["Backup Successful"], + "3iUAE7": ["Backup to Google Drive"], "7Ry254": ["Backup to Mask Cloud Service"], "6IHgRq": ["Backup to the Cloud"], "QQPCqQ": ["ウォレットをバックアップする"], @@ -304,6 +306,7 @@ "GS+Mus": ["エクスポート"], "7Bj3x9": ["失敗しました"], "SLEDBF": ["ウォレットを追加できませんでした。もう一度やり直してください。"], + "r92tNP": ["Failed to authorize Google Drive. Please try again."], "09vHB+": ["Failed to decrypt."], "jK7nvW": ["Failed to disconnect wallet"], "9hzYBR": ["Failed to download and merge the backup: ", ["0"]], diff --git a/packages/mask/shared-ui/locale/ja-JP.po b/packages/mask/shared-ui/locale/ja-JP.po index 8e8953fef474..9435003f2f69 100644 --- a/packages/mask/shared-ui/locale/ja-JP.po +++ b/packages/mask/shared-ui/locale/ja-JP.po @@ -304,6 +304,10 @@ msgstr "関連アカウント" msgid "At least 6 characters" msgstr "6 文字以上" +#: dashboard/components/GoogleDriveLogin.tsx +msgid "Authorization Failed" +msgstr "" + #: popups/pages/Wallet/WalletSettings/AutoLock.tsx msgid "Auto-lock" msgstr "自動ロック" @@ -326,8 +330,8 @@ msgstr "" #: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx -msgid "Back Up to Google Drive" -msgstr "" +#~ msgid "Back Up to Google Drive" +#~ msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/index.tsx @@ -335,6 +339,7 @@ msgid "Back Up Your Data Your Way" msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Personas/Logout/index.tsx #: popups/modals/SwitchPersonaModal/index.tsx @@ -372,7 +377,6 @@ msgstr "バックアップパスワード" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Settings/index.tsx #: popups/modals/SetBackupPasswordModal/index.tsx @@ -398,6 +402,11 @@ msgstr "ペルソナをバックアップする" msgid "Backup Successful" msgstr "" +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx +msgid "Backup to Google Drive" +msgstr "" + #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #~ msgid "Backup to Mask Cloud Service" #~ msgstr "" @@ -1016,7 +1025,6 @@ msgid "Download Backup" msgstr "バックアップのダウンロード" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Downloading" msgstr "ダウンロード中" @@ -1172,6 +1180,10 @@ msgstr "失敗しました" msgid "Failed to add the wallet, please try again." msgstr "ウォレットを追加できませんでした。もう一度やり直してください。" +#: dashboard/components/GoogleDriveLogin.tsx +msgid "Failed to authorize Google Drive. Please try again." +msgstr "" + #: content-script/components/InjectedComponents/DecryptedPost/DecryptPostFailed.tsx msgid "Failed to decrypt." msgstr "" @@ -1182,7 +1194,6 @@ msgstr "" #. placeholder {0}: (err as Error).message #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Failed to download and merge the backup: {0}" msgstr "" @@ -1190,10 +1201,9 @@ msgstr "" #~ msgid "Failed to download and merge the backup." #~ msgstr "" -#. placeholder {0}: (err as Error).message #: dashboard/components/GoogleDriveLogin.tsx -msgid "Failed to login: {0}" -msgstr "" +#~ msgid "Failed to login: {0}" +#~ msgstr "" #: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx msgid "Failed to restore the backup from Google Drive to your browser. Please try again." @@ -1498,8 +1508,6 @@ msgstr "バックアップパスワードが正しくありません。" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Incorrect cloud backup password, please try again." msgstr "クラウドバックアップのパスワードが正しくありません。もう一度やり直してください。" @@ -1812,19 +1820,16 @@ msgid "Medium" msgstr "中間" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Merge Completed" msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Merge data to local database" msgstr "ローカルデータベースにデータを統合" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #: dashboard/components/GoogleDriveFileTable.tsx msgid "Merge to Browser" msgstr "" @@ -2212,7 +2217,6 @@ msgid "Please enter backup password to export persona private key." msgstr "ペルソナ秘密鍵をエクスポートするには、バックアップパスワードを入力してください。" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Please enter cloud backup password to download file." msgstr "ファイルをダウンロードするには、クラウドバックアップパスワードを入力してください。" @@ -3327,7 +3331,6 @@ msgid "Your connection to this site is not encrypted which can be modified by a msgstr "このサイトへの接続は暗号化されていないため、敵対的な第三者によって変更されます。このリクエストを拒否することを強くお勧めします。" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Your file has been successfully merged into the browser data." msgstr "" diff --git a/packages/mask/shared-ui/locale/ko-KR.json b/packages/mask/shared-ui/locale/ko-KR.json index ec4b75b273c1..a7d6c1f7f7ae 100644 --- a/packages/mask/shared-ui/locale/ko-KR.json +++ b/packages/mask/shared-ui/locale/ko-KR.json @@ -108,6 +108,7 @@ "iTiwqa": ["Asset is hidden."], "2jQko7": ["관련 계정"], "CEk7Nc": ["최소 8 글자 이상 이용하세요"], + "gp6A8z": ["Authorization Failed"], "Wvnsx1": ["Auto-lock"], "7QptC5": ["Auto-lock 시간"], "nTFx7o": ["아바타 설정 성공"], @@ -126,6 +127,7 @@ "hUF4dG": ["백업 비밀번호가 설정되었습니다."], "UtKGok": ["페르소나 백업"], "+m7x4e": ["Backup Successful"], + "3iUAE7": ["Backup to Google Drive"], "7Ry254": ["Backup to Mask Cloud Service"], "6IHgRq": ["Backup to the Cloud"], "QQPCqQ": ["지갑 백업"], @@ -304,6 +306,7 @@ "GS+Mus": ["내보내기"], "7Bj3x9": ["실패"], "SLEDBF": ["월렛 추가 실패, 다시 시도하기"], + "r92tNP": ["Failed to authorize Google Drive. Please try again."], "09vHB+": ["Failed to decrypt."], "jK7nvW": ["Failed to disconnect wallet"], "9hzYBR": ["Failed to download and merge the backup: ", ["0"]], diff --git a/packages/mask/shared-ui/locale/ko-KR.po b/packages/mask/shared-ui/locale/ko-KR.po index 7a1e13e5d1e6..b2667e971839 100644 --- a/packages/mask/shared-ui/locale/ko-KR.po +++ b/packages/mask/shared-ui/locale/ko-KR.po @@ -304,6 +304,10 @@ msgstr "관련 계정" msgid "At least 6 characters" msgstr "최소 8 글자 이상 이용하세요" +#: dashboard/components/GoogleDriveLogin.tsx +msgid "Authorization Failed" +msgstr "" + #: popups/pages/Wallet/WalletSettings/AutoLock.tsx msgid "Auto-lock" msgstr "" @@ -326,8 +330,8 @@ msgstr "뒤로" #: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx -msgid "Back Up to Google Drive" -msgstr "" +#~ msgid "Back Up to Google Drive" +#~ msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/index.tsx @@ -335,6 +339,7 @@ msgid "Back Up Your Data Your Way" msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Personas/Logout/index.tsx #: popups/modals/SwitchPersonaModal/index.tsx @@ -372,7 +377,6 @@ msgstr "비밀번호 백업" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Settings/index.tsx #: popups/modals/SetBackupPasswordModal/index.tsx @@ -398,6 +402,11 @@ msgstr "페르소나 백업" msgid "Backup Successful" msgstr "" +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx +msgid "Backup to Google Drive" +msgstr "" + #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #~ msgid "Backup to Mask Cloud Service" #~ msgstr "" @@ -1016,7 +1025,6 @@ msgid "Download Backup" msgstr "백업 다운로드" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Downloading" msgstr "다운로드 중" @@ -1172,6 +1180,10 @@ msgstr "실패" msgid "Failed to add the wallet, please try again." msgstr "월렛 추가 실패, 다시 시도하기" +#: dashboard/components/GoogleDriveLogin.tsx +msgid "Failed to authorize Google Drive. Please try again." +msgstr "" + #: content-script/components/InjectedComponents/DecryptedPost/DecryptPostFailed.tsx msgid "Failed to decrypt." msgstr "" @@ -1182,7 +1194,6 @@ msgstr "" #. placeholder {0}: (err as Error).message #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Failed to download and merge the backup: {0}" msgstr "" @@ -1190,10 +1201,9 @@ msgstr "" #~ msgid "Failed to download and merge the backup." #~ msgstr "" -#. placeholder {0}: (err as Error).message #: dashboard/components/GoogleDriveLogin.tsx -msgid "Failed to login: {0}" -msgstr "" +#~ msgid "Failed to login: {0}" +#~ msgstr "" #: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx msgid "Failed to restore the backup from Google Drive to your browser. Please try again." @@ -1498,8 +1508,6 @@ msgstr "잘못된 백업 비밀번호." #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Incorrect cloud backup password, please try again." msgstr "잘못된 클라우드 백업 비밀번호입니다. 다시 시도하세요." @@ -1812,19 +1820,16 @@ msgid "Medium" msgstr "보통" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Merge Completed" msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Merge data to local database" msgstr "데이터를 로컬 데이터베이스에 병합하기" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #: dashboard/components/GoogleDriveFileTable.tsx msgid "Merge to Browser" msgstr "" @@ -2212,7 +2217,6 @@ msgid "Please enter backup password to export persona private key." msgstr "백업 비밀번호를 입력하고 페르소나 개인키를 내보낼 수 있습니다." #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Please enter cloud backup password to download file." msgstr "파일을 다운로드하려면 클라우드 백업 암호를 입력하세요." @@ -3327,7 +3331,6 @@ msgid "Your connection to this site is not encrypted which can be modified by a msgstr "" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Your file has been successfully merged into the browser data." msgstr "" diff --git a/packages/mask/shared-ui/locale/zh-CN.json b/packages/mask/shared-ui/locale/zh-CN.json index 34fd5d26de54..65095a8df361 100644 --- a/packages/mask/shared-ui/locale/zh-CN.json +++ b/packages/mask/shared-ui/locale/zh-CN.json @@ -106,6 +106,7 @@ "iTiwqa": ["Asset is hidden."], "2jQko7": ["关联账户"], "CEk7Nc": ["至少6个字符"], + "gp6A8z": ["Authorization Failed"], "Wvnsx1": ["自动锁定"], "7QptC5": ["自动锁定时间"], "nTFx7o": ["新头像设置成功"], @@ -124,6 +125,7 @@ "hUF4dG": ["备份密码设置成功。"], "UtKGok": ["备份身份"], "+m7x4e": ["Backup Successful"], + "3iUAE7": ["Backup to Google Drive"], "7Ry254": ["Backup to Mask Cloud Service"], "6IHgRq": ["Backup to the Cloud"], "QQPCqQ": ["备份钱包"], @@ -302,6 +304,7 @@ "GS+Mus": ["导出"], "7Bj3x9": ["失败"], "SLEDBF": ["添加钱包失败,请重试。"], + "r92tNP": ["Failed to authorize Google Drive. Please try again."], "09vHB+": ["Failed to decrypt."], "jK7nvW": ["Failed to disconnect wallet"], "9hzYBR": ["Failed to download and merge the backup: ", ["0"]], diff --git a/packages/mask/shared-ui/locale/zh-CN.po b/packages/mask/shared-ui/locale/zh-CN.po index 85960d50620e..eea429baead6 100644 --- a/packages/mask/shared-ui/locale/zh-CN.po +++ b/packages/mask/shared-ui/locale/zh-CN.po @@ -304,6 +304,10 @@ msgstr "关联账户" msgid "At least 6 characters" msgstr "至少6个字符" +#: dashboard/components/GoogleDriveLogin.tsx +msgid "Authorization Failed" +msgstr "" + #: popups/pages/Wallet/WalletSettings/AutoLock.tsx msgid "Auto-lock" msgstr "自动锁定" @@ -326,8 +330,8 @@ msgstr "返回" #: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx -msgid "Back Up to Google Drive" -msgstr "" +#~ msgid "Back Up to Google Drive" +#~ msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/index.tsx @@ -335,6 +339,7 @@ msgid "Back Up Your Data Your Way" msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Personas/Logout/index.tsx #: popups/modals/SwitchPersonaModal/index.tsx @@ -372,7 +377,6 @@ msgstr "备份密码" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Settings/index.tsx #: popups/modals/SetBackupPasswordModal/index.tsx @@ -398,6 +402,11 @@ msgstr "备份身份" msgid "Backup Successful" msgstr "" +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx +msgid "Backup to Google Drive" +msgstr "" + #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #~ msgid "Backup to Mask Cloud Service" #~ msgstr "" @@ -1016,7 +1025,6 @@ msgid "Download Backup" msgstr "下载备份" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Downloading" msgstr "正在下载" @@ -1172,6 +1180,10 @@ msgstr "失败" msgid "Failed to add the wallet, please try again." msgstr "添加钱包失败,请重试。" +#: dashboard/components/GoogleDriveLogin.tsx +msgid "Failed to authorize Google Drive. Please try again." +msgstr "" + #: content-script/components/InjectedComponents/DecryptedPost/DecryptPostFailed.tsx msgid "Failed to decrypt." msgstr "" @@ -1182,7 +1194,6 @@ msgstr "" #. placeholder {0}: (err as Error).message #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Failed to download and merge the backup: {0}" msgstr "" @@ -1190,10 +1201,9 @@ msgstr "" #~ msgid "Failed to download and merge the backup." #~ msgstr "" -#. placeholder {0}: (err as Error).message #: dashboard/components/GoogleDriveLogin.tsx -msgid "Failed to login: {0}" -msgstr "" +#~ msgid "Failed to login: {0}" +#~ msgstr "" #: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx msgid "Failed to restore the backup from Google Drive to your browser. Please try again." @@ -1498,8 +1508,6 @@ msgstr "备份密码错误。" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Incorrect cloud backup password, please try again." msgstr "云备份密码不正确,请重试。" @@ -1812,19 +1820,16 @@ msgid "Medium" msgstr "中等" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Merge Completed" msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Merge data to local database" msgstr "合并数据到本地数据库" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #: dashboard/components/GoogleDriveFileTable.tsx msgid "Merge to Browser" msgstr "" @@ -2212,7 +2217,6 @@ msgid "Please enter backup password to export persona private key." msgstr "请输入导出个人私钥的备份密码。" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Please enter cloud backup password to download file." msgstr "请输入云备份密码以下载文件。" @@ -3327,7 +3331,6 @@ msgid "Your connection to this site is not encrypted which can be modified by a msgstr "" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Your file has been successfully merged into the browser data." msgstr "" diff --git a/packages/mask/shared-ui/locale/zh-TW.json b/packages/mask/shared-ui/locale/zh-TW.json index 6f2fc5fb6ded..247d210dd4e4 100644 --- a/packages/mask/shared-ui/locale/zh-TW.json +++ b/packages/mask/shared-ui/locale/zh-TW.json @@ -106,6 +106,7 @@ "iTiwqa": ["Asset is hidden."], "2jQko7": ["关联账户"], "CEk7Nc": ["至少6个字符"], + "gp6A8z": ["Authorization Failed"], "Wvnsx1": ["自动锁定"], "7QptC5": ["自动锁定时间"], "nTFx7o": ["新头像设置成功"], @@ -124,6 +125,7 @@ "hUF4dG": ["备份密码设置成功。"], "UtKGok": ["备份身份"], "+m7x4e": ["Backup Successful"], + "3iUAE7": ["Backup to Google Drive"], "7Ry254": ["Backup to Mask Cloud Service"], "6IHgRq": ["Backup to the Cloud"], "QQPCqQ": ["备份钱包"], @@ -302,6 +304,7 @@ "GS+Mus": ["導出"], "7Bj3x9": ["失敗"], "SLEDBF": ["添加钱包失败,请重试。"], + "r92tNP": ["Failed to authorize Google Drive. Please try again."], "09vHB+": ["Failed to decrypt."], "jK7nvW": ["Failed to disconnect wallet"], "9hzYBR": ["Failed to download and merge the backup: ", ["0"]], diff --git a/packages/mask/shared-ui/locale/zh-TW.po b/packages/mask/shared-ui/locale/zh-TW.po index 3748bde2aca6..8edbdd7ba31c 100644 --- a/packages/mask/shared-ui/locale/zh-TW.po +++ b/packages/mask/shared-ui/locale/zh-TW.po @@ -304,6 +304,10 @@ msgstr "" msgid "At least 6 characters" msgstr "" +#: dashboard/components/GoogleDriveLogin.tsx +msgid "Authorization Failed" +msgstr "" + #: popups/pages/Wallet/WalletSettings/AutoLock.tsx msgid "Auto-lock" msgstr "" @@ -326,8 +330,8 @@ msgstr "返回" #: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx -msgid "Back Up to Google Drive" -msgstr "" +#~ msgid "Back Up to Google Drive" +#~ msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/index.tsx @@ -335,6 +339,7 @@ msgid "Back Up Your Data Your Way" msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Personas/Logout/index.tsx #: popups/modals/SwitchPersonaModal/index.tsx @@ -372,7 +377,6 @@ msgstr "備份密碼" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Settings/index.tsx #: popups/modals/SetBackupPasswordModal/index.tsx @@ -398,6 +402,11 @@ msgstr "" msgid "Backup Successful" msgstr "" +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx +msgid "Backup to Google Drive" +msgstr "" + #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #~ msgid "Backup to Mask Cloud Service" #~ msgstr "" @@ -1016,7 +1025,6 @@ msgid "Download Backup" msgstr "" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Downloading" msgstr "" @@ -1172,6 +1180,10 @@ msgstr "失敗" msgid "Failed to add the wallet, please try again." msgstr "" +#: dashboard/components/GoogleDriveLogin.tsx +msgid "Failed to authorize Google Drive. Please try again." +msgstr "" + #: content-script/components/InjectedComponents/DecryptedPost/DecryptPostFailed.tsx msgid "Failed to decrypt." msgstr "" @@ -1182,7 +1194,6 @@ msgstr "" #. placeholder {0}: (err as Error).message #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Failed to download and merge the backup: {0}" msgstr "" @@ -1190,10 +1201,9 @@ msgstr "" #~ msgid "Failed to download and merge the backup." #~ msgstr "" -#. placeholder {0}: (err as Error).message #: dashboard/components/GoogleDriveLogin.tsx -msgid "Failed to login: {0}" -msgstr "" +#~ msgid "Failed to login: {0}" +#~ msgstr "" #: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx msgid "Failed to restore the backup from Google Drive to your browser. Please try again." @@ -1498,8 +1508,6 @@ msgstr "" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Incorrect cloud backup password, please try again." msgstr "" @@ -1812,19 +1820,16 @@ msgid "Medium" msgstr "" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Merge Completed" msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Merge data to local database" msgstr "" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #: dashboard/components/GoogleDriveFileTable.tsx msgid "Merge to Browser" msgstr "" @@ -2212,7 +2217,6 @@ msgid "Please enter backup password to export persona private key." msgstr "" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Please enter cloud backup password to download file." msgstr "" @@ -3327,7 +3331,6 @@ msgid "Your connection to this site is not encrypted which can be modified by a msgstr "" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Your file has been successfully merged into the browser data." msgstr "" diff --git a/packages/mask/shared/helpers/checkAndRequestIdentityPermission.ts b/packages/mask/shared/helpers/checkAndRequestIdentityPermission.ts index b3c4f2a45d0d..dcd4dafe1067 100644 --- a/packages/mask/shared/helpers/checkAndRequestIdentityPermission.ts +++ b/packages/mask/shared/helpers/checkAndRequestIdentityPermission.ts @@ -1,6 +1,13 @@ +import { Environment, isEnvironment } from '@dimensiondev/holoflows-kit' import type { Manifest } from 'webextension-polyfill' export async function checkAndRequestPermission() { + if (!isEnvironment(Environment.ExtensionProtocol) && !isEnvironment(Environment.ManifestBackground)) { + // The User Activation limitation is from Firefox + throw new Error( + 'browser.permissions.request can only be called after a User Activation and from a chrome-extension:// protocol.', + ) + } const contained = await browser.permissions.contains({ permissions: ['identity'] }) if (!contained) { const granted = await browser.permissions.request({ permissions: ['identity' as Manifest.OptionalPermission] }) diff --git a/packages/mask/shared/helpers/index.ts b/packages/mask/shared/helpers/index.ts index 66661353b28d..0865dabd302d 100644 --- a/packages/mask/shared/helpers/index.ts +++ b/packages/mask/shared/helpers/index.ts @@ -1,3 +1,4 @@ export * from './download.js' export * from './formatTokenBalance.js' export * from './checkAndRequestIdentityPermission.js' +export * from './requestDriveAccessToken.js' diff --git a/packages/mask/shared/helpers/requestDriveAccessToken.ts b/packages/mask/shared/helpers/requestDriveAccessToken.ts new file mode 100644 index 000000000000..b66f6f0122b0 --- /dev/null +++ b/packages/mask/shared/helpers/requestDriveAccessToken.ts @@ -0,0 +1,29 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +import { Environment, isEnvironment } from '@dimensiondev/holoflows-kit' + +export async function requestDriveAccessToken(interactive = false) { + if (!isEnvironment(Environment.ExtensionProtocol) && !isEnvironment(Environment.ManifestBackground)) { + // The User Activation limitation is from Firefox + throw new Error( + 'browser.permissions.request can only be called after a User Activation and from a chrome-extension:// protocol.', + ) + } + return new Promise((resolve, reject) => { + // @ts-expect-error + chrome.identity.getAuthToken( + { + interactive, + scopes: ['https://www.googleapis.com/auth/drive.file', 'email'], + }, + (token: string) => { + // @ts-expect-error + if (chrome.runtime.lastError) { + // @ts-expect-error + reject(new Error(chrome.runtime.lastError.message)) + return + } + resolve(token) + }, + ) + }) +} diff --git a/packages/plugins/Collectible/src/SiteAdaptor/Card/CollectibleCard.tsx b/packages/plugins/Collectible/src/SiteAdaptor/Card/CollectibleCard.tsx index 43610b46cdbc..b2cbcfe0175d 100644 --- a/packages/plugins/Collectible/src/SiteAdaptor/Card/CollectibleCard.tsx +++ b/packages/plugins/Collectible/src/SiteAdaptor/Card/CollectibleCard.tsx @@ -9,6 +9,7 @@ const useStyles = makeStyles()((theme) => { height: '100%', borderRadius: 0, overflow: 'auto', + scrollbarWidth: 'none', '::-webkit-scrollbar': { display: 'none', }, diff --git a/packages/web3-providers/src/GoogleDriveClient/index.ts b/packages/web3-providers/src/GoogleDriveClient/index.ts index fb9da920c6db..33b1d923bc63 100644 --- a/packages/web3-providers/src/GoogleDriveClient/index.ts +++ b/packages/web3-providers/src/GoogleDriveClient/index.ts @@ -56,8 +56,16 @@ export class GoogleDriveClient { return userInfo } async logout() { - await this.clearToken() - this.callbacks.forEach((callback) => callback(false)) + try { + const token = await this.getToken() + const response = await fetch(`https://accounts.google.com/o/oauth2/revoke?token=${token}`) + if (!response.ok) { + const failedRes = await response.json() + console.error('Failed to revoke access token:', response.status, failedRes) + } + await this.clearToken() + this.callbacks.forEach((callback) => callback(false)) + } catch {} } private async request( input: string | URL | globalThis.Request, From ddabc6f0c67cce64866e4ebe25ef6c7857b6c56c Mon Sep 17 00:00:00 2001 From: Wukong Sun Date: Wed, 9 Apr 2025 11:10:18 +0800 Subject: [PATCH 09/20] fix: mf-6688 do not encrypt/decrypt with account for google drive (#12191) --- .../BackupPreviewDialog.tsx | 59 +++++++++++-------- .../RestoreBackupDialog.tsx | 20 +++++-- .../SetupPersona/Backup/Cloud/GoogleDrive.tsx | 10 ++-- .../SetupPersona/Backup/Cloud/Preview.tsx | 6 +- .../SetupPersona/CloudBackupPreview/index.tsx | 10 +--- .../Recovery/Cloud/GoogleDrive.tsx | 10 ++-- 6 files changed, 63 insertions(+), 52 deletions(-) diff --git a/packages/mask/dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx b/packages/mask/dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx index 6c5e0ccc2f9b..2e0e7c2adfe7 100644 --- a/packages/mask/dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx +++ b/packages/mask/dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx @@ -5,7 +5,6 @@ import { Trans } from '@lingui/react/macro' import { encryptBackup } from '@masknet/backup-format' import { Icons } from '@masknet/icons' import { InjectedDialog, LoadingStatus } from '@masknet/shared' -import type { BackupAccountType } from '@masknet/shared-base' import { DashboardRoutes } from '@masknet/shared-base' import { ActionButton, makeStyles, useCustomSnackbar } from '@masknet/theme' import { encode } from '@msgpack/msgpack' @@ -14,7 +13,6 @@ import { memo, useCallback, useMemo, useRef } from 'react' import { Controller } from 'react-hook-form' import { useNavigate } from 'react-router-dom' import { useAsyncFn, useUpdateEffect } from 'react-use' -import { UserContext } from '../../../shared-ui/index.js' import { PersonasBackupPreview, WalletsBackupPreview } from '../../components/BackupPreview/index.js' import PasswordField from '../../components/PasswordField/index.js' import { useBackupFormState, type BackupFormInputs } from '../../hooks/useBackupFormState.js' @@ -59,10 +57,12 @@ const useStyles = makeStyles()((theme) => ({ export interface BackupPreviewDialogProps { open: boolean isUpload?: boolean - code: string - type: BackupAccountType account: string - abstract?: string + /** + * MaskNetwork backup use account + password as password since legacy version. + * Will be removed in the future when we remove MaskNetwork backup. + */ + encryptWithAccount: boolean title?: React.ReactNode | string uploadButtonLabel?: React.ReactNode | string onClose: () => void @@ -71,10 +71,8 @@ export interface BackupPreviewDialogProps { export const BackupPreviewDialog = memo(function BackupPreviewDialog({ open, isUpload, - code, - type, account, - abstract, + encryptWithAccount, title, uploadButtonLabel, onClose, @@ -84,7 +82,6 @@ export const BackupPreviewDialog = memo(function Backu const controllerRef = useRef(null) const { classes, theme } = useStyles() const navigate = useNavigate() - const { updateUser } = UserContext.useContainer() const { hasPassword, backupWallets, @@ -117,7 +114,8 @@ export const BackupPreviewDialog = memo(function Backu excludeWallet: !backupWallets, }) - const encrypted = await encryptBackup(encode(account + data.backupPassword), encode(file)) + const password = encryptWithAccount ? account + data.backupPassword : data.backupPassword + const encrypted = await encryptBackup(encode(password), encode(file)) const controller = new AbortController() controllerRef.current = controller await onUpload?.(encrypted, controller.signal) @@ -132,7 +130,18 @@ export const BackupPreviewDialog = memo(function Backu if ((error as any).status === 400) navigate(DashboardRoutes.BackupCloud, { replace: true }) } }, - [code, hasPassword, backupWallets, abstract, code, account, type, _, navigate, updateUser], + [ + backupWallets, + hasPassword, + encryptWithAccount, + account, + onUpload, + showSnackbar, + onClose, + setError, + _, + navigate, + ], ) const handleClose = useCallback(() => { @@ -207,19 +216,21 @@ export const BackupPreviewDialog = memo(function Backu : }, [ + uploadLoading, + classes.container, + classes.icon, loading, previewInfo, control, - _, - errors.backupPassword?.message, - errors.paymentPassword?.message, backupWallets, setBackupWallets, + hasPassword, isUpload, - theme, - value, - uploadLoading, - classes, + theme.palette.maskColor.danger, + _, + errors.backupPassword?.message, + errors.paymentPassword?.message, + clearErrors, ]) const action = useMemo(() => { @@ -246,18 +257,16 @@ export const BackupPreviewDialog = memo(function Backu ) }, [ - backupWallets, - isUpload, - isDirty, - isValid, - hasPassword, - backupWallets, value, + onClose, uploadLoading, handleClose, handleSubmit, handleUploadBackup, - onClose, + isUpload, + isDirty, + isValid, + uploadButtonLabel, ]) return ( diff --git a/packages/mask/dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx b/packages/mask/dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx index facebb29f18d..ff321d8bf457 100644 --- a/packages/mask/dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx +++ b/packages/mask/dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx @@ -49,6 +49,11 @@ export interface RestoreBackupDialogProps { strategy?: 'import' | 'merge' restoreSuccessMessage?: ReactNode restoreErrorMessage?: ReactNode + /** + * MaskNetwork backup use account + password as password since legacy version. + * Will be removed in the future when we remove MaskNetwork backup. + */ + decryptWithAccount: boolean /** * A generator that yield progress of download, * and return the content of the downloaded file at the end @@ -61,6 +66,7 @@ export const RestoreBackupDialog = memo(function Resto open, fileName, account, + decryptWithAccount, uploadedAt, size, strategy = 'import', @@ -96,13 +102,14 @@ export const RestoreBackupDialog = memo(function Resto handleClose() throw err } - }, [handleClose, open, download]) + }, [open, download, showSnackbar, handleClose]) const isImport = strategy === 'import' const [{ loading }, handleRestore] = useAsyncFn(async () => { try { if (!encrypted) return - const decrypted = await decryptBackup(encode(account + backupPassword), encrypted) + const password = decryptWithAccount ? account + backupPassword : backupPassword + const decrypted = await decryptBackup(encode(password), encrypted) const backupJson = JSON.stringify(decode(decrypted)) const summary = await Services.Backup.generateBackupSummary(backupJson) if (summary.isErr()) { @@ -141,13 +148,14 @@ export const RestoreBackupDialog = memo(function Resto } }, [ encrypted, - backupPassword, + decryptWithAccount, account, - isImport, + backupPassword, showSnackbar, + isImport, restoreSuccessMessage, - restoreErrorMessage, onClose, + restoreErrorMessage, ]) return ( @@ -190,7 +198,7 @@ export const RestoreBackupDialog = memo(function Resto fontSize={12} lineHeight="16px" color={theme.palette.maskColor.third}> - {formatDateTime(new Date(Number(uploadedAt)), 'yyyy-mm-dd HH:mm')} + {formatDateTime(new Date(Number(uploadedAt)), 'yyyy-MM-dd HH:mm')} } diff --git a/packages/mask/dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx b/packages/mask/dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx index ed1507e9599b..493c6b3c621c 100644 --- a/packages/mask/dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx @@ -1,6 +1,6 @@ import { Trans } from '@lingui/react/macro' import { Icons } from '@masknet/icons' -import { BackupAccountType, EMPTY_LIST } from '@masknet/shared-base' +import { EMPTY_LIST } from '@masknet/shared-base' import { ActionButton, makeStyles } from '@masknet/theme' import { GoogleDriveClient, type DriveFile } from '@masknet/web3-providers' import { Box, Typography } from '@mui/material' @@ -89,7 +89,7 @@ export const Component = memo(function GoogleDriveBackup() { }) refetch() }, - [googleDriveClient], + [googleDriveClient, refetch], ) const [{ loading: logoutLoading }, logout] = useAsyncFn(async () => { @@ -98,7 +98,7 @@ export const Component = memo(function GoogleDriveBackup() { googleAccount: '', googleToken: '', }) - }, [googleDriveClient]) + }, [googleDriveClient, updateUser]) const mergedFiles = useMemo(() => uniqBy(compact([...files, uploadedFile]), (x) => x.id), [files, uploadedFile]) @@ -108,6 +108,7 @@ export const Component = memo(function GoogleDriveBackup() { const downloadAndMerge = async (file: DriveFile) => { await RestoreBackupModal.openAndWaitForClose({ + decryptWithAccount: false, strategy: 'merge', download: () => { return progressDownload(() => googleDriveClient.requestFile(file.id), file.size ? +file.size : 0) @@ -162,8 +163,7 @@ export const Component = memo(function GoogleDriveBackup() { onClick={() => { if (!user.googleAccount) return BackupPreviewModal.open({ - code: 'google-drive', - type: BackupAccountType.Email, + encryptWithAccount: false, account: user.googleAccount!, isUpload: true, title: Backup to Google Drive, diff --git a/packages/mask/dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx b/packages/mask/dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx index bd825d00501d..2d2dba5017f3 100644 --- a/packages/mask/dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx @@ -1,7 +1,6 @@ import { Trans } from '@lingui/react/macro' import { Icons } from '@masknet/icons' import { EmptyStatus, formatFileSize } from '@masknet/shared' -import type { BackupAccountType } from '@masknet/shared-base' import { DashboardRoutes } from '@masknet/shared-base' import { ActionButton, TextOverflowTooltip, makeStyles } from '@masknet/theme' import { Box, Button, Typography } from '@mui/material' @@ -84,6 +83,7 @@ export const Component = memo(function CloudBackupPreview() { const [{ loading: mergeLoading }, handleMergeClick] = useAsyncFn(async () => { if (!previewInfo.downloadLink || !previewInfo.account || !previewInfo.size || !previewInfo.uploadedAt) return await RestoreBackupModal.openAndWaitForClose({ + decryptWithAccount: true, strategy: 'merge', download: () => progressDownload(previewInfo.downloadLink), fileName: getFileName(previewInfo.downloadLink) || createBackupName(), @@ -96,10 +96,8 @@ export const Component = memo(function CloudBackupPreview() { const handleBackupClick = useCallback(() => { if (!previewInfo.type || !previewInfo.account || !previewInfo.code) return BackupPreviewModal.open({ + encryptWithAccount: true, isUpload: false, - code: previewInfo.code, - abstract: previewInfo.abstract ? previewInfo.abstract : undefined, - type: previewInfo.type as BackupAccountType, account: previewInfo.account, }) }, [previewInfo]) diff --git a/packages/mask/dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx b/packages/mask/dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx index 474f6f1e0b83..48fd170f185c 100644 --- a/packages/mask/dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx @@ -1,7 +1,6 @@ import { Trans } from '@lingui/react/macro' import { Icons } from '@masknet/icons' import { EmptyStatus, formatFileSize } from '@masknet/shared' -import type { BackupAccountType } from '@masknet/shared-base' import { DashboardRoutes } from '@masknet/shared-base' import { ActionButton, TextOverflowTooltip, makeStyles } from '@masknet/theme' import { Box, Typography } from '@mui/material' @@ -79,6 +78,7 @@ export const Component = memo(function CloudBackupPreview() { ) return await RestoreBackupModal.openAndWaitForClose({ + decryptWithAccount: true, strategy: 'merge', download: () => progressDownload(previewInfo.downloadLink), fileName: getFileName(previewInfo.downloadLink) || createBackupName(), @@ -91,10 +91,8 @@ export const Component = memo(function CloudBackupPreview() { const handleBackupClick = useCallback(() => { if (!previewInfo.type || !previewInfo.account || !previewInfo.code) return BackupPreviewModal.open({ + encryptWithAccount: true, isUpload: false, - code: previewInfo.code, - abstract: previewInfo.abstract ? previewInfo.abstract : undefined, - type: previewInfo.type as BackupAccountType, account: previewInfo.account, }) }, [previewInfo]) @@ -113,10 +111,8 @@ export const Component = memo(function CloudBackupPreview() { if (!previewInfo.type || !previewInfo.account || !previewInfo.code) return BackupPreviewModal.open({ + encryptWithAccount: true, isUpload: true, - code: previewInfo.code, - abstract: previewInfo.abstract ? previewInfo.abstract : undefined, - type: previewInfo.type as BackupAccountType, account: previewInfo.account, }) }, diff --git a/packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx b/packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx index fcdb3b84fbd8..bbe895fd8b21 100644 --- a/packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx @@ -88,6 +88,7 @@ export const Component = memo(function GoogleDriveRecovery() { const downloadAndMerge = async (file: DriveFile) => { await RestoreBackupModal.openAndWaitForClose({ + decryptWithAccount: false, strategy: 'merge', download: () => { return progressDownload(() => googleDriveClient.requestFile(file.id), file.size ? +file.size : 0) @@ -125,14 +126,12 @@ export const Component = memo(function GoogleDriveRecovery() { selectable selectedFileId={selectedFile?.id} onSelect={setSelectedFile} - onDownload={downloadAndMerge} - onMerge={async (file) => { + onMerge={downloadAndMerge} + onDownload={async (file) => { const blob = await googleDriveClient.downloadFile(file.id) const url = URL.createObjectURL(blob) downloadBackup(url, file.name) - Promise.resolve().then(() => { - URL.revokeObjectURL(url) - }) + URL.revokeObjectURL(url) }} /> @@ -146,6 +145,7 @@ export const Component = memo(function GoogleDriveRecovery() { onClick={async () => { if (!user.googleAccount || !selectedFile?.id) return const result = await RestoreBackupModal.openAndWaitForClose({ + decryptWithAccount: false, download: () => { return progressDownload( () => googleDriveClient.requestFile(selectedFile.id), From e0b3ae75304e25def9b8d77a51d91c0057530bff Mon Sep 17 00:00:00 2001 From: Wukong Sun Date: Wed, 9 Apr 2025 11:21:14 +0800 Subject: [PATCH 10/20] chore: remove unused legacy backup pages (#12192) --- .../SetupPersona/CloudBackup/EmailForm.tsx | 108 --------- .../SetupPersona/CloudBackup/PhoneForm.tsx | 108 --------- .../pages/SetupPersona/CloudBackup/index.tsx | 182 --------------- .../SetupPersona/CloudBackupPreview/index.tsx | 220 ------------------ .../pages/SetupPersona/LocalBackup/index.tsx | 153 ------------ .../dashboard/pages/SetupPersona/index.tsx | 3 - packages/mask/shared-ui/locale/en-US.po | 61 ++--- packages/mask/shared-ui/locale/ja-JP.po | 61 ++--- packages/mask/shared-ui/locale/ko-KR.po | 61 ++--- packages/mask/shared-ui/locale/zh-CN.po | 61 ++--- packages/mask/shared-ui/locale/zh-TW.po | 61 ++--- packages/shared-base/src/types/Routes.ts | 3 - 12 files changed, 80 insertions(+), 1002 deletions(-) delete mode 100644 packages/mask/dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx delete mode 100644 packages/mask/dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx delete mode 100644 packages/mask/dashboard/pages/SetupPersona/CloudBackup/index.tsx delete mode 100644 packages/mask/dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx delete mode 100644 packages/mask/dashboard/pages/SetupPersona/LocalBackup/index.tsx diff --git a/packages/mask/dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx b/packages/mask/dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx deleted file mode 100644 index 92a3d951db80..000000000000 --- a/packages/mask/dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx +++ /dev/null @@ -1,108 +0,0 @@ -import { Trans, useLingui } from '@lingui/react/macro' -import { BackupAccountType } from '@masknet/shared-base' -import { CountdownButton, makeStyles, useCustomSnackbar } from '@masknet/theme' -import { Box, TextField } from '@mui/material' -import { memo, useCallback } from 'react' -import { Controller } from 'react-hook-form' -import { UserContext, useLanguage } from '../../../../shared-ui/index.js' -import { CloudBackupFormContext } from '../../../contexts/CloudBackupFormContext.js' -import { sendCode } from '../../../utils/api.js' -import { Locale, Scenario } from '../../../utils/type.js' - -const useStyles = makeStyles()((theme) => ({ - send: { - color: theme.palette.maskColor.main, - fontSize: 14, - }, -})) - -export const EmailForm = memo(function EmailForm() { - const { t } = useLingui() - const language = useLanguage() - const { classes } = useStyles() - const { user } = UserContext.useContainer() - const { showSnackbar } = useCustomSnackbar() - const { - formState: { - clearErrors, - control, - watch, - trigger, - formState: { errors }, - }, - } = CloudBackupFormContext.useContainer() - - const email = watch('email') - - const handleSendVerificationCode = useCallback(async () => { - try { - const response = await sendCode({ - account: email, - type: BackupAccountType.Email, - scenario: user.email ? Scenario.change : Scenario.create, - locale: language.includes('zh') ? Locale.zh : Locale.en, - }) - - if (response) showSnackbar(Verification code sent, { variant: 'success' }) - } catch (error) { - const message = (error as any).message - showSnackbar( - message.includes('SendTemplatedEmail') ? Invalid email address format. : message, - { variant: 'error' }, - ) - } - }, [email, user, language]) - - return ( - - ( - clearErrors('email')} - onBlur={() => trigger('email')} - fullWidth - placeholder={t`Email`} - type="email" - error={!!errors.email?.message} - helperText={errors.email?.message} - /> - )} - /> - ( - clearErrors('code')} - fullWidth - placeholder={t`Email verification code`} - error={!!errors.code?.message} - helperText={errors.code?.message} - InputProps={{ - disableUnderline: true, - endAdornment: ( - Resend}> - Send - - ), - }} - /> - )} - /> - - ) -}) diff --git a/packages/mask/dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx b/packages/mask/dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx deleted file mode 100644 index 290350e53a24..000000000000 --- a/packages/mask/dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx +++ /dev/null @@ -1,108 +0,0 @@ -import { memo, useCallback } from 'react' -import { Controller } from 'react-hook-form' -import { Box, TextField } from '@mui/material' -import { PhoneNumberField } from '@masknet/shared' -import { CountdownButton, makeStyles, useCustomSnackbar } from '@masknet/theme' -import { UserContext, useLanguage } from '../../../../shared-ui/index.js' -import { CloudBackupFormContext } from '../../../contexts/CloudBackupFormContext.js' -import { BackupAccountType } from '@masknet/shared-base' -import { Scenario, Locale } from '../../../utils/type.js' -import { sendCode } from '../../../utils/api.js' -import { Trans, useLingui } from '@lingui/react/macro' - -const useStyles = makeStyles()((theme) => ({ - send: { - color: theme.palette.maskColor.main, - fontSize: 14, - }, -})) - -export const PhoneForm = memo(function PhoneForm() { - const { t } = useLingui() - const { classes } = useStyles() - const { user } = UserContext.useContainer() - const lang = useLanguage() - const { showSnackbar } = useCustomSnackbar() - - const { - formState: { - control, - clearErrors, - watch, - setValue, - formState: { errors }, - }, - } = CloudBackupFormContext.useContainer() - - const [countryCode, phone] = watch(['countryCode', 'phone']) - - const handleSendVerificationCode = useCallback(async () => { - try { - const response = await sendCode({ - account: `+${countryCode}${phone}`, - type: BackupAccountType.Phone, - scenario: user.phone ? Scenario.change : Scenario.create, - locale: lang.includes('zh') ? Locale.zh : Locale.en, - }) - - if (response) { - showSnackbar(Verification code sent, { variant: 'success' }) - } - } catch (error) { - showSnackbar((error as Error).message, { variant: 'error' }) - } - }, [phone, user, lang, countryCode]) - - return ( - - ( - setValue('countryCode', code)} - onFocus={() => clearErrors('phone')} - fullWidth - placeholder={t`Mobile number`} - error={!!errors.phone?.message} - helperText={errors.phone?.message} - /> - )} - /> - ( - clearErrors('code')} - fullWidth - placeholder={t`Phone verification code`} - error={!!errors.code?.message} - helperText={errors.code?.message} - InputProps={{ - disableUnderline: true, - endAdornment: ( - Resend}> - Send - - ), - }} - /> - )} - /> - - ) -}) diff --git a/packages/mask/dashboard/pages/SetupPersona/CloudBackup/index.tsx b/packages/mask/dashboard/pages/SetupPersona/CloudBackup/index.tsx deleted file mode 100644 index c69551403473..000000000000 --- a/packages/mask/dashboard/pages/SetupPersona/CloudBackup/index.tsx +++ /dev/null @@ -1,182 +0,0 @@ -import { memo, useMemo } from 'react' -import { useAsyncFn } from 'react-use' -import { useNavigate } from 'react-router-dom' -import urlcat from 'urlcat' -import { Typography, Box, Tab } from '@mui/material' -import { MaskTabList, makeStyles } from '@masknet/theme' -import { UserContext } from '../../../../shared-ui/index.js' -import { TabContext, TabPanel } from '@mui/lab' -import { EmailForm } from './EmailForm.js' -import { CloudBackupFormContext, type CloudBackupFormInputs } from '../../../contexts/CloudBackupFormContext.js' -import { SetupFrameController } from '../../../components/SetupFrame/index.js' -import { PrimaryButton } from '../../../components/PrimaryButton/index.js' -import { fetchDownloadLink } from '../../../utils/api.js' -import { BackupAccountType, DashboardRoutes } from '@masknet/shared-base' -import { PhoneForm } from './PhoneForm.js' -import { msg } from '@lingui/core/macro' -import { Trans } from '@lingui/react/macro' -import { useLingui } from '@lingui/react' - -const useStyles = makeStyles()((theme) => ({ - title: { - fontSize: 36, - lineHeight: 1.2, - fontWeight: 700, - }, - description: { - color: theme.palette.maskColor.second, - fontSize: 14, - marginTop: theme.spacing(1.5), - }, - tabContainer: { - border: `1px solid ${theme.palette.maskColor.line}`, - marginTop: theme.spacing(3), - borderRadius: theme.spacing(1, 1, 0, 0), - overflow: 'hidden', - marginBottom: 46, - }, - tabList: { - background: - theme.palette.mode === 'light' ? - 'linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 100%), linear-gradient(90deg, rgba(98, 152, 234, 0.2) 1.03%, rgba(98, 152, 234, 0.2) 1.04%, rgba(98, 126, 234, 0.2) 100%)' - : 'linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.06) 100%)', - padding: theme.spacing('14px', 2, 0), - }, - tab: { - fontSize: 16, - fontWeight: 700, - }, - panels: { - display: 'flex', - flexDirection: 'column', - alignItems: 'center', - padding: 0, - width: '100%', - }, - panelContainer: { - padding: theme.spacing(2), - }, -})) - -const CloudBackupInner = memo(function CloudBackupInner() { - const { _ } = useLingui() - const { classes } = useStyles() - const { user, updateUser } = UserContext.useContainer() - const navigate = useNavigate() - const tabPanelClasses = useMemo(() => ({ root: classes.panels }), [classes.panels]) - - const { currentTab, onChange, tabs, formState } = CloudBackupFormContext.useContainer() - - const [{ loading }, handleSubmit] = useAsyncFn( - async (data: CloudBackupFormInputs) => { - try { - const response = await fetchDownloadLink({ - account: currentTab === tabs.email ? data.email : `+${data.countryCode} ${data.phone}`, - type: currentTab === tabs.email ? BackupAccountType.Email : BackupAccountType.Phone, - code: data.code, - }) - - if (!response) return - - updateUser({ - email: data.email || user.email, - phone: data.phone ? `${data.countryCode} ${data.phone}` : user.phone, - }) - navigate( - urlcat(DashboardRoutes.CloudBackupPreview, { - ...response, - type: currentTab === tabs.email ? BackupAccountType.Email : BackupAccountType.Phone, - account: currentTab === tabs.email ? data.email : `+${data.countryCode} ${data.phone}`, - code: data.code, - }), - ) - } catch (error) { - if ((error as any).status === 400) { - formState.setError('code', { - type: 'custom', - message: _(msg`The code is incorrect.`), - }) - } else if ((error as any).status === 404) { - // No cloud backup file - navigate( - urlcat(DashboardRoutes.CloudBackupPreview, { - type: currentTab === tabs.email ? BackupAccountType.Email : BackupAccountType.Phone, - account: currentTab === tabs.email ? data.email : `+${data.countryCode} ${data.phone}`, - code: data.code, - }), - ) - } - } - }, - [_, currentTab, tabs, formState, navigate, updateUser, user], - ) - - const description = useMemo(() => { - if (user.cloudBackupMethod === BackupAccountType.Email && user.email) - return ( - - You used {user.email} for the last cloud backup. - - ) - if (user.cloudBackupMethod === BackupAccountType.Phone && user.phone) - return ( - - You used {user.email} for the last cloud backup. - - ) - - return Please use your frequently used email or phone number for backup. - }, [user]) - return ( - <> - - - Login to Mask Cloud - - {description} - - -
- { - onChange(_, value) - formState.reset() - }} - aria-label="Cloud Backup Methods"> - E-mail} value={tabs.email} /> - Mobile} value={tabs.mobile} /> - -
-
- - - - - - -
-
-
-
- - - Continue - - - - ) -}) - -export const Component = memo(function CloudBackup() { - return ( - - - - ) -}) diff --git a/packages/mask/dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx b/packages/mask/dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx deleted file mode 100644 index 48fd170f185c..000000000000 --- a/packages/mask/dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +++ /dev/null @@ -1,220 +0,0 @@ -import { Trans } from '@lingui/react/macro' -import { Icons } from '@masknet/icons' -import { EmptyStatus, formatFileSize } from '@masknet/shared' -import { DashboardRoutes } from '@masknet/shared-base' -import { ActionButton, TextOverflowTooltip, makeStyles } from '@masknet/theme' -import { Box, Typography } from '@mui/material' -import { format as formatDateTime, fromUnixTime } from 'date-fns' -import { memo, useCallback, useMemo } from 'react' -import { useNavigate, useSearchParams } from 'react-router-dom' -import { useAsyncFn } from 'react-use' -import { SetupFrameController } from '../../../components/SetupFrame/index.js' -import { BackupPreviewModal, ConfirmDialog, RestoreBackupModal } from '../../../modals/modals.js' -import { createBackupName, getFileName, progressDownload } from '../../../utils/api.js' - -const useStyles = makeStyles()((theme) => ({ - title: { - fontSize: 36, - lineHeight: 1.2, - fontWeight: 700, - }, - description: { - color: theme.palette.maskColor.second, - fontSize: 14, - marginTop: theme.spacing(1.5), - }, - text: { - fontSize: 14, - lineHeight: '18px', - fontWeight: 700, - }, - content: { - borderRadius: 8, - border: `1px solid ${theme.palette.maskColor.line}`, - padding: theme.spacing(2), - marginTop: theme.spacing(3), - display: 'flex', - columnGap: 8, - alignItems: 'center', - }, - button: { - height: 40, - borderRadius: 20, - }, - container: { - padding: theme.spacing(2), - borderRadius: 8, - border: `1px solid ${theme.palette.maskColor.line}`, - marginTop: theme.spacing(3), - }, -})) - -export const Component = memo(function CloudBackupPreview() { - const { classes, theme, cx } = useStyles() - const [params] = useSearchParams() - - const navigate = useNavigate() - - const previewInfo = useMemo(() => { - return { - account: params.get('account'), - downloadLink: params.get('downloadURL'), - abstract: params.get('abstract'), - uploadedAt: params.get('uploadedAt'), - size: params.get('size'), - type: params.get('type'), - code: params.get('code'), - } - }, [params]) - - const [{ loading: mergeLoading }, handleMergeClick] = useAsyncFn(async () => { - if ( - !previewInfo.downloadLink || - !previewInfo.account || - !previewInfo.size || - !previewInfo.uploadedAt || - !previewInfo.type || - !previewInfo.code - ) - return - await RestoreBackupModal.openAndWaitForClose({ - decryptWithAccount: true, - strategy: 'merge', - download: () => progressDownload(previewInfo.downloadLink), - fileName: getFileName(previewInfo.downloadLink) || createBackupName(), - account: previewInfo.account, - size: previewInfo.size, - uploadedAt: previewInfo.uploadedAt, - }) - }, [previewInfo]) - - const handleBackupClick = useCallback(() => { - if (!previewInfo.type || !previewInfo.account || !previewInfo.code) return - BackupPreviewModal.open({ - encryptWithAccount: true, - isUpload: false, - account: previewInfo.account, - }) - }, [previewInfo]) - - const [{ loading: overwriteLoading }, handleOverwriteClick] = useAsyncFn(async () => { - await ConfirmDialog.openAndWaitForClose({ - title: Overwrite current backup, - message: Are you sure to overwrite the backups stored on Mask Cloud Service?, - confirmLabel: Confirm, - cancelLabel: Cancel, - confirmButtonProps: { - color: 'error', - }, - onConfirm: () => { - ConfirmDialog.close(false) - if (!previewInfo.type || !previewInfo.account || !previewInfo.code) return - - BackupPreviewModal.open({ - encryptWithAccount: true, - isUpload: true, - account: previewInfo.account, - }) - }, - }) - }, [previewInfo]) - - return ( - <> - - - Back Up Your Data Your Way - - - - Choose from multiple backup options, now including encrypted storage via your authorized Google - Drive for added security and flexibility. - - - {previewInfo.downloadLink ? - <> - - {previewInfo.account} - navigate(DashboardRoutes.CloudBackup, { replace: true })}> - Switch other account - - - - - - - - {previewInfo.abstract} - - - - - - {formatFileSize(Number(previewInfo.size))} - - - {formatDateTime( - fromUnixTime(Number(previewInfo.uploadedAt)), - 'yyyy-MM-dd HH:mm', - )} - - - - - - } - color="primary" - className={classes.button} - loading={mergeLoading} - onClick={handleMergeClick}> - Merge data to local database - - } - color="error" - className={cx(classes.button)}> - Overwrite Backup - - - - - : - - {previewInfo.account} - navigate(DashboardRoutes.CloudBackup, { replace: true })}> - Switch other account - - - - No backups found - - - } - - {!previewInfo.downloadLink ? - - }> - Backup - - - : null} - - ) -}) diff --git a/packages/mask/dashboard/pages/SetupPersona/LocalBackup/index.tsx b/packages/mask/dashboard/pages/SetupPersona/LocalBackup/index.tsx deleted file mode 100644 index c4fe949a69ba..000000000000 --- a/packages/mask/dashboard/pages/SetupPersona/LocalBackup/index.tsx +++ /dev/null @@ -1,153 +0,0 @@ -import Services from '#services' -import { Trans, useLingui } from '@lingui/react/macro' -import { encryptBackup } from '@masknet/backup-format' -import { Icons } from '@masknet/icons' -import { LoadingStatus } from '@masknet/shared' -import { MimeType } from '@masknet/shared-base' -import { makeStyles } from '@masknet/theme' -import { encode } from '@msgpack/msgpack' -import { Box, Typography } from '@mui/material' -import { format as formatDateTime } from 'date-fns' -import { memo } from 'react' -import { Controller } from 'react-hook-form' -import { useAsyncFn } from 'react-use' -import { UserContext } from '../../../../shared-ui/index.js' -import { PersonasBackupPreview, WalletsBackupPreview } from '../../../components/BackupPreview/index.js' -import PasswordField from '../../../components/PasswordField/index.js' -import { PrimaryButton } from '../../../components/PrimaryButton/index.js' -import { SetupFrameController } from '../../../components/SetupFrame/index.js' -import { useBackupFormState, type BackupFormInputs } from '../../../hooks/useBackupFormState.js' -import { useBackupPreviewInfo } from '../../../hooks/useBackupPreviewInfo.js' - -const useStyles = makeStyles()((theme) => ({ - title: { - fontSize: 36, - lineHeight: 1.2, - fontWeight: 700, - }, - description: { - color: theme.palette.maskColor.second, - fontSize: 14, - marginTop: theme.spacing(1.5), - marginBottom: theme.spacing(3), - }, -})) - -export const Component = memo(function LocalBackup() { - const { t } = useLingui() - const { classes } = useStyles() - const { user, updateUser } = UserContext.useContainer() - const { - hasPassword, - backupWallets, - setBackupWallets, - formState: { - setError, - control, - handleSubmit, - clearErrors, - formState: { errors, isDirty, isValid }, - }, - } = useBackupFormState() - const { data: previewInfo, isLoading: loading } = useBackupPreviewInfo() - - const [{ loading: downloadLoading }, handleFormSubmit] = useAsyncFn( - async (data: BackupFormInputs) => { - if (backupWallets && hasPassword) { - const verified = await Services.Wallet.verifyPassword(data.paymentPassword || '') - if (!verified) { - setError('paymentPassword', { type: 'custom', message: t`Incorrect Password` }) - return - } - } - const { file } = await Services.Backup.createBackupFile({ - excludeBase: false, - excludeWallet: !backupWallets, - }) - - const encrypted = await encryptBackup(encode(data.backupPassword), encode(file)) - const now = formatDateTime(new Date(), 'yyyy-MM-dd HH:mm') - const blob = new Blob([encrypted], { type: MimeType.Binary }) - const url = URL.createObjectURL(blob) - const a = document.createElement('a') - a.href = url - a.download = `mask-network-keystore-backup-${now}.bin` - a.click() - - await updateUser({ - localBackupAt: now, - }) - - window.close() - }, - [backupWallets, hasPassword, setError, updateUser, user], - ) - - return ( - <> -
- - Select the contents of the backup - - - Please select the appropriate method to restore your personal data. - - {!loading && previewInfo ? - - - - ( - clearErrors()} - sx={{ mb: 2 }} - placeholder={t`Backup Password`} - error={!!errors.backupPassword?.message} - helperText={errors.backupPassword?.message} - /> - )} - name="backupPassword" - /> - - - - {backupWallets ? - ( - clearErrors()} - sx={{ mb: 2 }} - placeholder={t`Payment Password`} - error={!!errors.paymentPassword?.message} - helperText={errors.paymentPassword?.message} - /> - )} - name="paymentPassword" - /> - : null} - - : } - - - } - size="large" - color="primary" - loading={downloadLoading} - disabled={!isDirty || !isValid} - onClick={handleSubmit(handleFormSubmit)}> - Download Backup - - - - ) -}) diff --git a/packages/mask/dashboard/pages/SetupPersona/index.tsx b/packages/mask/dashboard/pages/SetupPersona/index.tsx index 366126ebe7c2..2c4bade8bcb8 100644 --- a/packages/mask/dashboard/pages/SetupPersona/index.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/index.tsx @@ -87,9 +87,6 @@ export const personaRoutes: RouteObject[] = [ }, ], }, - { path: r(Routes.LocalBackup), lazy: () => import('./LocalBackup/index.js') }, - { path: r(Routes.CloudBackup), lazy: () => import('./CloudBackup/index.js') }, - { path: r(Routes.CloudBackupPreview), lazy: () => import('./CloudBackupPreview/index.js') }, ] export function PersonaFrame() { const matchPersonaOnboarding = useMatch(DashboardRoutes.SignUpPersonaOnboarding) diff --git a/packages/mask/shared-ui/locale/en-US.po b/packages/mask/shared-ui/locale/en-US.po index 9dd1ff979c87..3610bd5de8ae 100644 --- a/packages/mask/shared-ui/locale/en-US.po +++ b/packages/mask/shared-ui/locale/en-US.po @@ -265,8 +265,8 @@ msgid "Approve amount" msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -msgid "Are you sure to overwrite the backups stored on Mask Cloud Service?" -msgstr "" +#~ msgid "Are you sure to overwrite the backups stored on Mask Cloud Service?" +#~ msgstr "" #. placeholder {0}: formatEthereumAddress(wallet.identity, 4) #: popups/components/ConnectedWallet/index.tsx @@ -328,12 +328,10 @@ msgstr "" #~ msgid "Back Up to Google Drive" #~ msgstr "" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/index.tsx msgid "Back Up Your Data Your Way" msgstr "" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Personas/Logout/index.tsx @@ -369,7 +367,6 @@ msgstr "" msgid "Backup password" msgstr "" -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx @@ -471,7 +468,6 @@ msgstr "" #: content-script/components/InjectedComponents/SelectPeopleDialog.tsx #: dashboard/pages/SetupPersona/Welcome/index.tsx #: dashboard/pages/SetupPersona/Permissions/index.tsx -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/modals/ConfirmModal/index.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: dashboard/components/Restore/ConfirmSynchronizePasswordDialog.tsx @@ -544,7 +540,6 @@ msgstr "" msgid "Choose another wallet" msgstr "" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/index.tsx msgid "Choose from multiple backup options, now including encrypted storage via your authorized Google Drive for added security and flexibility." msgstr "" @@ -593,7 +588,6 @@ msgstr "" msgid "Completed" msgstr "" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/modals/ConfirmModal/index.tsx #: dashboard/components/Restore/ConfirmSynchronizePasswordDialog.tsx #: popups/pages/Wallet/components/DisconnectModal/index.tsx @@ -753,7 +747,6 @@ msgstr "" #: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx #: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx #: dashboard/pages/SetupPersona/Mnemonic/index.tsx -#: dashboard/pages/SetupPersona/CloudBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx #: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx #: dashboard/pages/CreateMaskWallet/AddDeriveWallet/index.tsx @@ -1014,7 +1007,6 @@ msgstr "" #~ msgid "Download backup" #~ msgstr "" -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx msgid "Download Backup" msgstr "" @@ -1028,8 +1020,8 @@ msgid "Drag & Drop your file here" msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -msgid "E-mail" -msgstr "" +#~ msgid "E-mail" +#~ msgstr "" #: popups/pages/Wallet/ContactList/index.tsx msgid "Edit" @@ -1045,14 +1037,12 @@ msgid "eg: X accounts, persona public keys, wallet addresses or ENS" msgstr "" #: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Email" msgstr "" #: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Email verification code" msgstr "" @@ -1520,7 +1510,6 @@ msgstr "" msgid "Incorrect password" msgstr "" -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: dashboard/hooks/useBackupFormState.ts @@ -1577,7 +1566,6 @@ msgstr "" msgid "Invalid Block Explorer URL." msgstr "" -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx @@ -1697,8 +1685,8 @@ msgid "Log out" msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -msgid "Login to Mask Cloud" -msgstr "" +#~ msgid "Login to Mask Cloud" +#~ msgstr "" #: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx @@ -1818,7 +1806,6 @@ msgstr "" msgid "Merge Completed" msgstr "" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx msgid "Merge data to local database" @@ -1846,12 +1833,10 @@ msgstr "" msgid "Mnemonic word" msgstr "" -#: dashboard/pages/SetupPersona/CloudBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx msgid "Mobile" msgstr "" -#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx msgid "Mobile number" msgstr "" @@ -1969,7 +1954,6 @@ msgstr "" msgid "No back up" msgstr "" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx #: dashboard/components/GoogleDriveFileTable.tsx msgid "No backups found" @@ -2084,12 +2068,12 @@ msgid "Other social networking platforms, such as <0>Instagram, <1>Facebook, msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -msgid "Overwrite Backup" -msgstr "" +#~ msgid "Overwrite Backup" +#~ msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -msgid "Overwrite current backup" -msgstr "" +#~ msgid "Overwrite current backup" +#~ msgstr "" #: popups/modals/VerifyBackupPasswordModal/index.tsx #: popups/modals/SetBackupPasswordModal/index.tsx @@ -2101,7 +2085,6 @@ msgstr "" msgid "Paste manually" msgstr "" -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Wallet/SetPaymentPassword/index.tsx @@ -2183,7 +2166,6 @@ msgstr "" msgid "Personas" msgstr "" -#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx msgid "Phone verification code" msgstr "" @@ -2239,7 +2221,6 @@ msgid "Please note: This Persona {0} is the management account of above listed S msgstr "" #: dashboard/pages/SetupPersona/Recovery/index.tsx -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx msgid "Please select the appropriate method to restore your personal data." msgstr "" @@ -2269,8 +2250,8 @@ msgid "Please switch to <0>@{expectAccount} to continue the account verifica msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -msgid "Please use your frequently used email or phone number for backup." -msgstr "" +#~ msgid "Please use your frequently used email or phone number for backup." +#~ msgstr "" #: dashboard/pages/CreateMaskWallet/CreateMnemonic/index.tsx msgid "Please write down or copy these words and save them in a secure place." @@ -2437,8 +2418,6 @@ msgid "Reselect" msgstr "" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx -#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Resend" @@ -2549,8 +2528,8 @@ msgid "Select Liquidity" msgstr "" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -msgid "Select the contents of the backup" -msgstr "" +#~ msgid "Select the contents of the backup" +#~ msgstr "" #: popups/pages/Wallet/Interaction/PermissionRequest.tsx msgid "Select the wallet(s) to use on this site. You should not connect to website you don't trust." @@ -2561,8 +2540,6 @@ msgid "Select Wallet" msgstr "" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx -#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx #: popups/pages/Wallet/components/ActivityList/ActivityItem.tsx @@ -2766,8 +2743,6 @@ msgstr "" msgid "Swap" msgstr "" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx msgid "Switch other account" msgstr "" @@ -2805,7 +2780,6 @@ msgstr "" msgid "The chainID is not equal to the currently connected one." msgstr "" -#: dashboard/pages/SetupPersona/CloudBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts #: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts @@ -3146,8 +3120,6 @@ msgstr "" msgid "Verification code has been sent to your phone." msgstr "" -#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Verification code sent" @@ -3315,11 +3287,10 @@ msgstr "" msgid "You need to open the dApp to view the specific content." msgstr "" -#. placeholder {0}: user.email #: dashboard/pages/SetupPersona/CloudBackup/index.tsx #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -msgid "You used <0>{0} for the last cloud backup." -msgstr "" +#~ msgid "You used <0>{0} for the last cloud backup." +#~ msgstr "" #: popups/components/SignRequestInfo/index.tsx msgid "Your connection to this site is not encrypted which can be modified by a hostile third party, we strongly suggest you reject this request." diff --git a/packages/mask/shared-ui/locale/ja-JP.po b/packages/mask/shared-ui/locale/ja-JP.po index 9435003f2f69..ed982eee0834 100644 --- a/packages/mask/shared-ui/locale/ja-JP.po +++ b/packages/mask/shared-ui/locale/ja-JP.po @@ -270,8 +270,8 @@ msgid "Approve amount" msgstr "承認金額" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -msgid "Are you sure to overwrite the backups stored on Mask Cloud Service?" -msgstr "" +#~ msgid "Are you sure to overwrite the backups stored on Mask Cloud Service?" +#~ msgstr "" #. placeholder {0}: formatEthereumAddress(wallet.identity, 4) #: popups/components/ConnectedWallet/index.tsx @@ -333,12 +333,10 @@ msgstr "" #~ msgid "Back Up to Google Drive" #~ msgstr "" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/index.tsx msgid "Back Up Your Data Your Way" msgstr "" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Personas/Logout/index.tsx @@ -374,7 +372,6 @@ msgstr "" msgid "Backup password" msgstr "バックアップパスワード" -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx @@ -476,7 +473,6 @@ msgstr "" #: content-script/components/InjectedComponents/SelectPeopleDialog.tsx #: dashboard/pages/SetupPersona/Welcome/index.tsx #: dashboard/pages/SetupPersona/Permissions/index.tsx -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/modals/ConfirmModal/index.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: dashboard/components/Restore/ConfirmSynchronizePasswordDialog.tsx @@ -549,7 +545,6 @@ msgstr "支払いパスワードを変更する" msgid "Choose another wallet" msgstr "他のウォレットを選択してください" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/index.tsx msgid "Choose from multiple backup options, now including encrypted storage via your authorized Google Drive for added security and flexibility." msgstr "" @@ -598,7 +593,6 @@ msgstr "近日公開" msgid "Completed" msgstr "完了しました" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/modals/ConfirmModal/index.tsx #: dashboard/components/Restore/ConfirmSynchronizePasswordDialog.tsx #: popups/pages/Wallet/components/DisconnectModal/index.tsx @@ -758,7 +752,6 @@ msgstr "コンタクト" #: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx #: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx #: dashboard/pages/SetupPersona/Mnemonic/index.tsx -#: dashboard/pages/SetupPersona/CloudBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx #: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx #: dashboard/pages/CreateMaskWallet/AddDeriveWallet/index.tsx @@ -1019,7 +1012,6 @@ msgstr "ダウンロード" #~ msgid "Download backup" #~ msgstr "" -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx msgid "Download Backup" msgstr "バックアップのダウンロード" @@ -1033,8 +1025,8 @@ msgid "Drag & Drop your file here" msgstr "ここにファイルをドラッグ&ドロップしてください" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -msgid "E-mail" -msgstr "メールアドレス" +#~ msgid "E-mail" +#~ msgstr "メールアドレス" #: popups/pages/Wallet/ContactList/index.tsx msgid "Edit" @@ -1050,14 +1042,12 @@ msgid "eg: X accounts, persona public keys, wallet addresses or ENS" msgstr "" #: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Email" msgstr "メールアドレス" #: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Email verification code" msgstr "電子メール検証コード" @@ -1525,7 +1515,6 @@ msgstr "" msgid "Incorrect password" msgstr "パスワードが間違っています" -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: dashboard/hooks/useBackupFormState.ts @@ -1582,7 +1571,6 @@ msgstr "手数料付けるには残高が足りません" msgid "Invalid Block Explorer URL." msgstr "無効なブロックエクスプローラのURLです。" -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx @@ -1702,8 +1690,8 @@ msgid "Log out" msgstr "ログアウト" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -msgid "Login to Mask Cloud" -msgstr "" +#~ msgid "Login to Mask Cloud" +#~ msgstr "" #: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx @@ -1823,7 +1811,6 @@ msgstr "中間" msgid "Merge Completed" msgstr "" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx msgid "Merge data to local database" @@ -1851,12 +1838,10 @@ msgstr "ニーモニック" msgid "Mnemonic word" msgstr "ニーモニック単語" -#: dashboard/pages/SetupPersona/CloudBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx msgid "Mobile" msgstr "モバイル" -#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx msgid "Mobile number" msgstr "携帯番号" @@ -1974,7 +1959,6 @@ msgstr "" msgid "No back up" msgstr "バックアップはありません" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx #: dashboard/components/GoogleDriveFileTable.tsx msgid "No backups found" @@ -2089,12 +2073,12 @@ msgid "Other social networking platforms, such as <0>Instagram, <1>Facebook, msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -msgid "Overwrite Backup" -msgstr "バックアップを上書き" +#~ msgid "Overwrite Backup" +#~ msgstr "バックアップを上書き" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -msgid "Overwrite current backup" -msgstr "既存のバックアップを上書き" +#~ msgid "Overwrite current backup" +#~ msgstr "既存のバックアップを上書き" #: popups/modals/VerifyBackupPasswordModal/index.tsx #: popups/modals/SetBackupPasswordModal/index.tsx @@ -2106,7 +2090,6 @@ msgstr "パスワード" msgid "Paste manually" msgstr "手動でペーストする" -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Wallet/SetPaymentPassword/index.tsx @@ -2188,7 +2171,6 @@ msgstr "" msgid "Personas" msgstr "ペルソナ" -#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx msgid "Phone verification code" msgstr "モバイル認証コード" @@ -2244,7 +2226,6 @@ msgid "Please note: This Persona {0} is the management account of above listed S msgstr "" #: dashboard/pages/SetupPersona/Recovery/index.tsx -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx msgid "Please select the appropriate method to restore your personal data." msgstr "12単語の復元フレーズは、ペルソナデータを回復するために使用されます。" @@ -2274,8 +2255,8 @@ msgid "Please switch to <0>@{expectAccount} to continue the account verifica msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -msgid "Please use your frequently used email or phone number for backup." -msgstr "" +#~ msgid "Please use your frequently used email or phone number for backup." +#~ msgstr "" #: dashboard/pages/CreateMaskWallet/CreateMnemonic/index.tsx msgid "Please write down or copy these words and save them in a secure place." @@ -2442,8 +2423,6 @@ msgid "Reselect" msgstr "選びなおす" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx -#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Resend" @@ -2554,8 +2533,8 @@ msgid "Select Liquidity" msgstr "" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -msgid "Select the contents of the backup" -msgstr "バックアップの内容を選択します" +#~ msgid "Select the contents of the backup" +#~ msgstr "バックアップの内容を選択します" #: popups/pages/Wallet/Interaction/PermissionRequest.tsx msgid "Select the wallet(s) to use on this site. You should not connect to website you don't trust." @@ -2566,8 +2545,6 @@ msgid "Select Wallet" msgstr "ウォレットを選択" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx -#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx #: popups/pages/Wallet/components/ActivityList/ActivityItem.tsx @@ -2771,8 +2748,6 @@ msgstr "サポートされるサイト" msgid "Swap" msgstr "" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx msgid "Switch other account" msgstr "他のアカウントを切り替え" @@ -2810,7 +2785,6 @@ msgstr "" msgid "The chainID is not equal to the currently connected one." msgstr "chainIDは現在接続されているものと等しくありません。" -#: dashboard/pages/SetupPersona/CloudBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts #: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts @@ -3151,8 +3125,6 @@ msgstr "" msgid "Verification code has been sent to your phone." msgstr "" -#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Verification code sent" @@ -3320,11 +3292,10 @@ msgstr "" msgid "You need to open the dApp to view the specific content." msgstr "" -#. placeholder {0}: user.email #: dashboard/pages/SetupPersona/CloudBackup/index.tsx #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -msgid "You used <0>{0} for the last cloud backup." -msgstr "" +#~ msgid "You used <0>{0} for the last cloud backup." +#~ msgstr "" #: popups/components/SignRequestInfo/index.tsx msgid "Your connection to this site is not encrypted which can be modified by a hostile third party, we strongly suggest you reject this request." diff --git a/packages/mask/shared-ui/locale/ko-KR.po b/packages/mask/shared-ui/locale/ko-KR.po index b2667e971839..c783f236b6c8 100644 --- a/packages/mask/shared-ui/locale/ko-KR.po +++ b/packages/mask/shared-ui/locale/ko-KR.po @@ -270,8 +270,8 @@ msgid "Approve amount" msgstr "금액 승인" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -msgid "Are you sure to overwrite the backups stored on Mask Cloud Service?" -msgstr "" +#~ msgid "Are you sure to overwrite the backups stored on Mask Cloud Service?" +#~ msgstr "" #. placeholder {0}: formatEthereumAddress(wallet.identity, 4) #: popups/components/ConnectedWallet/index.tsx @@ -333,12 +333,10 @@ msgstr "뒤로" #~ msgid "Back Up to Google Drive" #~ msgstr "" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/index.tsx msgid "Back Up Your Data Your Way" msgstr "" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Personas/Logout/index.tsx @@ -374,7 +372,6 @@ msgstr "백업 시간 {0}" msgid "Backup password" msgstr "비밀번호 백업" -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx @@ -476,7 +473,6 @@ msgstr "" #: content-script/components/InjectedComponents/SelectPeopleDialog.tsx #: dashboard/pages/SetupPersona/Welcome/index.tsx #: dashboard/pages/SetupPersona/Permissions/index.tsx -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/modals/ConfirmModal/index.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: dashboard/components/Restore/ConfirmSynchronizePasswordDialog.tsx @@ -549,7 +545,6 @@ msgstr "결제 비밀번호 변경" msgid "Choose another wallet" msgstr "다른 월렛을 선택하세요" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/index.tsx msgid "Choose from multiple backup options, now including encrypted storage via your authorized Google Drive for added security and flexibility." msgstr "" @@ -598,7 +593,6 @@ msgstr "" msgid "Completed" msgstr "완료됨" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/modals/ConfirmModal/index.tsx #: dashboard/components/Restore/ConfirmSynchronizePasswordDialog.tsx #: popups/pages/Wallet/components/DisconnectModal/index.tsx @@ -758,7 +752,6 @@ msgstr "연락처" #: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx #: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx #: dashboard/pages/SetupPersona/Mnemonic/index.tsx -#: dashboard/pages/SetupPersona/CloudBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx #: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx #: dashboard/pages/CreateMaskWallet/AddDeriveWallet/index.tsx @@ -1019,7 +1012,6 @@ msgstr "다운로드" #~ msgid "Download backup" #~ msgstr "" -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx msgid "Download Backup" msgstr "백업 다운로드" @@ -1033,8 +1025,8 @@ msgid "Drag & Drop your file here" msgstr "파일을 끌어서 여기에 놓으세요" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -msgid "E-mail" -msgstr "이메일" +#~ msgid "E-mail" +#~ msgstr "이메일" #: popups/pages/Wallet/ContactList/index.tsx msgid "Edit" @@ -1050,14 +1042,12 @@ msgid "eg: X accounts, persona public keys, wallet addresses or ENS" msgstr "" #: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Email" msgstr "이메일" #: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Email verification code" msgstr "메일 인증번호" @@ -1525,7 +1515,6 @@ msgstr "" msgid "Incorrect password" msgstr "잘못된 비밀번호" -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: dashboard/hooks/useBackupFormState.ts @@ -1582,7 +1571,6 @@ msgstr "자산이나 가스비가 부족합니다." msgid "Invalid Block Explorer URL." msgstr "무효한 Block Explorer URL." -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx @@ -1702,8 +1690,8 @@ msgid "Log out" msgstr "로그아웃" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -msgid "Login to Mask Cloud" -msgstr "" +#~ msgid "Login to Mask Cloud" +#~ msgstr "" #: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx @@ -1823,7 +1811,6 @@ msgstr "보통" msgid "Merge Completed" msgstr "" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx msgid "Merge data to local database" @@ -1851,12 +1838,10 @@ msgstr "니모닉" msgid "Mnemonic word" msgstr "니모닉 단어" -#: dashboard/pages/SetupPersona/CloudBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx msgid "Mobile" msgstr "모바일" -#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx msgid "Mobile number" msgstr "휴대폰 번호" @@ -1974,7 +1959,6 @@ msgstr "" msgid "No back up" msgstr "백업 없음" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx #: dashboard/components/GoogleDriveFileTable.tsx msgid "No backups found" @@ -2089,12 +2073,12 @@ msgid "Other social networking platforms, such as <0>Instagram, <1>Facebook, msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -msgid "Overwrite Backup" -msgstr "백업 덮어쓰기" +#~ msgid "Overwrite Backup" +#~ msgstr "백업 덮어쓰기" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -msgid "Overwrite current backup" -msgstr "기존 백업 덮어쓰기" +#~ msgid "Overwrite current backup" +#~ msgstr "기존 백업 덮어쓰기" #: popups/modals/VerifyBackupPasswordModal/index.tsx #: popups/modals/SetBackupPasswordModal/index.tsx @@ -2106,7 +2090,6 @@ msgstr "비밀번호" msgid "Paste manually" msgstr "수동으로 붙여넣기" -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Wallet/SetPaymentPassword/index.tsx @@ -2188,7 +2171,6 @@ msgstr "" msgid "Personas" msgstr "나의 페르소나" -#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx msgid "Phone verification code" msgstr "" @@ -2244,7 +2226,6 @@ msgid "Please note: This Persona {0} is the management account of above listed S msgstr "" #: dashboard/pages/SetupPersona/Recovery/index.tsx -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx msgid "Please select the appropriate method to restore your personal data." msgstr "12개 복구 문구로 페르소나 데어터를 복구할 수 있습니다." @@ -2274,8 +2255,8 @@ msgid "Please switch to <0>@{expectAccount} to continue the account verifica msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -msgid "Please use your frequently used email or phone number for backup." -msgstr "" +#~ msgid "Please use your frequently used email or phone number for backup." +#~ msgstr "" #: dashboard/pages/CreateMaskWallet/CreateMnemonic/index.tsx msgid "Please write down or copy these words and save them in a secure place." @@ -2442,8 +2423,6 @@ msgid "Reselect" msgstr "다시 선택" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx -#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Resend" @@ -2554,8 +2533,8 @@ msgid "Select Liquidity" msgstr "" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -msgid "Select the contents of the backup" -msgstr "백업 내용을 선택하세요." +#~ msgid "Select the contents of the backup" +#~ msgstr "백업 내용을 선택하세요." #: popups/pages/Wallet/Interaction/PermissionRequest.tsx msgid "Select the wallet(s) to use on this site. You should not connect to website you don't trust." @@ -2566,8 +2545,6 @@ msgid "Select Wallet" msgstr "월렛 선택" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx -#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx #: popups/pages/Wallet/components/ActivityList/ActivityItem.tsx @@ -2771,8 +2748,6 @@ msgstr "지원되는 사이트" msgid "Swap" msgstr "" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx msgid "Switch other account" msgstr "사용자 계정 전환" @@ -2810,7 +2785,6 @@ msgstr "" msgid "The chainID is not equal to the currently connected one." msgstr "" -#: dashboard/pages/SetupPersona/CloudBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts #: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts @@ -3151,8 +3125,6 @@ msgstr "" msgid "Verification code has been sent to your phone." msgstr "" -#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Verification code sent" @@ -3320,11 +3292,10 @@ msgstr "" msgid "You need to open the dApp to view the specific content." msgstr "" -#. placeholder {0}: user.email #: dashboard/pages/SetupPersona/CloudBackup/index.tsx #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -msgid "You used <0>{0} for the last cloud backup." -msgstr "" +#~ msgid "You used <0>{0} for the last cloud backup." +#~ msgstr "" #: popups/components/SignRequestInfo/index.tsx msgid "Your connection to this site is not encrypted which can be modified by a hostile third party, we strongly suggest you reject this request." diff --git a/packages/mask/shared-ui/locale/zh-CN.po b/packages/mask/shared-ui/locale/zh-CN.po index eea429baead6..a49057f37027 100644 --- a/packages/mask/shared-ui/locale/zh-CN.po +++ b/packages/mask/shared-ui/locale/zh-CN.po @@ -270,8 +270,8 @@ msgid "Approve amount" msgstr "已批准的金额" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -msgid "Are you sure to overwrite the backups stored on Mask Cloud Service?" -msgstr "" +#~ msgid "Are you sure to overwrite the backups stored on Mask Cloud Service?" +#~ msgstr "" #. placeholder {0}: formatEthereumAddress(wallet.identity, 4) #: popups/components/ConnectedWallet/index.tsx @@ -333,12 +333,10 @@ msgstr "返回" #~ msgid "Back Up to Google Drive" #~ msgstr "" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/index.tsx msgid "Back Up Your Data Your Way" msgstr "" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Personas/Logout/index.tsx @@ -374,7 +372,6 @@ msgstr "" msgid "Backup password" msgstr "备份密码" -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx @@ -476,7 +473,6 @@ msgstr "" #: content-script/components/InjectedComponents/SelectPeopleDialog.tsx #: dashboard/pages/SetupPersona/Welcome/index.tsx #: dashboard/pages/SetupPersona/Permissions/index.tsx -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/modals/ConfirmModal/index.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: dashboard/components/Restore/ConfirmSynchronizePasswordDialog.tsx @@ -549,7 +545,6 @@ msgstr "修改支付密码" msgid "Choose another wallet" msgstr "切换钱包" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/index.tsx msgid "Choose from multiple backup options, now including encrypted storage via your authorized Google Drive for added security and flexibility." msgstr "" @@ -598,7 +593,6 @@ msgstr "即将上线" msgid "Completed" msgstr "已完成" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/modals/ConfirmModal/index.tsx #: dashboard/components/Restore/ConfirmSynchronizePasswordDialog.tsx #: popups/pages/Wallet/components/DisconnectModal/index.tsx @@ -758,7 +752,6 @@ msgstr "联系人" #: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx #: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx #: dashboard/pages/SetupPersona/Mnemonic/index.tsx -#: dashboard/pages/SetupPersona/CloudBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx #: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx #: dashboard/pages/CreateMaskWallet/AddDeriveWallet/index.tsx @@ -1019,7 +1012,6 @@ msgstr "下载" #~ msgid "Download backup" #~ msgstr "" -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx msgid "Download Backup" msgstr "下载备份" @@ -1033,8 +1025,8 @@ msgid "Drag & Drop your file here" msgstr "将您的文件拖放到此处" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -msgid "E-mail" -msgstr "电子邮件" +#~ msgid "E-mail" +#~ msgstr "电子邮件" #: popups/pages/Wallet/ContactList/index.tsx msgid "Edit" @@ -1050,14 +1042,12 @@ msgid "eg: X accounts, persona public keys, wallet addresses or ENS" msgstr "" #: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Email" msgstr "电子邮箱" #: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Email verification code" msgstr "邮箱验证码" @@ -1525,7 +1515,6 @@ msgstr "" msgid "Incorrect password" msgstr "密码不正确" -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: dashboard/hooks/useBackupFormState.ts @@ -1582,7 +1571,6 @@ msgstr "Gas 不足。" msgid "Invalid Block Explorer URL." msgstr "无效的块浏览器URL。" -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx @@ -1702,8 +1690,8 @@ msgid "Log out" msgstr "登出" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -msgid "Login to Mask Cloud" -msgstr "" +#~ msgid "Login to Mask Cloud" +#~ msgstr "" #: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx @@ -1823,7 +1811,6 @@ msgstr "中等" msgid "Merge Completed" msgstr "" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx msgid "Merge data to local database" @@ -1851,12 +1838,10 @@ msgstr "助记词" msgid "Mnemonic word" msgstr "助记词" -#: dashboard/pages/SetupPersona/CloudBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx msgid "Mobile" msgstr "手机" -#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx msgid "Mobile number" msgstr "手机号码" @@ -1974,7 +1959,6 @@ msgstr "" msgid "No back up" msgstr "没有备份" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx #: dashboard/components/GoogleDriveFileTable.tsx msgid "No backups found" @@ -2089,12 +2073,12 @@ msgid "Other social networking platforms, such as <0>Instagram, <1>Facebook, msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -msgid "Overwrite Backup" -msgstr "覆盖备份" +#~ msgid "Overwrite Backup" +#~ msgstr "覆盖备份" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -msgid "Overwrite current backup" -msgstr "覆盖当前备份" +#~ msgid "Overwrite current backup" +#~ msgstr "覆盖当前备份" #: popups/modals/VerifyBackupPasswordModal/index.tsx #: popups/modals/SetBackupPasswordModal/index.tsx @@ -2106,7 +2090,6 @@ msgstr "密码" msgid "Paste manually" msgstr "手动粘贴" -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Wallet/SetPaymentPassword/index.tsx @@ -2188,7 +2171,6 @@ msgstr "" msgid "Personas" msgstr "身份" -#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx msgid "Phone verification code" msgstr "验证码" @@ -2244,7 +2226,6 @@ msgid "Please note: This Persona {0} is the management account of above listed S msgstr "" #: dashboard/pages/SetupPersona/Recovery/index.tsx -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx msgid "Please select the appropriate method to restore your personal data." msgstr "请选择合适的方法来恢复个人数据。" @@ -2274,8 +2255,8 @@ msgid "Please switch to <0>@{expectAccount} to continue the account verifica msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -msgid "Please use your frequently used email or phone number for backup." -msgstr "" +#~ msgid "Please use your frequently used email or phone number for backup." +#~ msgstr "" #: dashboard/pages/CreateMaskWallet/CreateMnemonic/index.tsx msgid "Please write down or copy these words and save them in a secure place." @@ -2442,8 +2423,6 @@ msgid "Reselect" msgstr "重新选择" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx -#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Resend" @@ -2554,8 +2533,8 @@ msgid "Select Liquidity" msgstr "" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -msgid "Select the contents of the backup" -msgstr "选择备份的内容" +#~ msgid "Select the contents of the backup" +#~ msgstr "选择备份的内容" #: popups/pages/Wallet/Interaction/PermissionRequest.tsx msgid "Select the wallet(s) to use on this site. You should not connect to website you don't trust." @@ -2566,8 +2545,6 @@ msgid "Select Wallet" msgstr "选择钱包" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx -#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx #: popups/pages/Wallet/components/ActivityList/ActivityItem.tsx @@ -2771,8 +2748,6 @@ msgstr "所支持的网站" msgid "Swap" msgstr "" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx msgid "Switch other account" msgstr "切换帐号" @@ -2810,7 +2785,6 @@ msgstr "" msgid "The chainID is not equal to the currently connected one." msgstr "" -#: dashboard/pages/SetupPersona/CloudBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts #: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts @@ -3151,8 +3125,6 @@ msgstr "" msgid "Verification code has been sent to your phone." msgstr "" -#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Verification code sent" @@ -3320,11 +3292,10 @@ msgstr "" msgid "You need to open the dApp to view the specific content." msgstr "" -#. placeholder {0}: user.email #: dashboard/pages/SetupPersona/CloudBackup/index.tsx #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -msgid "You used <0>{0} for the last cloud backup." -msgstr "" +#~ msgid "You used <0>{0} for the last cloud backup." +#~ msgstr "" #: popups/components/SignRequestInfo/index.tsx msgid "Your connection to this site is not encrypted which can be modified by a hostile third party, we strongly suggest you reject this request." diff --git a/packages/mask/shared-ui/locale/zh-TW.po b/packages/mask/shared-ui/locale/zh-TW.po index 8edbdd7ba31c..71fec749559b 100644 --- a/packages/mask/shared-ui/locale/zh-TW.po +++ b/packages/mask/shared-ui/locale/zh-TW.po @@ -270,8 +270,8 @@ msgid "Approve amount" msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -msgid "Are you sure to overwrite the backups stored on Mask Cloud Service?" -msgstr "" +#~ msgid "Are you sure to overwrite the backups stored on Mask Cloud Service?" +#~ msgstr "" #. placeholder {0}: formatEthereumAddress(wallet.identity, 4) #: popups/components/ConnectedWallet/index.tsx @@ -333,12 +333,10 @@ msgstr "返回" #~ msgid "Back Up to Google Drive" #~ msgstr "" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/index.tsx msgid "Back Up Your Data Your Way" msgstr "" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Personas/Logout/index.tsx @@ -374,7 +372,6 @@ msgstr "" msgid "Backup password" msgstr "備份密碼" -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx @@ -476,7 +473,6 @@ msgstr "" #: content-script/components/InjectedComponents/SelectPeopleDialog.tsx #: dashboard/pages/SetupPersona/Welcome/index.tsx #: dashboard/pages/SetupPersona/Permissions/index.tsx -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/modals/ConfirmModal/index.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: dashboard/components/Restore/ConfirmSynchronizePasswordDialog.tsx @@ -549,7 +545,6 @@ msgstr "" msgid "Choose another wallet" msgstr "" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/index.tsx msgid "Choose from multiple backup options, now including encrypted storage via your authorized Google Drive for added security and flexibility." msgstr "" @@ -598,7 +593,6 @@ msgstr "" msgid "Completed" msgstr "" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/modals/ConfirmModal/index.tsx #: dashboard/components/Restore/ConfirmSynchronizePasswordDialog.tsx #: popups/pages/Wallet/components/DisconnectModal/index.tsx @@ -758,7 +752,6 @@ msgstr "聯繫人" #: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx #: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx #: dashboard/pages/SetupPersona/Mnemonic/index.tsx -#: dashboard/pages/SetupPersona/CloudBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx #: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx #: dashboard/pages/CreateMaskWallet/AddDeriveWallet/index.tsx @@ -1019,7 +1012,6 @@ msgstr "下載" #~ msgid "Download backup" #~ msgstr "" -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx msgid "Download Backup" msgstr "" @@ -1033,8 +1025,8 @@ msgid "Drag & Drop your file here" msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -msgid "E-mail" -msgstr "" +#~ msgid "E-mail" +#~ msgstr "" #: popups/pages/Wallet/ContactList/index.tsx msgid "Edit" @@ -1050,14 +1042,12 @@ msgid "eg: X accounts, persona public keys, wallet addresses or ENS" msgstr "" #: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Email" msgstr "" #: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Email verification code" msgstr "" @@ -1525,7 +1515,6 @@ msgstr "" msgid "Incorrect password" msgstr "" -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: dashboard/hooks/useBackupFormState.ts @@ -1582,7 +1571,6 @@ msgstr "" msgid "Invalid Block Explorer URL." msgstr "" -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx @@ -1702,8 +1690,8 @@ msgid "Log out" msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -msgid "Login to Mask Cloud" -msgstr "" +#~ msgid "Login to Mask Cloud" +#~ msgstr "" #: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx @@ -1823,7 +1811,6 @@ msgstr "" msgid "Merge Completed" msgstr "" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx msgid "Merge data to local database" @@ -1851,12 +1838,10 @@ msgstr "" msgid "Mnemonic word" msgstr "" -#: dashboard/pages/SetupPersona/CloudBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx msgid "Mobile" msgstr "" -#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx msgid "Mobile number" msgstr "" @@ -1974,7 +1959,6 @@ msgstr "" msgid "No back up" msgstr "" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx #: dashboard/components/GoogleDriveFileTable.tsx msgid "No backups found" @@ -2089,12 +2073,12 @@ msgid "Other social networking platforms, such as <0>Instagram, <1>Facebook, msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -msgid "Overwrite Backup" -msgstr "" +#~ msgid "Overwrite Backup" +#~ msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -msgid "Overwrite current backup" -msgstr "" +#~ msgid "Overwrite current backup" +#~ msgstr "" #: popups/modals/VerifyBackupPasswordModal/index.tsx #: popups/modals/SetBackupPasswordModal/index.tsx @@ -2106,7 +2090,6 @@ msgstr "" msgid "Paste manually" msgstr "手動貼上" -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Wallet/SetPaymentPassword/index.tsx @@ -2188,7 +2171,6 @@ msgstr "" msgid "Personas" msgstr "角色" -#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx msgid "Phone verification code" msgstr "" @@ -2244,7 +2226,6 @@ msgid "Please note: This Persona {0} is the management account of above listed S msgstr "" #: dashboard/pages/SetupPersona/Recovery/index.tsx -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx msgid "Please select the appropriate method to restore your personal data." msgstr "" @@ -2274,8 +2255,8 @@ msgid "Please switch to <0>@{expectAccount} to continue the account verifica msgstr "" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -msgid "Please use your frequently used email or phone number for backup." -msgstr "" +#~ msgid "Please use your frequently used email or phone number for backup." +#~ msgstr "" #: dashboard/pages/CreateMaskWallet/CreateMnemonic/index.tsx msgid "Please write down or copy these words and save them in a secure place." @@ -2442,8 +2423,6 @@ msgid "Reselect" msgstr "" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx -#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Resend" @@ -2554,8 +2533,8 @@ msgid "Select Liquidity" msgstr "" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -msgid "Select the contents of the backup" -msgstr "" +#~ msgid "Select the contents of the backup" +#~ msgstr "" #: popups/pages/Wallet/Interaction/PermissionRequest.tsx msgid "Select the wallet(s) to use on this site. You should not connect to website you don't trust." @@ -2566,8 +2545,6 @@ msgid "Select Wallet" msgstr "" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx -#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx #: popups/pages/Wallet/components/ActivityList/ActivityItem.tsx @@ -2771,8 +2748,6 @@ msgstr "" msgid "Swap" msgstr "" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx msgid "Switch other account" msgstr "" @@ -2810,7 +2785,6 @@ msgstr "" msgid "The chainID is not equal to the currently connected one." msgstr "" -#: dashboard/pages/SetupPersona/CloudBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts #: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts @@ -3151,8 +3125,6 @@ msgstr "" msgid "Verification code has been sent to your phone." msgstr "" -#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Verification code sent" @@ -3320,11 +3292,10 @@ msgstr "" msgid "You need to open the dApp to view the specific content." msgstr "" -#. placeholder {0}: user.email #: dashboard/pages/SetupPersona/CloudBackup/index.tsx #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -msgid "You used <0>{0} for the last cloud backup." -msgstr "" +#~ msgid "You used <0>{0} for the last cloud backup." +#~ msgstr "" #: popups/components/SignRequestInfo/index.tsx msgid "Your connection to this site is not encrypted which can be modified by a hostile third party, we strongly suggest you reject this request." diff --git a/packages/shared-base/src/types/Routes.ts b/packages/shared-base/src/types/Routes.ts index d667b5bf70da..c18338270c02 100644 --- a/packages/shared-base/src/types/Routes.ts +++ b/packages/shared-base/src/types/Routes.ts @@ -22,9 +22,6 @@ export enum DashboardRoutes { BackupCloudGoogleDrive = '/setup/backup/cloud/google-drive', BackupPreview = '/setup/backup/cloud/preview', - LocalBackup = '/setup/local-backup', - CloudBackup = '/setup/cloud-backup', - CloudBackupPreview = '/setup/cloud-backup-preview', SignUp = '/sign-up', SignIn = '/sign-in', Personas = '/personas', From ac818b13e511acf555dfa676afcc22fe7f46af2a Mon Sep 17 00:00:00 2001 From: Wukong Sun Date: Thu, 10 Apr 2025 12:26:31 +0800 Subject: [PATCH 11/20] fix: show toast after recovery success (#12194) --- .../dashboard/components/OnboardingWriter/index.tsx | 6 ++++-- .../dashboard/pages/SetupPersona/Onboarding/index.tsx | 10 +++++++++- packages/mask/shared-ui/locale/en-US.json | 2 ++ packages/mask/shared-ui/locale/en-US.po | 8 ++++++++ packages/mask/shared-ui/locale/ja-JP.json | 2 ++ packages/mask/shared-ui/locale/ja-JP.po | 8 ++++++++ packages/mask/shared-ui/locale/ko-KR.json | 2 ++ packages/mask/shared-ui/locale/ko-KR.po | 8 ++++++++ packages/mask/shared-ui/locale/zh-CN.json | 2 ++ packages/mask/shared-ui/locale/zh-CN.po | 8 ++++++++ packages/mask/shared-ui/locale/zh-TW.json | 2 ++ packages/mask/shared-ui/locale/zh-TW.po | 8 ++++++++ 12 files changed, 63 insertions(+), 3 deletions(-) diff --git a/packages/mask/dashboard/components/OnboardingWriter/index.tsx b/packages/mask/dashboard/components/OnboardingWriter/index.tsx index 3642159d0752..a201b6212029 100644 --- a/packages/mask/dashboard/components/OnboardingWriter/index.tsx +++ b/packages/mask/dashboard/components/OnboardingWriter/index.tsx @@ -19,8 +19,9 @@ const useStyles = makeStyles()((theme) => ({ interface OnboardingWriterProps extends withClasses<'typed' | 'endTyping'> { sentence: Array + onFinish?: () => void } -export function OnboardingWriter({ sentence, ...props }: OnboardingWriterProps) { +export function OnboardingWriter({ sentence, onFinish, ...props }: OnboardingWriterProps) { const { classes, cx } = useStyles(undefined, { props }) const typing = cx(classes.typing, classes.typed) const [jsx, setJsx] = useState(undefined) @@ -31,6 +32,7 @@ export function OnboardingWriter({ sentence, ...props }: OnboardingWriterProps) const next = writer.next() if (next.done) { clearInterval(timer) + onFinish?.() } else { setJsx(next.value) } @@ -39,7 +41,7 @@ export function OnboardingWriter({ sentence, ...props }: OnboardingWriterProps) return () => { clearInterval(timer) } - }, [writer]) + }, [writer, onFinish]) return jsx } diff --git a/packages/mask/dashboard/pages/SetupPersona/Onboarding/index.tsx b/packages/mask/dashboard/pages/SetupPersona/Onboarding/index.tsx index feb7b3e59749..16a0e9b7c581 100644 --- a/packages/mask/dashboard/pages/SetupPersona/Onboarding/index.tsx +++ b/packages/mask/dashboard/pages/SetupPersona/Onboarding/index.tsx @@ -155,7 +155,15 @@ export const Component = memo(function Onboarding() { - + { + showSnackbar(Creation Completed, { + variant: 'success', + message: t`Your Persona has been successfully created.`, + }) + }} + /> Date: Fri, 11 Apr 2025 10:45:48 +0800 Subject: [PATCH 12/20] docs(i18n): sync i18n files from Crowdin (#12197) Co-authored-by: Jack-Works --- packages/mask/shared-ui/locale/ja-JP.json | 8 +- packages/mask/shared-ui/locale/ja-JP.po | 10 +-- packages/mask/shared-ui/locale/ko-KR.json | 8 +- packages/mask/shared-ui/locale/ko-KR.po | 10 +-- packages/mask/shared-ui/locale/qya-AA.po | 104 +++++++++------------- packages/mask/shared-ui/locale/zh-CN.json | 8 +- packages/mask/shared-ui/locale/zh-CN.po | 10 +-- packages/mask/shared-ui/locale/zh-TW.json | 8 +- packages/mask/shared-ui/locale/zh-TW.po | 2 +- 9 files changed, 75 insertions(+), 93 deletions(-) diff --git a/packages/mask/shared-ui/locale/ja-JP.json b/packages/mask/shared-ui/locale/ja-JP.json index 6639ccfc1132..2edb1c0b56b6 100644 --- a/packages/mask/shared-ui/locale/ja-JP.json +++ b/packages/mask/shared-ui/locale/ja-JP.json @@ -274,7 +274,7 @@ "1+6BOG": ["バックアップのダウンロード"], "9hg9mc": ["ダウンロード中"], "F8Wc3I": ["ここにファイルをドラッグ&ドロップしてください"], - "5Sa1Ss": ["メールアドレス"], + "5Sa1Ss": ["E-mail"], "ePK91l": ["編集"], "mQpWAe": ["連絡先を編集"], "iZLoa2": ["eg: X accounts, persona public keys, wallet addresses or ENS"], @@ -521,8 +521,8 @@ "YKSmxE": [ "Other social networking platforms, such as <0>Instagram, <1>Facebook, and <2>Minds, do not have a verified relationship like X's Next.ID verified connection.<3/><4/>When connecting a persona with an account on these platforms, they only support sending encrypted posts." ], - "MXOdMY": ["バックアップを上書き"], - "p2xE4C": ["既存のバックアップを上書き"], + "MXOdMY": ["Overwrite Backup"], + "p2xE4C": ["Overwrite current backup"], "8ZsakT": ["パスワード"], "9w2hgY": ["手動でペーストする"], "GAvnvl": ["支払いパスワードの設定"], @@ -631,7 +631,7 @@ "nTif4K": ["選択してウォレットに接続"], "k/sb6z": ["言語を選択"], "LSwUJb": ["Select Liquidity"], - "RjF5dk": ["バックアップの内容を選択します"], + "RjF5dk": ["Select the contents of the backup"], "PI/VCJ": ["このサイトで使用するウォレットを選択してください。信頼しないウェブサイトに接続しないでください。"], "a1SmQh": ["ウォレットを選択"], "JlFcis": ["送信"], diff --git a/packages/mask/shared-ui/locale/ja-JP.po b/packages/mask/shared-ui/locale/ja-JP.po index 859878e7538f..d4e6dfad07a9 100644 --- a/packages/mask/shared-ui/locale/ja-JP.po +++ b/packages/mask/shared-ui/locale/ja-JP.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: mask-network\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2025-04-03 11:04\n" +"PO-Revision-Date: 2025-04-10 05:53\n" "Last-Translator: \n" "Language: ja_JP\n" "Language-Team: Japanese\n" @@ -1030,7 +1030,7 @@ msgstr "ここにファイルをドラッグ&ドロップしてください" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx #~ msgid "E-mail" -#~ msgstr "メールアドレス" +#~ msgstr "" #: popups/pages/Wallet/ContactList/index.tsx msgid "Edit" @@ -2078,11 +2078,11 @@ msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #~ msgid "Overwrite Backup" -#~ msgstr "バックアップを上書き" +#~ msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #~ msgid "Overwrite current backup" -#~ msgstr "既存のバックアップを上書き" +#~ msgstr "" #: popups/modals/VerifyBackupPasswordModal/index.tsx #: popups/modals/SetBackupPasswordModal/index.tsx @@ -2538,7 +2538,7 @@ msgstr "" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx #~ msgid "Select the contents of the backup" -#~ msgstr "バックアップの内容を選択します" +#~ msgstr "" #: popups/pages/Wallet/Interaction/PermissionRequest.tsx msgid "Select the wallet(s) to use on this site. You should not connect to website you don't trust." diff --git a/packages/mask/shared-ui/locale/ko-KR.json b/packages/mask/shared-ui/locale/ko-KR.json index c67027c3bef6..7290bd819280 100644 --- a/packages/mask/shared-ui/locale/ko-KR.json +++ b/packages/mask/shared-ui/locale/ko-KR.json @@ -274,7 +274,7 @@ "1+6BOG": ["백업 다운로드"], "9hg9mc": ["다운로드 중"], "F8Wc3I": ["파일을 끌어서 여기에 놓으세요"], - "5Sa1Ss": ["이메일"], + "5Sa1Ss": ["E-mail"], "ePK91l": ["편집"], "mQpWAe": ["연락처 편집"], "iZLoa2": ["eg: X accounts, persona public keys, wallet addresses or ENS"], @@ -521,8 +521,8 @@ "YKSmxE": [ "Other social networking platforms, such as <0>Instagram, <1>Facebook, and <2>Minds, do not have a verified relationship like X's Next.ID verified connection.<3/><4/>When connecting a persona with an account on these platforms, they only support sending encrypted posts." ], - "MXOdMY": ["백업 덮어쓰기"], - "p2xE4C": ["기존 백업 덮어쓰기"], + "MXOdMY": ["Overwrite Backup"], + "p2xE4C": ["Overwrite current backup"], "8ZsakT": ["비밀번호"], "9w2hgY": ["수동으로 붙여넣기"], "GAvnvl": ["결재 비밀번호"], @@ -631,7 +631,7 @@ "nTif4K": ["월렛 선택 및 연결"], "k/sb6z": ["언어 선택"], "LSwUJb": ["Select Liquidity"], - "RjF5dk": ["백업 내용을 선택하세요."], + "RjF5dk": ["Select the contents of the backup"], "PI/VCJ": ["Select the wallet(s) to use on this site. You should not connect to website you don't trust."], "a1SmQh": ["월렛 선택"], "JlFcis": ["보내기"], diff --git a/packages/mask/shared-ui/locale/ko-KR.po b/packages/mask/shared-ui/locale/ko-KR.po index d900c1f0eae9..e9a56eee40b1 100644 --- a/packages/mask/shared-ui/locale/ko-KR.po +++ b/packages/mask/shared-ui/locale/ko-KR.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: mask-network\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2025-04-03 11:04\n" +"PO-Revision-Date: 2025-04-10 05:53\n" "Last-Translator: \n" "Language: ko_KR\n" "Language-Team: Korean\n" @@ -1030,7 +1030,7 @@ msgstr "파일을 끌어서 여기에 놓으세요" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx #~ msgid "E-mail" -#~ msgstr "이메일" +#~ msgstr "" #: popups/pages/Wallet/ContactList/index.tsx msgid "Edit" @@ -2078,11 +2078,11 @@ msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #~ msgid "Overwrite Backup" -#~ msgstr "백업 덮어쓰기" +#~ msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #~ msgid "Overwrite current backup" -#~ msgstr "기존 백업 덮어쓰기" +#~ msgstr "" #: popups/modals/VerifyBackupPasswordModal/index.tsx #: popups/modals/SetBackupPasswordModal/index.tsx @@ -2538,7 +2538,7 @@ msgstr "" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx #~ msgid "Select the contents of the backup" -#~ msgstr "백업 내용을 선택하세요." +#~ msgstr "" #: popups/pages/Wallet/Interaction/PermissionRequest.tsx msgid "Select the wallet(s) to use on this site. You should not connect to website you don't trust." diff --git a/packages/mask/shared-ui/locale/qya-AA.po b/packages/mask/shared-ui/locale/qya-AA.po index d144c939d3fe..b50b0ae13eb3 100644 --- a/packages/mask/shared-ui/locale/qya-AA.po +++ b/packages/mask/shared-ui/locale/qya-AA.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: mask-network\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2025-04-03 11:04\n" +"PO-Revision-Date: 2025-04-10 05:53\n" "Last-Translator: \n" "Language: qya_AA\n" "Language-Team: Quenya\n" @@ -270,8 +270,8 @@ msgid "Approve amount" msgstr "crwdns29904:0crwdne29904:0" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -msgid "Are you sure to overwrite the backups stored on Mask Cloud Service?" -msgstr "crwdns31998:0crwdne31998:0" +#~ msgid "Are you sure to overwrite the backups stored on Mask Cloud Service?" +#~ msgstr "" #. placeholder {0}: formatEthereumAddress(wallet.identity, 4) #: popups/components/ConnectedWallet/index.tsx @@ -304,6 +304,10 @@ msgstr "crwdns29536:0crwdne29536:0" msgid "At least 6 characters" msgstr "crwdns29538:0crwdne29538:0" +#: dashboard/components/GoogleDriveLogin.tsx +msgid "Authorization Failed" +msgstr "crwdns37292:0crwdne37292:0" + #: popups/pages/Wallet/WalletSettings/AutoLock.tsx msgid "Auto-lock" msgstr "crwdns29916:0crwdne29916:0" @@ -326,15 +330,14 @@ msgstr "crwdns29540:0crwdne29540:0" #: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx -msgid "Back Up to Google Drive" -msgstr "crwdns37224:0crwdne37224:0" +#~ msgid "Back Up to Google Drive" +#~ msgstr "" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/index.tsx msgid "Back Up Your Data Your Way" msgstr "crwdns37226:0crwdne37226:0" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Personas/Logout/index.tsx #: popups/modals/SwitchPersonaModal/index.tsx @@ -369,10 +372,8 @@ msgstr "crwdns29924:0{0}crwdne29924:0" msgid "Backup password" msgstr "crwdns29550:0crwdne29550:0" -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Settings/index.tsx #: popups/modals/SetBackupPasswordModal/index.tsx @@ -398,6 +399,11 @@ msgstr "crwdns29930:0crwdne29930:0" msgid "Backup Successful" msgstr "crwdns37228:0crwdne37228:0" +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx +#: dashboard/pages/SetupPersona/Backup/Cloud/GoogleDrive.tsx +msgid "Backup to Google Drive" +msgstr "crwdns37294:0crwdne37294:0" + #: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #~ msgid "Backup to Mask Cloud Service" #~ msgstr "" @@ -467,7 +473,6 @@ msgstr "crwdns32010:0crwdne32010:0" #: content-script/components/InjectedComponents/SelectPeopleDialog.tsx #: dashboard/pages/SetupPersona/Welcome/index.tsx #: dashboard/pages/SetupPersona/Permissions/index.tsx -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/modals/ConfirmModal/index.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: dashboard/components/Restore/ConfirmSynchronizePasswordDialog.tsx @@ -540,7 +545,6 @@ msgstr "crwdns29968:0crwdne29968:0" msgid "Choose another wallet" msgstr "crwdns29972:0crwdne29972:0" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/index.tsx msgid "Choose from multiple backup options, now including encrypted storage via your authorized Google Drive for added security and flexibility." msgstr "crwdns37230:0crwdne37230:0" @@ -589,7 +593,6 @@ msgstr "crwdns29986:0crwdne29986:0" msgid "Completed" msgstr "crwdns29562:0crwdne29562:0" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/modals/ConfirmModal/index.tsx #: dashboard/components/Restore/ConfirmSynchronizePasswordDialog.tsx #: popups/pages/Wallet/components/DisconnectModal/index.tsx @@ -749,7 +752,6 @@ msgstr "crwdns29570:0crwdne29570:0" #: dashboard/pages/SetupPersona/Recovery/Cloud/PhoneField.tsx #: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx #: dashboard/pages/SetupPersona/Mnemonic/index.tsx -#: dashboard/pages/SetupPersona/CloudBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx #: dashboard/pages/CreateMaskWallet/CreateWalletForm/index.tsx #: dashboard/pages/CreateMaskWallet/AddDeriveWallet/index.tsx @@ -838,6 +840,10 @@ msgstr "crwdns37280:0crwdne37280:0" msgid "Creating your **wallet**" msgstr "crwdns37282:0crwdne37282:0" +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +msgid "Creation Completed" +msgstr "crwdns37297:0crwdne37297:0" + #: popups/pages/Wallet/WalletSettings/ChangeCurrency.tsx #: popups/modals/ChooseCurrencyModal/index.tsx msgid "Currency" @@ -1010,13 +1016,11 @@ msgstr "crwdns30100:0crwdne30100:0" #~ msgid "Download backup" #~ msgstr "" -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx msgid "Download Backup" msgstr "crwdns29592:0crwdne29592:0" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Downloading" msgstr "crwdns29596:0crwdne29596:0" @@ -1025,8 +1029,8 @@ msgid "Drag & Drop your file here" msgstr "crwdns30102:0crwdne30102:0" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -msgid "E-mail" -msgstr "crwdns29598:0crwdne29598:0" +#~ msgid "E-mail" +#~ msgstr "" #: popups/pages/Wallet/ContactList/index.tsx msgid "Edit" @@ -1042,14 +1046,12 @@ msgid "eg: X accounts, persona public keys, wallet addresses or ENS" msgstr "crwdns32040:0crwdne32040:0" #: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Email" msgstr "crwdns29600:0crwdne29600:0" #: dashboard/pages/SetupPersona/Recovery/Cloud/EmailField.tsx -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Email verification code" msgstr "crwdns29602:0crwdne29602:0" @@ -1172,6 +1174,10 @@ msgstr "crwdns30144:0crwdne30144:0" msgid "Failed to add the wallet, please try again." msgstr "crwdns30146:0crwdne30146:0" +#: dashboard/components/GoogleDriveLogin.tsx +msgid "Failed to authorize Google Drive. Please try again." +msgstr "crwdns37296:0crwdne37296:0" + #: content-script/components/InjectedComponents/DecryptedPost/DecryptPostFailed.tsx msgid "Failed to decrypt." msgstr "crwdns32050:0crwdne32050:0" @@ -1182,7 +1188,6 @@ msgstr "crwdns32052:0crwdne32052:0" #. placeholder {0}: (err as Error).message #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Failed to download and merge the backup: {0}" msgstr "crwdns37234:0{0}crwdne37234:0" @@ -1190,10 +1195,9 @@ msgstr "crwdns37234:0{0}crwdne37234:0" #~ msgid "Failed to download and merge the backup." #~ msgstr "" -#. placeholder {0}: (err as Error).message #: dashboard/components/GoogleDriveLogin.tsx -msgid "Failed to login: {0}" -msgstr "crwdns37236:0{0}crwdne37236:0" +#~ msgid "Failed to login: {0}" +#~ msgstr "" #: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx msgid "Failed to restore the backup from Google Drive to your browser. Please try again." @@ -1498,8 +1502,6 @@ msgstr "crwdns29626:0crwdne29626:0" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Incorrect cloud backup password, please try again." msgstr "crwdns29628:0crwdne29628:0" @@ -1517,7 +1519,6 @@ msgstr "crwdns32074:0crwdne32074:0" msgid "Incorrect password" msgstr "crwdns30236:0crwdne30236:0" -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: dashboard/hooks/useBackupFormState.ts @@ -1574,7 +1575,6 @@ msgstr "crwdns30246:0crwdne30246:0" msgid "Invalid Block Explorer URL." msgstr "crwdns30248:0crwdne30248:0" -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts #: dashboard/contexts/CloudBackupFormContext.tsx @@ -1694,8 +1694,8 @@ msgid "Log out" msgstr "crwdns30280:0crwdne30280:0" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -msgid "Login to Mask Cloud" -msgstr "crwdns32080:0crwdne32080:0" +#~ msgid "Login to Mask Cloud" +#~ msgstr "" #: dashboard/pages/SetupPersona/Recovery/Cloud/GoogleDrive.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx @@ -1812,19 +1812,15 @@ msgid "Medium" msgstr "crwdns30332:0crwdne30332:0" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Merge Completed" msgstr "crwdns37248:0crwdne37248:0" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Merge data to local database" msgstr "crwdns29656:0crwdne29656:0" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx #: dashboard/components/GoogleDriveFileTable.tsx msgid "Merge to Browser" msgstr "crwdns37250:0crwdne37250:0" @@ -1846,12 +1842,10 @@ msgstr "crwdns30336:0crwdne30336:0" msgid "Mnemonic word" msgstr "crwdns29660:0crwdne29660:0" -#: dashboard/pages/SetupPersona/CloudBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx msgid "Mobile" msgstr "crwdns29662:0crwdne29662:0" -#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx msgid "Mobile number" msgstr "crwdns29664:0crwdne29664:0" @@ -1969,7 +1963,6 @@ msgstr "crwdns32802:0crwdne32802:0" msgid "No back up" msgstr "crwdns30366:0crwdne30366:0" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx #: dashboard/components/GoogleDriveFileTable.tsx msgid "No backups found" @@ -2084,12 +2077,12 @@ msgid "Other social networking platforms, such as <0>Instagram, <1>Facebook, msgstr "crwdns32806:0crwdne32806:0" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -msgid "Overwrite Backup" -msgstr "crwdns29676:0crwdne29676:0" +#~ msgid "Overwrite Backup" +#~ msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -msgid "Overwrite current backup" -msgstr "crwdns29678:0crwdne29678:0" +#~ msgid "Overwrite current backup" +#~ msgstr "" #: popups/modals/VerifyBackupPasswordModal/index.tsx #: popups/modals/SetBackupPasswordModal/index.tsx @@ -2101,7 +2094,6 @@ msgstr "crwdns30410:0crwdne30410:0" msgid "Paste manually" msgstr "crwdns30412:0crwdne30412:0" -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Local.tsx #: dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx #: popups/pages/Wallet/SetPaymentPassword/index.tsx @@ -2183,7 +2175,6 @@ msgstr "crwdns32114:0{personaName}crwdne32114:0" msgid "Personas" msgstr "crwdns29696:0crwdne29696:0" -#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx msgid "Phone verification code" msgstr "crwdns29698:0crwdne29698:0" @@ -2212,7 +2203,6 @@ msgid "Please enter backup password to export persona private key." msgstr "crwdns30430:0crwdne30430:0" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Please enter cloud backup password to download file." msgstr "crwdns29702:0crwdne29702:0" @@ -2240,7 +2230,6 @@ msgid "Please note: This Persona {0} is the management account of above listed S msgstr "crwdns32808:00={0}crwdnd32808:01={1}crwdne32808:0" #: dashboard/pages/SetupPersona/Recovery/index.tsx -#: dashboard/pages/SetupPersona/LocalBackup/index.tsx msgid "Please select the appropriate method to restore your personal data." msgstr "crwdns29706:0crwdne29706:0" @@ -2270,8 +2259,8 @@ msgid "Please switch to <0>@{expectAccount} to continue the account verifica msgstr "crwdns32810:0{expectAccount}crwdne32810:0" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -msgid "Please use your frequently used email or phone number for backup." -msgstr "crwdns32124:0crwdne32124:0" +#~ msgid "Please use your frequently used email or phone number for backup." +#~ msgstr "" #: dashboard/pages/CreateMaskWallet/CreateMnemonic/index.tsx msgid "Please write down or copy these words and save them in a secure place." @@ -2438,8 +2427,6 @@ msgid "Reselect" msgstr "crwdns29732:0crwdne29732:0" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx -#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Resend" @@ -2550,8 +2537,8 @@ msgid "Select Liquidity" msgstr "crwdns35408:0crwdne35408:0" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx -msgid "Select the contents of the backup" -msgstr "crwdns29744:0crwdne29744:0" +#~ msgid "Select the contents of the backup" +#~ msgstr "" #: popups/pages/Wallet/Interaction/PermissionRequest.tsx msgid "Select the wallet(s) to use on this site. You should not connect to website you don't trust." @@ -2562,8 +2549,6 @@ msgid "Select Wallet" msgstr "crwdns30536:0crwdne30536:0" #: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx -#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx #: popups/pages/Wallet/components/ActivityList/ActivityItem.tsx @@ -2767,8 +2752,6 @@ msgstr "crwdns30596:0crwdne30596:0" msgid "Swap" msgstr "crwdns35412:0crwdne35412:0" -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx -#: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/Preview.tsx msgid "Switch other account" msgstr "crwdns29776:0crwdne29776:0" @@ -2806,7 +2789,6 @@ msgstr "crwdns32146:0crwdne32146:0" msgid "The chainID is not equal to the currently connected one." msgstr "crwdns30606:0crwdne30606:0" -#: dashboard/pages/SetupPersona/CloudBackup/index.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/MaskNetwork.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts #: dashboard/pages/SetupPersona/Backup/Cloud/CloudBackupFormContext.ts @@ -3147,8 +3129,6 @@ msgstr "crwdns32180:0crwdne32180:0" msgid "Verification code has been sent to your phone." msgstr "crwdns32182:0crwdne32182:0" -#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx -#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/PhoneForm.tsx #: dashboard/pages/SetupPersona/Backup/Cloud/EmailForm.tsx msgid "Verification code sent" @@ -3316,18 +3296,16 @@ msgstr "crwdns32202:0crwdne32202:0" msgid "You need to open the dApp to view the specific content." msgstr "crwdns32204:0crwdne32204:0" -#. placeholder {0}: user.email #: dashboard/pages/SetupPersona/CloudBackup/index.tsx #: dashboard/pages/SetupPersona/CloudBackup/index.tsx -msgid "You used <0>{0} for the last cloud backup." -msgstr "crwdns32832:0{0}crwdne32832:0" +#~ msgid "You used <0>{0} for the last cloud backup." +#~ msgstr "" #: popups/components/SignRequestInfo/index.tsx msgid "Your connection to this site is not encrypted which can be modified by a hostile third party, we strongly suggest you reject this request." msgstr "crwdns30740:0crwdne30740:0" #: dashboard/modals/RestoreBackupModal/RestoreBackupDialog.tsx -#: dashboard/modals/MergeBackupModal/MergeBackupDialog.tsx msgid "Your file has been successfully merged into the browser data." msgstr "crwdns37256:0crwdne37256:0" @@ -3339,6 +3317,10 @@ msgstr "crwdns37276:0crwdne37276:0" msgid "Your payment password encrypts wallet data and is needed to unlocking the wallet, transaction confirmations and signing. The password is never stored, and there is no way to recover it if you forget it." msgstr "crwdns32206:0crwdne32206:0" +#: dashboard/pages/SetupPersona/Onboarding/index.tsx +msgid "Your Persona has been successfully created." +msgstr "crwdns37299:0crwdne37299:0" + #: dashboard/pages/SetupPersona/Onboarding/index.tsx #~ msgid "Your Persona is on" #~ msgstr "" diff --git a/packages/mask/shared-ui/locale/zh-CN.json b/packages/mask/shared-ui/locale/zh-CN.json index fdcc569a469b..d0ccc7c7d4ea 100644 --- a/packages/mask/shared-ui/locale/zh-CN.json +++ b/packages/mask/shared-ui/locale/zh-CN.json @@ -272,7 +272,7 @@ "1+6BOG": ["下载备份"], "9hg9mc": ["正在下载"], "F8Wc3I": ["将您的文件拖放到此处"], - "5Sa1Ss": ["电子邮件"], + "5Sa1Ss": ["E-mail"], "ePK91l": ["编辑"], "mQpWAe": ["编辑联系人"], "iZLoa2": ["eg: X accounts, persona public keys, wallet addresses or ENS"], @@ -517,8 +517,8 @@ "YKSmxE": [ "Other social networking platforms, such as <0>Instagram, <1>Facebook, and <2>Minds, do not have a verified relationship like X's Next.ID verified connection.<3/><4/>When connecting a persona with an account on these platforms, they only support sending encrypted posts." ], - "MXOdMY": ["覆盖备份"], - "p2xE4C": ["覆盖当前备份"], + "MXOdMY": ["Overwrite Backup"], + "p2xE4C": ["Overwrite current backup"], "8ZsakT": ["密码"], "9w2hgY": ["手动粘贴"], "GAvnvl": ["支付密码"], @@ -627,7 +627,7 @@ "nTif4K": ["选择并连接到你的钱包"], "k/sb6z": ["选择语言"], "LSwUJb": ["Select Liquidity"], - "RjF5dk": ["选择备份的内容"], + "RjF5dk": ["Select the contents of the backup"], "PI/VCJ": ["Select the wallet(s) to use on this site. You should not connect to website you don't trust."], "a1SmQh": ["选择钱包"], "JlFcis": ["发送"], diff --git a/packages/mask/shared-ui/locale/zh-CN.po b/packages/mask/shared-ui/locale/zh-CN.po index e6dc4e0a04aa..e67b13ff0a83 100644 --- a/packages/mask/shared-ui/locale/zh-CN.po +++ b/packages/mask/shared-ui/locale/zh-CN.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: mask-network\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2025-04-03 11:04\n" +"PO-Revision-Date: 2025-04-10 05:53\n" "Last-Translator: \n" "Language: zh_CN\n" "Language-Team: Chinese Simplified\n" @@ -1030,7 +1030,7 @@ msgstr "将您的文件拖放到此处" #: dashboard/pages/SetupPersona/CloudBackup/index.tsx #~ msgid "E-mail" -#~ msgstr "电子邮件" +#~ msgstr "" #: popups/pages/Wallet/ContactList/index.tsx msgid "Edit" @@ -2078,11 +2078,11 @@ msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #~ msgid "Overwrite Backup" -#~ msgstr "覆盖备份" +#~ msgstr "" #: dashboard/pages/SetupPersona/CloudBackupPreview/index.tsx #~ msgid "Overwrite current backup" -#~ msgstr "覆盖当前备份" +#~ msgstr "" #: popups/modals/VerifyBackupPasswordModal/index.tsx #: popups/modals/SetBackupPasswordModal/index.tsx @@ -2538,7 +2538,7 @@ msgstr "" #: dashboard/pages/SetupPersona/LocalBackup/index.tsx #~ msgid "Select the contents of the backup" -#~ msgstr "选择备份的内容" +#~ msgstr "" #: popups/pages/Wallet/Interaction/PermissionRequest.tsx msgid "Select the wallet(s) to use on this site. You should not connect to website you don't trust." diff --git a/packages/mask/shared-ui/locale/zh-TW.json b/packages/mask/shared-ui/locale/zh-TW.json index 9c0c3c0c49c9..0cfa4492b17d 100644 --- a/packages/mask/shared-ui/locale/zh-TW.json +++ b/packages/mask/shared-ui/locale/zh-TW.json @@ -272,7 +272,7 @@ "1+6BOG": ["下载备份"], "9hg9mc": ["正在下载"], "F8Wc3I": ["将您的文件拖放到此处"], - "5Sa1Ss": ["电子邮件"], + "5Sa1Ss": ["E-mail"], "ePK91l": ["編輯"], "mQpWAe": ["编辑联系人"], "iZLoa2": ["eg: X accounts, persona public keys, wallet addresses or ENS"], @@ -517,8 +517,8 @@ "YKSmxE": [ "Other social networking platforms, such as <0>Instagram, <1>Facebook, and <2>Minds, do not have a verified relationship like X's Next.ID verified connection.<3/><4/>When connecting a persona with an account on these platforms, they only support sending encrypted posts." ], - "MXOdMY": ["覆盖备份"], - "p2xE4C": ["覆盖当前备份"], + "MXOdMY": ["Overwrite Backup"], + "p2xE4C": ["Overwrite current backup"], "8ZsakT": ["密码"], "9w2hgY": ["手動貼上"], "GAvnvl": ["支付密碼"], @@ -627,7 +627,7 @@ "nTif4K": ["选择并连接到你的钱包"], "k/sb6z": ["选择语言"], "LSwUJb": ["Select Liquidity"], - "RjF5dk": ["选择备份的内容"], + "RjF5dk": ["Select the contents of the backup"], "PI/VCJ": ["Select the wallet(s) to use on this site. You should not connect to website you don't trust."], "a1SmQh": ["选择钱包"], "JlFcis": ["發送"], diff --git a/packages/mask/shared-ui/locale/zh-TW.po b/packages/mask/shared-ui/locale/zh-TW.po index db4ed87dd67f..dee9c16e679d 100644 --- a/packages/mask/shared-ui/locale/zh-TW.po +++ b/packages/mask/shared-ui/locale/zh-TW.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: mask-network\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2025-04-03 11:04\n" +"PO-Revision-Date: 2025-04-10 05:53\n" "Last-Translator: \n" "Language: zh_TW\n" "Language-Team: Chinese Traditional\n" From 2d7c021052e55ceab98a09311e0ad44b8b3734e6 Mon Sep 17 00:00:00 2001 From: Wukong Sun Date: Fri, 11 Apr 2025 15:04:50 +0800 Subject: [PATCH 13/20] fix: mf-6690 modal naviate (#12199) --- packages/mask/popups/Popup.tsx | 2 +- .../ActionModal/ActionModalContext.tsx | 21 ++++++++++--------- .../components/NFTAvatarPicker/index.tsx | 20 +++++++++--------- .../modals/PersonaSettingModal/index.tsx | 1 - .../VerifyBackupPasswordModal/index.tsx | 10 ++++----- 5 files changed, 27 insertions(+), 27 deletions(-) diff --git a/packages/mask/popups/Popup.tsx b/packages/mask/popups/Popup.tsx index c0175a71ebf8..62c4f4fb95cb 100644 --- a/packages/mask/popups/Popup.tsx +++ b/packages/mask/popups/Popup.tsx @@ -50,7 +50,7 @@ const PopupShell = memo(function PopupShell() { const navigate = useNavigate() useEffect(() => { return MaskMessages.events.popupRouteUpdated.on((url) => navigate(url, { replace: true })) - }, []) + }, [navigate]) useEffect(() => { document.getElementById('app-spinner')?.remove() diff --git a/packages/mask/popups/components/ActionModal/ActionModalContext.tsx b/packages/mask/popups/components/ActionModal/ActionModalContext.tsx index 8b60f286b17d..d5859237c6a8 100644 --- a/packages/mask/popups/components/ActionModal/ActionModalContext.tsx +++ b/packages/mask/popups/components/ActionModal/ActionModalContext.tsx @@ -1,8 +1,8 @@ -import { useTheme } from '@mui/material' -import { useCallback, useRef, useState } from 'react' -import { useNavigate, useLocation, useSearchParams } from 'react-router-dom' import type { PopupModalRoutes } from '@masknet/shared-base' import { createContainer } from '@masknet/shared-base-ui' +import { useTheme } from '@mui/material' +import { useCallback, useRef, useState } from 'react' +import { useNavigate, useSearchParams } from 'react-router-dom' import urlcat from 'urlcat' function useModal() { @@ -42,16 +42,17 @@ export function useActionModal() { * Open a modal */ export function useModalNavigate() { - const location = useLocation() - const [, setSearchParams] = useSearchParams() + const [searchParams] = useSearchParams() + const navigate = useNavigate() const openModal = useCallback( (path: PopupModalRoutes, params?: Record) => { - setSearchParams((prev) => { - prev.set('modal', urlcat(path, params || {})) - return prev - }) + searchParams.set('modal', urlcat(path, params || {})) + // useLocation().pathname is pathname of modal Routes (maybe since a certain version) + // So we use pathname in hash instead + const mainLocationPathname = location.hash.slice(1).replace(/\?.*$/, '') + navigate(`${mainLocationPathname}?${searchParams.toString()}`) }, - [location, setSearchParams], + [navigate, searchParams], ) return openModal } diff --git a/packages/mask/popups/components/NFTAvatarPicker/index.tsx b/packages/mask/popups/components/NFTAvatarPicker/index.tsx index 69753d7ae893..b36f45206a54 100644 --- a/packages/mask/popups/components/NFTAvatarPicker/index.tsx +++ b/packages/mask/popups/components/NFTAvatarPicker/index.tsx @@ -1,16 +1,16 @@ +import { Trans } from '@lingui/react/macro' +import { Flags } from '@masknet/flags' import { ElementAnchor, NetworkTab, PluginVerifiedWalletStatusBar, RetryHint } from '@masknet/shared' -import { Box, Button, Stack } from '@mui/material' -import { memo, useCallback, useMemo, useState } from 'react' -import { getRegisteredWeb3Networks } from '@masknet/web3-providers' -import { useChainContext, useNetworkContext, useNonFungibleAssets, useWallet } from '@masknet/web3-hooks-base' -import { first, uniqBy } from 'lodash-es' +import { EMPTY_LIST, PopupModalRoutes, type BindingProof, type NetworkPluginID } from '@masknet/shared-base' import { LoadingBase, makeStyles } from '@masknet/theme' import type { Web3Helper } from '@masknet/web3-helpers' -import { CollectionList } from './CollectionList.js' -import { EMPTY_LIST, type NetworkPluginID, PopupModalRoutes, type BindingProof } from '@masknet/shared-base' +import { useChainContext, useNetworkContext, useNonFungibleAssets, useWallet } from '@masknet/web3-hooks-base' +import { getRegisteredWeb3Networks } from '@masknet/web3-providers' +import { Box, Button, Stack } from '@mui/material' +import { first, uniqBy } from 'lodash-es' +import { memo, useCallback, useMemo, useState } from 'react' import { useModalNavigate } from '../index.js' -import { Flags } from '@masknet/flags' -import { Trans } from '@lingui/react/macro' +import { CollectionList } from './CollectionList.js' const useStyles = makeStyles()((theme) => ({ picker: { @@ -54,7 +54,7 @@ export const NFTAvatarPicker = memo(function NFTAvatarPick const chains = useMemo(() => { const networks = getRegisteredWeb3Networks(pluginID) return networks.filter((x) => (Flags.support_testnet_switch ? true : x.isMainnet)).map((x) => x.chainId) - }, []) + }, [pluginID]) const [selected, setSelected] = useState() diff --git a/packages/mask/popups/modals/PersonaSettingModal/index.tsx b/packages/mask/popups/modals/PersonaSettingModal/index.tsx index f7ce442a444d..6c9c6f7a4102 100644 --- a/packages/mask/popups/modals/PersonaSettingModal/index.tsx +++ b/packages/mask/popups/modals/PersonaSettingModal/index.tsx @@ -120,7 +120,6 @@ export const PersonaSettingModal = memo(function PersonaSe !user.backupPassword ? PopupModalRoutes.SetBackupPassword : PopupModalRoutes.verifyBackupPassword, - { to: PopupRoutes.ExportPrivateKey }, ) }} /> diff --git a/packages/mask/popups/modals/VerifyBackupPasswordModal/index.tsx b/packages/mask/popups/modals/VerifyBackupPasswordModal/index.tsx index 28a1d8471ffe..b214e54d6ce3 100644 --- a/packages/mask/popups/modals/VerifyBackupPasswordModal/index.tsx +++ b/packages/mask/popups/modals/VerifyBackupPasswordModal/index.tsx @@ -1,13 +1,13 @@ -import { memo, useCallback, useState } from 'react' +import { Trans, useLingui } from '@lingui/react/macro' +import { PopupRoutes } from '@masknet/shared-base' import { ActionButton } from '@masknet/theme' import { Box } from '@mui/material' -import { ActionModal, type ActionModalBaseProps } from '../../components/index.js' +import { memo, useCallback, useState } from 'react' +import { useNavigate } from 'react-router-dom' import { UserContext } from '../../../shared-ui/index.js' +import { ActionModal, type ActionModalBaseProps } from '../../components/index.js' import { PasswordField } from '../../components/PasswordField/index.js' -import { useNavigate } from 'react-router-dom' -import { PopupRoutes } from '@masknet/shared-base' import { MATCH_PASSWORD_RE } from '../../constants.js' -import { Trans, useLingui } from '@lingui/react/macro' export const VerifyBackupPasswordModal = memo(function VerifyBackupPasswordModal() { const { t } = useLingui() From cf09c717675ff1832e0ab2335d468124b1025948 Mon Sep 17 00:00:00 2001 From: Jack Works <5390719+Jack-Works@users.noreply.github.com> Date: Fri, 11 Apr 2025 15:17:01 +0800 Subject: [PATCH 14/20] chore: pick useful changes from turbo pr (#12190) Co-authored-by: Jack-Works --- .ignore | 2 - .node-version | 2 +- cspell.json | 8 +- eslint.config.js | 3 +- package.json | 7 +- packages/backup-format/tests/encryption.ts | 2 +- packages/gun-utils/builder.mjs | 10 +- packages/gun-utils/package.json | 3 + packages/mask/.webpack/config.ts | 25 +- packages/mask/.webpack/flags.ts | 15 +- .../mask/.webpack/plugins/ProfilingPlugin.ts | 4 +- packages/mask/.webpack/plugins/manifest.ts | 4 +- packages/mask/.webpack/tsconfig.json | 3 +- packages/mask/.webpack/webpack.config.js | 2 - packages/mask/.webpack/webpack.config.ts | 2 +- packages/polyfills/package.json | 2 +- packages/scripts/src/bin/args.ts | 13 +- packages/scripts/src/bin/build-rspack.mjs | 8 +- packages/scripts/src/bin/build-rspack.ts | 13 +- packages/scripts/src/bin/build.mjs | 8 +- packages/scripts/src/bin/build.ts | 13 +- packages/scripts/src/bin/dev-rspack.mjs | 8 +- packages/scripts/src/bin/dev-rspack.ts | 11 +- packages/scripts/src/bin/dev.mjs | 8 +- packages/scripts/src/bin/dev.ts | 11 +- packages/scripts/src/cloudflare/index.ts | 8 +- packages/scripts/src/codegen/icon-codegen.ts | 34 +-- packages/scripts/src/codegen/index.ts | 10 +- packages/scripts/src/codegen/typescript.ts | 2 +- .../scripts/src/commands/changeset-release.ts | 12 +- packages/scripts/src/commands/clean.ts | 2 +- packages/scripts/src/commands/index.ts | 6 +- packages/scripts/src/commands/sync-develop.ts | 2 +- packages/scripts/src/extension/ci.ts | 21 +- packages/scripts/src/extension/dotenv.ts | 6 +- packages/scripts/src/extension/flags.ts | 4 +- packages/scripts/src/extension/index.ts | 4 +- packages/scripts/src/extension/normal.ts | 34 +-- packages/scripts/src/index.ts | 36 +-- packages/scripts/src/linter/index-lint.ts | 6 +- packages/scripts/src/linter/package-json.ts | 8 +- .../scripts/src/linter/plugin-projects.ts | 12 +- packages/scripts/src/linter/po-files.ts | 8 +- packages/scripts/src/locale-kit-next/index.ts | 26 +- .../scripts/src/locale-kit-next/run-lingui.ts | 8 +- .../scripts/src/projects/build-constants.ts | 6 +- .../scripts/src/projects/build-contracts.ts | 10 +- packages/scripts/src/projects/gun.ts | 4 +- .../scripts/src/projects/injected-scripts.ts | 4 +- packages/scripts/src/projects/mask-sdk.ts | 4 +- packages/scripts/src/projects/polyfill.ts | 4 +- .../scripts/src/projects/sandboxed-plugins.ts | 25 +- packages/scripts/src/projects/sentry.ts | 4 +- packages/scripts/src/spellcheck/index.ts | 6 +- .../scripts/src/utils/awaitChildProcess.ts | 2 +- packages/scripts/src/utils/exit.ts | 2 +- packages/scripts/src/utils/index.ts | 16 +- packages/scripts/src/utils/paths.ts | 2 +- packages/scripts/src/utils/prettier.ts | 2 +- packages/scripts/src/utils/process-lock.ts | 6 +- packages/scripts/src/utils/run.ts | 10 +- packages/scripts/src/utils/task.ts | 6 +- packages/scripts/src/utils/write.ts | 4 +- packages/scripts/tsconfig.json | 3 +- .../evm/src/helpers/isValidDomain.ts | 1 + patches/{gulp@5.0.0.patch => gulp.patch} | 24 +- pnpm-lock.yaml | 245 ++---------------- 67 files changed, 320 insertions(+), 506 deletions(-) delete mode 100644 packages/mask/.webpack/webpack.config.js rename patches/{gulp@5.0.0.patch => gulp.patch} (55%) diff --git a/.ignore b/.ignore index 376b54a68a75..c98d244df8cb 100644 --- a/.ignore +++ b/.ignore @@ -1,5 +1,3 @@ # Ignores for rg or ag patches/ -packages/mask/dashboard/assets/images/SetupTutorial.svg - **/locale/*.{po,json} diff --git a/.node-version b/.node-version index 7bceec795e9d..c9758a53fae1 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -v22.2.0 +v23.6.0 diff --git a/cspell.json b/cspell.json index 91f589c6ff26..3cd369cbb7e3 100644 --- a/cspell.json +++ b/cspell.json @@ -241,15 +241,15 @@ "ignoreRegExpList": ["/[A-Za-z0-9]{44}/", "/[A-Za-z0-9]{46}/", "/[A-Za-z0-9]{59}/"], "overrides": [], "words": [ - "Arbitrum", - "Boba", + "arbitrum", + "boba", "cashtags", - "Celo", + "celo", "endregion", "linkedin", "luma", "muln", - "Sepolia", + "sepolia", "tanstack", "tiktok", "tweetnacl", diff --git a/eslint.config.js b/eslint.config.js index 2be082cd7ad2..ab76f3c319c2 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -529,7 +529,7 @@ const moduleSystemRules = { 'import/no-duplicates': 'warn', // duplicate specifiers 'import/no-empty-named-blocks': 'warn', // bans import T, {} 'unused-imports/no-unused-imports': 'warn', - // 'unicorn/prefer-node-protocol': 'warn', + 'unicorn/prefer-node-protocol': 'warn', '@typescript-eslint/consistent-type-exports': ['warn', { fixMixedExportsWithInlineTypeSpecifier: true }], '@typescript-eslint/consistent-type-imports': [ 'warn', @@ -597,7 +597,6 @@ export default tseslint.config( '**/i18n_generated.ts', '**/languages.ts', 'packages/contracts', - 'packages/scripts', 'packages/mask/.webpack', ], }, diff --git a/package.json b/package.json index b12d894eb2cf..e24be32b1f77 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "type": "module", "packageManager": "pnpm@9.12.1", "engines": { - "node": ">=22.2.0", + "node": ">=23.6.0", "yarn": ">=999.0.0", "npm": ">=999.0.0" }, @@ -70,7 +70,6 @@ "@masknet/eslint-plugin": "^0.3.0", "@masknet/typescript-plugin": "workspace:^", "@nice-labs/git-rev": "^3.5.1", - "@swc-node/register": "^1.10.9", "@swc/core": "1.11.7", "@tanstack/eslint-plugin-query": "^5.66.1", "@types/lodash-es": "^4.17.12", @@ -155,10 +154,10 @@ "@protobufjs/inquire@1.1.0": "patches/@protobufjs__inquire@1.1.0.patch", "eslint-plugin-i@2.29.1": "patches/eslint-plugin-i@2.29.1.patch", "react-use@17.5.0": "patches/react-use@17.5.0.patch", - "gulp@5.0.0": "patches/gulp@5.0.0.patch", "react-devtools-inline@5.3.0": "patches/react-devtools-inline@5.3.0.patch", "@splinetool/runtime@0.9.342": "patches/@splinetool__runtime@0.9.342.patch", - "@scamsniffer/detector": "patches/@scamsniffer__detector.patch" + "@scamsniffer/detector": "patches/@scamsniffer__detector.patch", + "gulp": "patches/gulp.patch" } } } diff --git a/packages/backup-format/tests/encryption.ts b/packages/backup-format/tests/encryption.ts index 424bc9d077ed..8805cf56c069 100644 --- a/packages/backup-format/tests/encryption.ts +++ b/packages/backup-format/tests/encryption.ts @@ -1,5 +1,5 @@ import { test, expect, beforeAll } from 'vitest' -import { webcrypto } from 'crypto' +import { webcrypto } from 'node:crypto' import { encryptBackup, decryptBackup } from '../src/index.js' beforeAll(() => { diff --git a/packages/gun-utils/builder.mjs b/packages/gun-utils/builder.mjs index cca981f56d0f..612e3ff7c295 100644 --- a/packages/gun-utils/builder.mjs +++ b/packages/gun-utils/builder.mjs @@ -1,5 +1,6 @@ import { createRequire } from 'module' import { readFile, writeFile } from 'fs/promises' +import { minify } from '@swc/core' const require = createRequire(import.meta.url) const files = await Promise.all( [ @@ -69,12 +70,15 @@ const patchedSource = files // patch instanceof Object to instanceof globalThis.Object .replace(/instanceof\s+Object/g, 'instanceof globalThis.Object') -const result = `(() => { +const result = await minify( + `(() => { ${init.toString().replace('// Source Code Here', patchedSource)}; if (!globalThis.Gun) { globalThis.Gun = ${init.name}().Gun; } })(); undefined; -` -writeFile(new URL('./gun.js', import.meta.url), result) +`, + { mangle: false, compress: false }, +) +writeFile(new URL('./gun.js', import.meta.url), result.code) diff --git a/packages/gun-utils/package.json b/packages/gun-utils/package.json index 9e1ca3157e44..5f48ca55a7a6 100644 --- a/packages/gun-utils/package.json +++ b/packages/gun-utils/package.json @@ -17,5 +17,8 @@ "dependencies": { "event-iterator": "^2.0.0", "gun": "0.2020.1234" + }, + "devDependencies": { + "@swc/core": "1.9.3" } } diff --git a/packages/mask/.webpack/config.ts b/packages/mask/.webpack/config.ts index 014094cae787..e0b918af7e87 100644 --- a/packages/mask/.webpack/config.ts +++ b/packages/mask/.webpack/config.ts @@ -7,8 +7,8 @@ import { emitJSONFile } from '@nice-labs/emit-file-webpack-plugin' import DevtoolsIgnorePlugin from 'devtools-ignore-webpack-plugin' import WebExtensionPlugin from 'webpack-target-webextension' import ReactCompiler from 'react-compiler-webpack' -import { getGitInfo } from './git-info.js' -import { emitManifestFile } from './plugins/manifest.js' +import { getGitInfo } from './git-info.ts' +import { emitManifestFile } from './plugins/manifest.ts' // @ts-expect-error import LavaMoat from '@lavamoat/webpack' @@ -16,12 +16,12 @@ import { readFile, readdir } from 'node:fs/promises' import { createRequire } from 'node:module' import { join } from 'node:path' -import { computeCacheKey, computedBuildFlags, normalizeBuildFlags, type BuildFlags } from './flags.js' -import { ProfilingPlugin } from './plugins/ProfilingPlugin.js' -import { joinEntryItem, normalizeEntryDescription, type EntryDescription } from './utils.js' +import { computeCacheKey, computedBuildFlags, normalizeBuildFlags, type BuildFlags } from './flags.ts' +import { ProfilingPlugin } from './plugins/ProfilingPlugin.ts' +import { joinEntryItem, normalizeEntryDescription, type EntryDescription } from './utils.ts' -import './clean-hmr.js' -import { TrustedTypesPlugin } from './plugins/TrustedTypesPlugin.js' +import './clean-hmr.ts' +import { TrustedTypesPlugin } from './plugins/TrustedTypesPlugin.ts' const require = createRequire(import.meta.url) const patchesDir = join(import.meta.dirname, '../../../patches') @@ -492,11 +492,12 @@ export async function createConfiguration( } } -enum TemplateType { - Loading, - NoLoading, - Background, -} +const TemplateType = { + Loading: 0, + NoLoading: 1, + Background: 2, +} as const +type TemplateType = (typeof TemplateType)[keyof typeof TemplateType] const pages = { loading: readFile(join(import.meta.dirname, './with-loading.html'), 'utf8'), noLoading: readFile(join(import.meta.dirname, './with-no-loading.html'), 'utf8'), diff --git a/packages/mask/.webpack/flags.ts b/packages/mask/.webpack/flags.ts index c8238383f940..853e6ed906c9 100644 --- a/packages/mask/.webpack/flags.ts +++ b/packages/mask/.webpack/flags.ts @@ -1,14 +1,15 @@ import type { Configuration } from 'webpack' import { join, isAbsolute } from 'node:path' -export enum ManifestFile { - ChromiumMV2 = 'chromium-mv2', - ChromiumMV3 = 'chromium-mv3', - ChromiumBetaMV3 = 'chromium-beta-mv3', - FirefoxMV2 = 'firefox-mv2', - FirefoxMV3 = 'firefox-mv3', - SafariMV3 = 'safari-mv3', +export const ManifestFile = { + ChromiumMV2: 'chromium-mv2', + ChromiumMV3: 'chromium-mv3', + ChromiumBetaMV3: 'chromium-beta-mv3', + FirefoxMV2: 'firefox-mv2', + FirefoxMV3: 'firefox-mv3', + SafariMV3: 'safari-mv3', } +export type ManifestFile = (typeof ManifestFile)[keyof typeof ManifestFile] export interface BuildFlags { /** If this field is set, manifest.json will copy the content of manifest-*.json */ manifestFile?: ManifestFile diff --git a/packages/mask/.webpack/plugins/ProfilingPlugin.ts b/packages/mask/.webpack/plugins/ProfilingPlugin.ts index b5897e9e861a..ef6ca3f74423 100644 --- a/packages/mask/.webpack/plugins/ProfilingPlugin.ts +++ b/packages/mask/.webpack/plugins/ProfilingPlugin.ts @@ -11,8 +11,10 @@ export class ProfilingPlugin { apply(compiler: Compiler) { const { javascript, Template, RuntimeModule } = compiler.webpack class HintRuntimeModule extends RuntimeModule { - constructor(private modules: data) { + private modules: data + constructor(modules: data) { super('profiling-hint') + this.modules = modules } override generate() { return `globalThis.measure?.set_compile_info?.(${JSON.stringify(this.modules)});` diff --git a/packages/mask/.webpack/plugins/manifest.ts b/packages/mask/.webpack/plugins/manifest.ts index c22d08cd54b8..f1bfda91e5c5 100644 --- a/packages/mask/.webpack/plugins/manifest.ts +++ b/packages/mask/.webpack/plugins/manifest.ts @@ -1,9 +1,9 @@ /* spell-checker: disable */ import emitFile from '@nice-labs/emit-file-webpack-plugin' -import type { ComputedFlags, NormalizedFlags } from '../flags.js' +import type { ComputedFlags, NormalizedFlags } from '../flags.ts' import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs' import type { Manifest } from 'webextension-polyfill' -import { parseJSONc } from '../utils.js' +import { parseJSONc } from '../utils.ts' import { join } from 'node:path' const cloneDeep = (x: T): T => JSON.parse(JSON.stringify(x)) diff --git a/packages/mask/.webpack/tsconfig.json b/packages/mask/.webpack/tsconfig.json index 96475e1d2b61..815d00884001 100644 --- a/packages/mask/.webpack/tsconfig.json +++ b/packages/mask/.webpack/tsconfig.json @@ -2,7 +2,8 @@ "extends": "../../../tsconfig.json", "compilerOptions": { "incremental": false, - "composite": false + "composite": false, + "allowImportingTsExtensions": true }, "include": ["./**/*.ts"] } diff --git a/packages/mask/.webpack/webpack.config.js b/packages/mask/.webpack/webpack.config.js deleted file mode 100644 index 8e8155aa1b4a..000000000000 --- a/packages/mask/.webpack/webpack.config.js +++ /dev/null @@ -1,2 +0,0 @@ -// webpack-cli does not know swc-node -export { default } from './webpack.config.ts' diff --git a/packages/mask/.webpack/webpack.config.ts b/packages/mask/.webpack/webpack.config.ts index 2fe130d51a58..352cb464ca74 100644 --- a/packages/mask/.webpack/webpack.config.ts +++ b/packages/mask/.webpack/webpack.config.ts @@ -1,4 +1,4 @@ -import { createConfiguration } from './config.js' +import { createConfiguration } from './config.ts' export default async function (cli_env: any) { const flags = JSON.parse(Buffer.from(cli_env.flags, 'hex').toString('utf-8')) return createConfiguration(false, flags) diff --git a/packages/polyfills/package.json b/packages/polyfills/package.json index 21a86be88614..13ed95a905ba 100644 --- a/packages/polyfills/package.json +++ b/packages/polyfills/package.json @@ -11,11 +11,11 @@ "build": "rollup -c" }, "dependencies": { - "@types/webextension-polyfill": "^0.10.7", "core-js": "3.41.0", "tslib": "^2.6.3" }, "devDependencies": { + "@types/webextension-polyfill": "^0.10.7", "@rollup/plugin-commonjs": "^28.0.2", "@rollup/plugin-json": "^6.1.0", "@rollup/plugin-node-resolve": "^16.0.0", diff --git a/packages/scripts/src/bin/args.ts b/packages/scripts/src/bin/args.ts index 6db08ef6fe64..6db5f7f6b21d 100644 --- a/packages/scripts/src/bin/args.ts +++ b/packages/scripts/src/bin/args.ts @@ -1,8 +1,8 @@ import yargs from 'yargs' -import type { BuildFlagsExtended } from '../extension/flags.js' +import type { BuildFlagsExtended } from '../extension/flags.ts' import { hideBin } from 'yargs/helpers' -import { applyDotEnv, parseManifest } from '../extension/dotenv.js' -import { ManifestFile } from '../../../mask/.webpack/flags.js' +import { applyDotEnv, parseManifest } from '../extension/dotenv.ts' +import { ManifestFile } from '../../../mask/.webpack/flags.ts' const manifestFiles = Object.values(ManifestFile) export function extensionArgsParser(mode: 'development' | 'production') { @@ -23,7 +23,7 @@ export function extensionArgsParser(mode: 'development' | 'production') { .options('progress', { type: 'boolean', description: 'Show build progress' }) .options('hmr', { type: 'boolean', description: 'Enable Hot Module Reload' }) .options('reactRefresh', { type: 'boolean', description: 'Enable react-refresh', implies: 'hmr' }) - .options('csp', { type: 'boolean', description: 'Enable strict contentScript.' }) + .options('csp', { type: 'boolean', description: 'Enable strict Content Security Policy.' }) .options('lavamoat', { type: 'boolean', description: 'Enable LavaMoat.' }) .option('reactCompiler', { type: 'string', @@ -36,7 +36,10 @@ export function extensionArgsParser(mode: 'development' | 'production') { description: 'Enable react compiler', }) .options('devtools', { type: 'boolean', description: 'Enable devtools' }) - .options('devtoolsEditorURI', { type: 'string', description: 'Editor URI to be used in React Devtools.' }) + .options('devtoolsEditorURI', { + type: 'string', + description: 'Default editor URI to be used in React Devtools.', + }) .options('sourceMap', { type: 'string', description: 'Enable source map', diff --git a/packages/scripts/src/bin/build-rspack.mjs b/packages/scripts/src/bin/build-rspack.mjs index 5a8a8cf20223..7cad78dee8dd 100755 --- a/packages/scripts/src/bin/build-rspack.mjs +++ b/packages/scripts/src/bin/build-rspack.mjs @@ -1,11 +1,11 @@ #!/usr/bin/env node -import { spawnSync } from 'child_process' -import { fileURLToPath } from 'url' +import { spawnSync } from 'node:child_process' +import { fileURLToPath } from 'node:url' const child = spawnSync( process.execPath, [ - '--import', - '@swc-node/register/esm-register', + '--experimental-strip-types', + '--disable-warning=ExperimentalWarning', fileURLToPath(import.meta.resolve('./build-rspack.ts')), ...process.argv.slice(2), ], diff --git a/packages/scripts/src/bin/build-rspack.ts b/packages/scripts/src/bin/build-rspack.ts index e55ee96fd6cc..c1b4cc3c2283 100755 --- a/packages/scripts/src/bin/build-rspack.ts +++ b/packages/scripts/src/bin/build-rspack.ts @@ -1,11 +1,10 @@ -#!/usr/bin/env node --import swc-register-esm -import { spawn } from 'child_process' -import { promisify } from 'util' +import { spawn } from 'node:child_process' +import { promisify } from 'node:util' import { series } from 'gulp' -import { codegen } from '../codegen/index.js' -import { awaitChildProcess, awaitTask } from '../utils/index.js' -import { buildExtensionFlagRspack } from '../extension/index.js' -import { extensionArgsParser } from './args.js' +import { codegen } from '../codegen/index.ts' +import { awaitChildProcess, awaitTask } from '../utils/index.ts' +import { buildExtensionFlagRspack } from '../extension/index.ts' +import { extensionArgsParser } from './args.ts' await promisify(codegen)() // \\-- is used for debug diff --git a/packages/scripts/src/bin/build.mjs b/packages/scripts/src/bin/build.mjs index bbebfe68fefa..e076b3e299b8 100755 --- a/packages/scripts/src/bin/build.mjs +++ b/packages/scripts/src/bin/build.mjs @@ -1,11 +1,11 @@ #!/usr/bin/env node -import { spawnSync } from 'child_process' -import { fileURLToPath } from 'url' +import { spawnSync } from 'node:child_process' +import { fileURLToPath } from 'node:url' const child = spawnSync( process.execPath, [ - '--import', - '@swc-node/register/esm-register', + '--experimental-strip-types', + '--disable-warning=ExperimentalWarning', fileURLToPath(import.meta.resolve('./build.ts')), ...process.argv.slice(2), ], diff --git a/packages/scripts/src/bin/build.ts b/packages/scripts/src/bin/build.ts index 0b69edf4e6aa..0d2b528e14bd 100755 --- a/packages/scripts/src/bin/build.ts +++ b/packages/scripts/src/bin/build.ts @@ -1,11 +1,10 @@ -#!/usr/bin/env node --import swc-register-esm -import { spawn } from 'child_process' -import { promisify } from 'util' +import { spawn } from 'node:child_process' +import { promisify } from 'node:util' import { series } from 'gulp' -import { codegen } from '../codegen/index.js' -import { awaitChildProcess, awaitTask } from '../utils/index.js' -import { buildExtensionFlag } from '../extension/index.js' -import { extensionArgsParser } from './args.js' +import { codegen } from '../codegen/index.ts' +import { awaitChildProcess, awaitTask } from '../utils/index.ts' +import { buildExtensionFlag } from '../extension/index.ts' +import { extensionArgsParser } from './args.ts' await promisify(codegen)() // \\-- is used for debug diff --git a/packages/scripts/src/bin/dev-rspack.mjs b/packages/scripts/src/bin/dev-rspack.mjs index 7be10f4f83f8..018f8cce82c1 100755 --- a/packages/scripts/src/bin/dev-rspack.mjs +++ b/packages/scripts/src/bin/dev-rspack.mjs @@ -1,12 +1,12 @@ #!/usr/bin/env node -import { spawnSync } from 'child_process' -import { fileURLToPath } from 'url' +import { spawnSync } from 'node:child_process' +import { fileURLToPath } from 'node:url' const child = spawnSync( process.execPath, [ - '--import', - '@swc-node/register/esm-register', + '--experimental-strip-types', + '--disable-warning=ExperimentalWarning', fileURLToPath(import.meta.resolve('./dev-rspack.ts')), ...process.argv.slice(2), ], diff --git a/packages/scripts/src/bin/dev-rspack.ts b/packages/scripts/src/bin/dev-rspack.ts index 9afe2dad948b..c7f4147308ad 100755 --- a/packages/scripts/src/bin/dev-rspack.ts +++ b/packages/scripts/src/bin/dev-rspack.ts @@ -1,9 +1,8 @@ -#!/usr/bin/env node --import swc-register-esm -import { spawn } from 'child_process' -import { codegenWatch } from '../codegen/index.js' -import { awaitChildProcess, cleanupWhenExit } from '../utils/index.js' -import { extensionWatchRspack } from '../extension/index.js' -import { extensionArgsParser } from './args.js' +import { spawn } from 'node:child_process' +import { codegenWatch } from '../codegen/index.ts' +import { awaitChildProcess, cleanupWhenExit } from '../utils/index.ts' +import { extensionWatchRspack } from '../extension/index.ts' +import { extensionArgsParser } from './args.ts' cleanupWhenExit() codegenWatch(console.error) diff --git a/packages/scripts/src/bin/dev.mjs b/packages/scripts/src/bin/dev.mjs index cf7c5ecea585..781a36c083f4 100755 --- a/packages/scripts/src/bin/dev.mjs +++ b/packages/scripts/src/bin/dev.mjs @@ -1,12 +1,12 @@ #!/usr/bin/env node -import { spawnSync } from 'child_process' -import { fileURLToPath } from 'url' +import { spawnSync } from 'node:child_process' +import { fileURLToPath } from 'node:url' const child = spawnSync( process.execPath, [ - '--import', - '@swc-node/register/esm-register', + '--experimental-strip-types', + '--disable-warning=ExperimentalWarning', fileURLToPath(import.meta.resolve('./dev.ts')), ...process.argv.slice(2), ], diff --git a/packages/scripts/src/bin/dev.ts b/packages/scripts/src/bin/dev.ts index 2aed583c27a8..507179997851 100755 --- a/packages/scripts/src/bin/dev.ts +++ b/packages/scripts/src/bin/dev.ts @@ -1,9 +1,8 @@ -#!/usr/bin/env node --import swc-register-esm -import { spawn } from 'child_process' -import { codegenWatch } from '../codegen/index.js' -import { awaitChildProcess, cleanupWhenExit } from '../utils/index.js' -import { extensionWatch } from '../extension/index.js' -import { extensionArgsParser } from './args.js' +import { spawn } from 'node:child_process' +import { codegenWatch } from '../codegen/index.ts' +import { awaitChildProcess, cleanupWhenExit } from '../utils/index.ts' +import { extensionWatch } from '../extension/index.ts' +import { extensionArgsParser } from './args.ts' cleanupWhenExit() codegenWatch(console.error) diff --git a/packages/scripts/src/cloudflare/index.ts b/packages/scripts/src/cloudflare/index.ts index 6c00bedb1a89..aa580462f9ba 100644 --- a/packages/scripts/src/cloudflare/index.ts +++ b/packages/scripts/src/cloudflare/index.ts @@ -1,9 +1,9 @@ import { dest, parallel, series, src, type TaskFunction } from 'gulp' -import { PKG_PATH, ROOT_PATH, task } from '../utils/index.js' -import { codegen } from '../codegen/index.js' -import { fileURLToPath } from 'url' +import { PKG_PATH, ROOT_PATH, task } from '../utils/index.ts' +import { codegen } from '../codegen/index.ts' +import { fileURLToPath } from 'node:url' -const DIST_PATH = new URL('dist/cloudflare', ROOT_PATH) +const DIST_PATH = new URL('./dist/cloudflare', ROOT_PATH) function copyLocalesJSON() { return src('**/locale/*.json', { diff --git a/packages/scripts/src/codegen/icon-codegen.ts b/packages/scripts/src/codegen/icon-codegen.ts index 9f116416ef6f..722024169231 100644 --- a/packages/scripts/src/codegen/icon-codegen.ts +++ b/packages/scripts/src/codegen/icon-codegen.ts @@ -1,16 +1,16 @@ -import { readFile, writeFile } from 'fs/promises' +import { readFile, writeFile } from 'node:fs/promises' import { watch } from 'gulp' import { camelCase, snakeCase, upperFirst } from 'lodash-es' -import { parse as parsePath } from 'path' -import { PKG_PATH, ROOT_PATH, prettier, watchTask } from '../utils/index.js' +import { parse as parsePath } from 'node:path' +import { PKG_PATH, ROOT_PATH, prettier, watchTask } from '../utils/index.ts' import type { Position } from 'source-map' -import { fileURLToPath } from 'url' +import { fileURLToPath } from 'node:url' const pattern = 'packages/icons/**/*.@(svg|jpe?g|png)' -const iconRoot = new URL('icons/', PKG_PATH) -const CODE_FILE = fileURLToPath(new URL('icon-generated-as', iconRoot)) +const iconRoot = new URL('./icons/', PKG_PATH) +const CODE_FILE = fileURLToPath(new URL('./icon-generated-as', iconRoot)) -const dynamicColorRe = /(?:\w=('|")currentColor\1|var\(--icon-color)/ +const dynamicColorRe = /\w=('|")currentColor\1|var\(--icon-color/ const attr2KeyValue = (attr: string) => { const index = attr.indexOf(':') @@ -19,11 +19,11 @@ const attr2KeyValue = (attr: string) => { function svg2jsx(code: string) { return code .trim() - .replace(/(\w+-\w+)=('|").*?\2/g, (p: string, m1: string) => { + .replaceAll(/(\w+-\w+)=('|").*?\2/g, (p: string, m1: string) => { return p.replace(m1, camelCase(m1)) }) .replaceAll('xlink:href', 'xlinkHref') - .replace(/\bstyle=('|")(.+?)\1/g, (_p: string, _m1: string, style: string) => { + .replaceAll(/\bstyle=('|")(.+?)\1/g, (_p: string, _m1: string, style: string) => { const attributes = style .split(';') .map(attr2KeyValue) @@ -37,7 +37,7 @@ function getIntrinsicSize(data: string | Buffer): [number, number] | undefined { // from `viewBox="0 0 2124 660"`, we match `2124 / 660` out. const match = data.match(/viewBox="0 0 (\d+) (\d+)"/) if (match) { - return [parseFloat(match[1]), parseFloat(match[2])] + return [Number.parseFloat(match[1]), Number.parseFloat(match[2])] } } // TODO: support binary image. @@ -62,12 +62,12 @@ async function generateIcons() { const asJSX = { js: [ // - `import { __createIcon } from './utils/internal.js'`, + "import { __createIcon } from './utils/internal.js'", ], dts: [ // - `import type { GeneratedIconProps, GeneratedIconNonSquareProps } from './utils/internal.js'`, - `import type { ComponentType } from 'react'`, + "import type { GeneratedIconProps, GeneratedIconNonSquareProps } from './utils/internal.js'", + "import type { ComponentType } from 'react'", ], dtsMap: new SourceMapGenerator({ file: 'icon-generated-as-jsx.d.ts' }), } @@ -142,7 +142,7 @@ async function generateIcons() { .map((x) => x.args) .map(([variant, url, jsx, isColorful]) => { return ( - `{` + + '{' + [ variant.length === 0 ? null : `c: ${JSON.stringify(variant.sort())}`, variant.length === 0 && jsx ? null : `u: () => ${url}`, @@ -165,10 +165,10 @@ async function generateIcons() { const jsdoc = [] as string[] if (variant.some((x) => x.args[3])) jsdoc.push('🎨 This icon supports custom color.') - else jsdoc.push('🖼️ This icon brings its own colors.') + else jsdoc.push('🖼\uFE0F This icon brings its own colors.') - jsdoc.push(`| Variant | Link | Preview |`) - jsdoc.push(`| ------- | ---- | ------- |`) + jsdoc.push('| Variant | Link | Preview |') + jsdoc.push('| ------- | ---- | ------- |') for (const { args, assetPath } of variant) { jsdoc.push(`| ${args[0].join(', ') || 'default'} | ${createLink(assetPath)} | !${createLink(assetPath)} |`) } diff --git a/packages/scripts/src/codegen/index.ts b/packages/scripts/src/codegen/index.ts index 586bf4bcf6b5..0b40e951a23b 100644 --- a/packages/scripts/src/codegen/index.ts +++ b/packages/scripts/src/codegen/index.ts @@ -1,7 +1,7 @@ -import { getProcessLock, markTaskNeedCleanup, watchTask } from '../utils/index.js' +import { getProcessLock, markTaskNeedCleanup, watchTask } from '../utils/index.ts' import { series, parallel, type TaskFunction } from 'gulp' -import { typescriptWatch } from './typescript.js' -import { iconCodegen, iconCodegenWatch } from './icon-codegen.js' +import { typescriptWatch } from './typescript.ts' +import { iconCodegen, iconCodegenWatch } from './icon-codegen.ts' // typescript is explicitly eliminated from this task. // our build process does not rely on tsc to give output, we have an extra check for tsc. @@ -11,5 +11,5 @@ export const codegenWatch: TaskFunction = markTaskNeedCleanup( ) watchTask(codegen, codegenWatch, 'codegen', 'All codegen tasks combined into one') -export * from './icon-codegen.js' -export * from './typescript.js' +export * from './icon-codegen.ts' +export * from './typescript.ts' diff --git a/packages/scripts/src/codegen/typescript.ts b/packages/scripts/src/codegen/typescript.ts index d7806a5f2404..46125406a425 100644 --- a/packages/scripts/src/codegen/typescript.ts +++ b/packages/scripts/src/codegen/typescript.ts @@ -1,4 +1,4 @@ -import { watchTask, shell, cleanupWhenExit } from '../utils/index.js' +import { watchTask, shell, cleanupWhenExit } from '../utils/index.ts' export function typescript() { return shell`npx tsc -b` diff --git a/packages/scripts/src/commands/changeset-release.ts b/packages/scripts/src/commands/changeset-release.ts index f5a8d15a4cbc..b5ca7d35d1bb 100644 --- a/packages/scripts/src/commands/changeset-release.ts +++ b/packages/scripts/src/commands/changeset-release.ts @@ -1,8 +1,8 @@ -import { readFile } from 'fs/promises' -import { awaitChildProcess } from '../utils/awaitChildProcess.js' -import { ROOT_PATH } from '../utils/paths.js' -import { shell } from '../utils/run.js' -import { task } from '../utils/task.js' +import { readFile } from 'node:fs/promises' +import { awaitChildProcess } from '../utils/awaitChildProcess.ts' +import { ROOT_PATH } from '../utils/paths.ts' +import { shell } from '../utils/run.ts' +import { task } from '../utils/task.ts' import { fileURLToPath } from 'node:url' const packages = [ @@ -14,7 +14,7 @@ const packages = [ ] export async function changesetRelease() { const tsc = awaitChildProcess(shell.cwd(ROOT_PATH)`npx tsc -b ./tsconfig.npm.json`) - const buildTask: Promise[] = packages.map((path) => + const buildTask: Array> = packages.map((path) => readFile(new URL('./package.json', path), 'utf-8') .then(JSON.parse) .then((json) => { diff --git a/packages/scripts/src/commands/clean.ts b/packages/scripts/src/commands/clean.ts index 5ed3fff0e366..ad02107e76b7 100644 --- a/packages/scripts/src/commands/clean.ts +++ b/packages/scripts/src/commands/clean.ts @@ -1,4 +1,4 @@ -import { awaitChildProcess, printShell, ROOT_PATH, shell, task } from '../utils/index.js' +import { awaitChildProcess, printShell, ROOT_PATH, shell, task } from '../utils/index.ts' export async function clean() { const { rimraf: rm } = await import('rimraf') diff --git a/packages/scripts/src/commands/index.ts b/packages/scripts/src/commands/index.ts index 80a52ba84311..827c7603dfb0 100644 --- a/packages/scripts/src/commands/index.ts +++ b/packages/scripts/src/commands/index.ts @@ -1,3 +1,3 @@ -export * from './clean.js' -export * from './sync-develop.js' -export * from './changeset-release.js' +export * from './clean.ts' +export * from './sync-develop.ts' +export * from './changeset-release.ts' diff --git a/packages/scripts/src/commands/sync-develop.ts b/packages/scripts/src/commands/sync-develop.ts index 9499a3c8561b..c858dc8b07b3 100644 --- a/packages/scripts/src/commands/sync-develop.ts +++ b/packages/scripts/src/commands/sync-develop.ts @@ -1,4 +1,4 @@ -import { shell, task } from '../utils/index.js' +import { shell, task } from '../utils/index.ts' const REPO_URL = 'https://github.com/DimensionDev/Maskbook.git' diff --git a/packages/scripts/src/extension/ci.ts b/packages/scripts/src/extension/ci.ts index 8bf0d26371e8..95d470cf03ec 100644 --- a/packages/scripts/src/extension/ci.ts +++ b/packages/scripts/src/extension/ci.ts @@ -1,14 +1,13 @@ -#!/usr/bin/env node --import swc-register-esm -import { fileURLToPath } from 'url' +import { fileURLToPath } from 'node:url' import { series, type TaskFunction } from 'gulp' -import { buildBaseExtension } from './normal.js' -import { ROOT_PATH, task } from '../utils/index.js' -import { codegen } from '../codegen/index.js' -import { type BuildFlagsExtended } from './flags.js' -import { copyFile } from 'fs/promises' -import { ManifestFile } from '../../../mask/.webpack/flags.js' +import { buildBaseExtension } from './normal.ts' +import { ROOT_PATH, task } from '../utils/index.ts' +import { codegen } from '../codegen/index.ts' +import { type BuildFlagsExtended } from './flags.ts' +import { copyFile } from 'node:fs/promises' +import { ManifestFile } from '../../../mask/.webpack/flags.ts' -const BUILD_PATH = new URL('build/', ROOT_PATH) +const BUILD_PATH = new URL('./build/', ROOT_PATH) export const ciBuild: TaskFunction = series( codegen, buildBaseExtension, @@ -32,9 +31,9 @@ function zipTo( reproducible?: boolean, ): TaskFunction { const f: TaskFunction = async () => { - await copyFile(new URL(`manifest-${withManifestFile}.json`, BUILD_PATH), new URL('manifest.json', BUILD_PATH)) + await copyFile(new URL(`manifest-${withManifestFile}.json`, BUILD_PATH), new URL('./manifest.json', BUILD_PATH)) if (!reproducible && withManifestFile === ManifestFile.ChromiumBetaMV3) { - await copyFile(new URL('build-info-beta.json', BUILD_PATH), new URL('build-info.json', BUILD_PATH)) + await copyFile(new URL('./build-info-beta.json', BUILD_PATH), new URL('./build-info.json', BUILD_PATH)) } const { cmd } = await import('web-ext') await cmd.build({ diff --git a/packages/scripts/src/extension/dotenv.ts b/packages/scripts/src/extension/dotenv.ts index ca48242e6cd1..faf0504482f1 100644 --- a/packages/scripts/src/extension/dotenv.ts +++ b/packages/scripts/src/extension/dotenv.ts @@ -1,7 +1,7 @@ import { config } from 'dotenv' -import { ROOT_PATH } from '../utils/paths.js' -import type { BuildFlags } from './flags.js' -import { ManifestFile } from '../../../mask/.webpack/flags.js' +import { ROOT_PATH } from '../utils/paths.ts' +import type { BuildFlags } from './flags.ts' +import { ManifestFile } from '../../../mask/.webpack/flags.ts' export function applyDotEnv(flags: BuildFlags) { if (flags.mode === 'production') return diff --git a/packages/scripts/src/extension/flags.ts b/packages/scripts/src/extension/flags.ts index 23c64380ff80..80116c9d57a8 100644 --- a/packages/scripts/src/extension/flags.ts +++ b/packages/scripts/src/extension/flags.ts @@ -1,5 +1,5 @@ -import type { BuildFlags } from '../../../mask/.webpack/flags.js' -export type { BuildFlags } from '../../../mask/.webpack/flags.js' +import type { BuildFlags } from '../../../mask/.webpack/flags.ts' +export type { BuildFlags } from '../../../mask/.webpack/flags.ts' export interface BuildFlagsExtended extends BuildFlags { progress?: boolean diff --git a/packages/scripts/src/extension/index.ts b/packages/scripts/src/extension/index.ts index d46813a1667f..f6fb74dfc48c 100644 --- a/packages/scripts/src/extension/index.ts +++ b/packages/scripts/src/extension/index.ts @@ -1,2 +1,2 @@ -export * from './normal.js' -export * from './ci.js' +export * from './normal.ts' +export * from './ci.ts' diff --git a/packages/scripts/src/extension/normal.ts b/packages/scripts/src/extension/normal.ts index baa9b4eb725e..fcfd9be2c738 100644 --- a/packages/scripts/src/extension/normal.ts +++ b/packages/scripts/src/extension/normal.ts @@ -1,16 +1,16 @@ import { compact } from 'lodash-es' -import { awaitChildProcess, cleanupWhenExit, PKG_PATH, shell, task, watchTask } from '../utils/index.js' -import { buildInjectedScript, watchInjectedScript } from '../projects/injected-scripts.js' -import { buildMaskSDK, watchMaskSDK } from '../projects/mask-sdk.js' -import { buildPolyfill } from '../projects/polyfill.js' -import { buildGun } from '../projects/gun.js' +import { awaitChildProcess, cleanupWhenExit, PKG_PATH, shell, task, watchTask } from '../utils/index.ts' +import { buildInjectedScript, watchInjectedScript } from '../projects/injected-scripts.ts' +import { buildMaskSDK, watchMaskSDK } from '../projects/mask-sdk.ts' +import { buildPolyfill } from '../projects/polyfill.ts' +import { buildGun } from '../projects/gun.ts' import { parallel, series, type TaskFunction } from 'gulp' -import { buildSentry } from '../projects/sentry.js' -import type { BuildFlags, BuildFlagsExtended } from './flags.js' -import { ManifestFile } from '../../../mask/.webpack/flags.js' -import { applyDotEnv } from './dotenv.js' -import { fileURLToPath } from 'url' -import { createRequire } from 'module' +import { buildSentry } from '../projects/sentry.ts' +import type { BuildFlags, BuildFlagsExtended } from './flags.ts' +import { ManifestFile } from '../../../mask/.webpack/flags.ts' +import { applyDotEnv } from './dotenv.ts' +import { fileURLToPath } from 'node:url' +import { createRequire } from 'node:module' export function buildWebpackFlag(name: string, args: BuildFlagsExtended) { const f = () => webpack(false, args) @@ -61,7 +61,7 @@ function preTask() { watchMaskSDK() buildSentry() } -export async function extensionWatch(f: Function | BuildFlagsExtended) { +export async function extensionWatch(f: (() => void) | BuildFlagsExtended) { preTask() if (typeof f === 'function') { const flags: BuildFlags = { @@ -74,7 +74,7 @@ export async function extensionWatch(f: Function | BuildFlagsExtended) { } return webpack(false, f) } -export async function extensionWatchRspack(f: Function | BuildFlagsExtended) { +export async function extensionWatchRspack(f: (() => void) | BuildFlagsExtended) { preTask() if (typeof f === 'function') { const flags: BuildFlags = { @@ -115,19 +115,19 @@ async function webpack(rspack: boolean, flags: BuildFlagsExtended) { const rspack = await import('@rspack/cli') const cli = new rspack.RspackCLI() console.log( - '$ node --import @swc-node/register/esm-register ./packages/mask/node_modules/@rspack/cli/bin/rspack.js', + '$ node --experimental-strip-types ./packages/mask/node_modules/@rspack/cli/bin/rspack.js', ...compact(rspack_argv), ) return cli.run(['node', 'rspack', ...compact(rspack_argv)]) } else { const command = [ JSON.stringify(process.execPath), - '--import', - '@swc-node/register/esm-register', + '--experimental-strip-types', + '--disable-warning=ExperimentalWarning', fileURLToPath(import.meta.resolve(rspack ? 'rspack/bin/rspack.js' : './init.js')), flags.mode === 'development' ? 'serve' : undefined, ...argv, ] - return awaitChildProcess(shell.cwd(new URL('mask', PKG_PATH))([compact(command).join(' ')])) + return awaitChildProcess(shell.cwd(new URL('./mask', PKG_PATH))([compact(command).join(' ')])) } } diff --git a/packages/scripts/src/index.ts b/packages/scripts/src/index.ts index 49ec2ca9d6fd..4963f1b542ac 100644 --- a/packages/scripts/src/index.ts +++ b/packages/scripts/src/index.ts @@ -1,24 +1,24 @@ -export { codegen, codegenWatch, iconCodegen, iconCodegenWatch, typescript, typescriptWatch } from './codegen/index.js' -export { ciBuild, buildChrome, extensionWatch, extensionWatchRspack } from './extension/index.js' -export { buildCloudflare } from './cloudflare/index.js' +export { codegen, codegenWatch, iconCodegen, iconCodegenWatch, typescript, typescriptWatch } from './codegen/index.ts' +export { ciBuild, buildChrome, extensionWatch, extensionWatchRspack } from './extension/index.ts' +export { buildCloudflare } from './cloudflare/index.ts' // Tools -export { clean, syncDevelop, changesetRelease } from './commands/index.js' -export { syncLanguages } from './locale-kit-next/index.js' -export { runLinguiExtract, runLinguiCompile } from './locale-kit-next/run-lingui.js' -export { reorderSpellcheck } from './spellcheck/index.js' +export { clean, syncDevelop, changesetRelease } from './commands/index.ts' +export { syncLanguages } from './locale-kit-next/index.ts' +export { runLinguiExtract, runLinguiCompile } from './locale-kit-next/run-lingui.ts' +export { reorderSpellcheck } from './spellcheck/index.ts' // Sub-projects build commands -export { buildInjectedScript, watchInjectedScript } from './projects/injected-scripts.js' -export { buildMaskSDK, watchMaskSDK } from './projects/mask-sdk.js' -export { buildPolyfill } from './projects/polyfill.js' -export { buildGun } from './projects/gun.js' -export { buildSandboxedPlugin, watchSandboxedPlugin } from './projects/sandboxed-plugins.js' -export { buildConstants } from './projects/build-constants.js' -export { buildContracts } from './projects/build-contracts.js' +export { buildInjectedScript, watchInjectedScript } from './projects/injected-scripts.ts' +export { buildMaskSDK, watchMaskSDK } from './projects/mask-sdk.ts' +export { buildPolyfill } from './projects/polyfill.ts' +export { buildGun } from './projects/gun.ts' +export { buildSandboxedPlugin, watchSandboxedPlugin } from './projects/sandboxed-plugins.ts' +export { buildConstants } from './projects/build-constants.ts' +export { buildContracts } from './projects/build-contracts.ts' // Linter -export { fixPluginsTSConfig } from './linter/plugin-projects.js' -export { lintPackageJson } from './linter/package-json.js' -export { lintIndex } from './linter/index-lint.js' -export { cleanPo } from './linter/po-files.js' +export { fixPluginsTSConfig } from './linter/plugin-projects.ts' +export { lintPackageJson } from './linter/package-json.ts' +export { lintIndex } from './linter/index-lint.ts' +export { cleanPo } from './linter/po-files.ts' diff --git a/packages/scripts/src/linter/index-lint.ts b/packages/scripts/src/linter/index-lint.ts index 0a69044273e6..ec9c8bf4ab91 100644 --- a/packages/scripts/src/linter/index-lint.ts +++ b/packages/scripts/src/linter/index-lint.ts @@ -1,6 +1,6 @@ -import { task } from '../utils/task.js' -import { readFile } from 'fs/promises' -import { ROOT_PATH } from '../utils/paths.js' +import { task } from '../utils/task.ts' +import { readFile } from 'node:fs/promises' +import { ROOT_PATH } from '../utils/paths.ts' import ts from 'typescript' const pattern = 'packages/**/index.ts' diff --git a/packages/scripts/src/linter/package-json.ts b/packages/scripts/src/linter/package-json.ts index c4ddfa9dec0f..a033e5ccba94 100644 --- a/packages/scripts/src/linter/package-json.ts +++ b/packages/scripts/src/linter/package-json.ts @@ -1,6 +1,6 @@ -import { task } from '../utils/task.js' -import { readFile, writeFile } from 'fs/promises' -import { ROOT_PATH } from '../utils/paths.js' +import { task } from '../utils/task.ts' +import { readFile, writeFile } from 'node:fs/promises' +import { ROOT_PATH } from '../utils/paths.ts' const pattern = 'packages/**/package.json' export async function lintPackageJson() { @@ -19,7 +19,7 @@ export async function lintPackageJson() { if (!('type' in json)) type.push(file) if ('lingui' in json) { - let template: any = { + const template: any = { compileNamespace: 'json', locales: ['en-US', 'ja-JP', 'ko-KR', 'zh-CN', 'zh-TW'], fallbackLocales: { diff --git a/packages/scripts/src/linter/plugin-projects.ts b/packages/scripts/src/linter/plugin-projects.ts index 8e707e27d485..e80de800efa3 100644 --- a/packages/scripts/src/linter/plugin-projects.ts +++ b/packages/scripts/src/linter/plugin-projects.ts @@ -1,10 +1,10 @@ -import { readFileSync } from 'fs' -import { fileURLToPath } from 'url' -import { task } from '../utils/task.js' -import { readdir, writeFile } from 'fs/promises' -import { join } from 'path' +import { readFileSync } from 'node:fs' +import { fileURLToPath } from 'node:url' +import { task } from '../utils/task.ts' +import { readdir, writeFile } from 'node:fs/promises' +import { join } from 'node:path' import { exists } from 'fs-extra' -import { prettier } from '../utils/prettier.js' +import { prettier } from '../utils/prettier.ts' export async function fixPluginsTSConfig() { const folder = new URL('../../../plugins', import.meta.url) diff --git a/packages/scripts/src/linter/po-files.ts b/packages/scripts/src/linter/po-files.ts index 4dcdd53c88aa..b313d67bdc7d 100644 --- a/packages/scripts/src/linter/po-files.ts +++ b/packages/scripts/src/linter/po-files.ts @@ -1,6 +1,6 @@ -import { task } from '../utils/task.js' -import { readFile, writeFile } from 'fs/promises' -import { ROOT_PATH } from '../utils/paths.js' +import { task } from '../utils/task.ts' +import { readFile, writeFile } from 'node:fs/promises' +import { ROOT_PATH } from '../utils/paths.ts' const pattern = 'packages/**/locale/*.po' @@ -17,7 +17,7 @@ export async function cleanPo() { str .split('\n') .map((x) => x.replace(/^#.+/, '')) - .filter((x) => x) + .filter(Boolean) .join('\n'), ) }), diff --git a/packages/scripts/src/locale-kit-next/index.ts b/packages/scripts/src/locale-kit-next/index.ts index fc2a9efdfa74..70402353ddfc 100644 --- a/packages/scripts/src/locale-kit-next/index.ts +++ b/packages/scripts/src/locale-kit-next/index.ts @@ -1,6 +1,6 @@ -import { readdir, writeFile } from 'fs/promises' -import { dirname } from 'path' -import { ROOT_PATH, task, prettier } from '../utils/index.js' +import { readdir, writeFile } from 'node:fs/promises' +import { dirname } from 'node:path' +import { ROOT_PATH, task, prettier } from '../utils/index.ts' const mainFallbackMap = new Map([['zh', 'zh-TW']]) @@ -25,16 +25,16 @@ export async function syncLanguages() { for (const [language] of languages) { code += `import ${language.replace('-', '_')} from './${language}.json' with { type: 'json' }\n` } - code += `export const languages = {\n` + code += 'export const languages = {\n' for (const [language, familyName] of languages) { code += ` '${familyName}': ${language.replace('-', '_')},\n` } - code += `}\n` + code += '}\n' // Non-plugin i18n files if (!poFile.includes('plugin')) { - const target = `@masknet/shared-base` + const target = '@masknet/shared-base' code += `import { createI18NBundle } from '${target}'\n` - code += `export const addI18N = createI18NBundle(languages as any)\n` + code += 'export const addI18N = createI18NBundle(languages as any)\n' } { @@ -53,16 +53,20 @@ export async function syncLanguages() { )` } code = await prettier(code) - await writeFile(new URL('languages.ts', inputDir), code, { encoding: 'utf8' }) + await writeFile(new URL('./languages.ts', inputDir), code, { encoding: 'utf8' }) } } { const map: Record = {} const code = await prettier(`${basicHeader}\nexport default ${JSON.stringify(map)}`) - await writeFile(new URL('packages/mask/background/services/helper/i18n-cache-query-list.ts', ROOT_PATH), code, { - encoding: 'utf8', - }) + await writeFile( + new URL('./packages/mask/background/services/helper/i18n-cache-query-list.ts', ROOT_PATH), + code, + { + encoding: 'utf8', + }, + ) } } task( diff --git a/packages/scripts/src/locale-kit-next/run-lingui.ts b/packages/scripts/src/locale-kit-next/run-lingui.ts index 74d48ecc5183..01677fbbea01 100644 --- a/packages/scripts/src/locale-kit-next/run-lingui.ts +++ b/packages/scripts/src/locale-kit-next/run-lingui.ts @@ -1,7 +1,7 @@ -import { readdir, readFile } from 'fs/promises' -import { join, relative } from 'path' -import { ROOT_PATH, task, shell, awaitChildProcess } from '../utils/index.js' -import { fileURLToPath } from 'url' +import { readdir, readFile } from 'node:fs/promises' +import { join, relative } from 'node:path' +import { ROOT_PATH, task, shell, awaitChildProcess } from '../utils/index.ts' +import { fileURLToPath } from 'node:url' async function getLinguiEnabledPackages() { const folders: string[] = [] diff --git a/packages/scripts/src/projects/build-constants.ts b/packages/scripts/src/projects/build-constants.ts index d8662b7259e1..a80322c539ed 100644 --- a/packages/scripts/src/projects/build-constants.ts +++ b/packages/scripts/src/projects/build-constants.ts @@ -1,8 +1,8 @@ import { promises as fs } from 'node:fs' import { resolve, join } from 'node:path' -import { awaitChildProcess } from '../utils/awaitChildProcess.js' -import { shell } from '../utils/run.js' -import { task } from '../utils/task.js' +import { awaitChildProcess } from '../utils/awaitChildProcess.ts' +import { shell } from '../utils/run.ts' +import { task } from '../utils/task.ts' type Primitive = string | number | boolean diff --git a/packages/scripts/src/projects/build-contracts.ts b/packages/scripts/src/projects/build-contracts.ts index c97f58b27843..09572f025c55 100644 --- a/packages/scripts/src/projects/build-contracts.ts +++ b/packages/scripts/src/projects/build-contracts.ts @@ -1,8 +1,8 @@ -import { promises as fs } from 'fs' -import { join } from 'path' -import { task } from '../utils/task.js' -import { awaitChildProcess } from '../utils/awaitChildProcess.js' -import { shell } from '../utils/run.js' +import { promises as fs } from 'node:fs' +import { join } from 'node:path' +import { task } from '../utils/task.ts' +import { awaitChildProcess } from '../utils/awaitChildProcess.ts' +import { shell } from '../utils/run.ts' import { rimraf } from 'rimraf' const ABIS_PATH = join(import.meta.dirname, '../../../web3-contracts/abis/') diff --git a/packages/scripts/src/projects/gun.ts b/packages/scripts/src/projects/gun.ts index 4442072ddd48..f04d9f2f13a8 100644 --- a/packages/scripts/src/projects/gun.ts +++ b/packages/scripts/src/projects/gun.ts @@ -1,7 +1,7 @@ -import { fromNPMTask, PKG_PATH } from '../utils/index.js' +import { fromNPMTask, PKG_PATH } from '../utils/index.ts' export const [buildGun] = fromNPMTask( // - new URL('gun-utils/', PKG_PATH), + new URL('./gun-utils/', PKG_PATH), 'gun', 'Build gun required for Mask Network.', ) diff --git a/packages/scripts/src/projects/injected-scripts.ts b/packages/scripts/src/projects/injected-scripts.ts index 5caab7981da6..3fece72c2dde 100644 --- a/packages/scripts/src/projects/injected-scripts.ts +++ b/packages/scripts/src/projects/injected-scripts.ts @@ -1,6 +1,6 @@ -import { fromNPMTask, PKG_PATH } from '../utils/index.js' +import { fromNPMTask, PKG_PATH } from '../utils/index.ts' export const [buildInjectedScript, watchInjectedScript] = fromNPMTask( - new URL('injected-script/', PKG_PATH), + new URL('./injected-script/', PKG_PATH), 'injected-script', 'An extra script that runs in the main frame to provide some extra functionality of Mask Network.', ) diff --git a/packages/scripts/src/projects/mask-sdk.ts b/packages/scripts/src/projects/mask-sdk.ts index 08466e614599..235c281ae93a 100644 --- a/packages/scripts/src/projects/mask-sdk.ts +++ b/packages/scripts/src/projects/mask-sdk.ts @@ -1,7 +1,7 @@ -import { fromNPMTask, PKG_PATH } from '../utils/index.js' +import { fromNPMTask, PKG_PATH } from '../utils/index.ts' export const [buildMaskSDK, watchMaskSDK] = fromNPMTask( // - new URL('mask-sdk/', PKG_PATH), + new URL('./mask-sdk/', PKG_PATH), 'mask-sdk', 'Build Mask SDK.', ) diff --git a/packages/scripts/src/projects/polyfill.ts b/packages/scripts/src/projects/polyfill.ts index e4759520a791..b1ea9d9fa104 100644 --- a/packages/scripts/src/projects/polyfill.ts +++ b/packages/scripts/src/projects/polyfill.ts @@ -1,6 +1,6 @@ -import { fromNPMTask, PKG_PATH } from '../utils/index.js' +import { fromNPMTask, PKG_PATH } from '../utils/index.ts' export const [buildPolyfill] = fromNPMTask( - new URL('polyfills/', PKG_PATH), + new URL('./polyfills/', PKG_PATH), 'polyfill', 'Build polyfill required for Mask Network.', ) diff --git a/packages/scripts/src/projects/sandboxed-plugins.ts b/packages/scripts/src/projects/sandboxed-plugins.ts index 8b7a34079cf4..e12326f52ed9 100644 --- a/packages/scripts/src/projects/sandboxed-plugins.ts +++ b/packages/scripts/src/projects/sandboxed-plugins.ts @@ -4,13 +4,13 @@ import { readdir, readFile, writeFile } from 'node:fs/promises' import { isAbsolute, join, relative } from 'node:path' import { createRequire } from 'node:module' import { ensureDir } from 'fs-extra' -import { awaitTask, watchTask } from '../utils/task.js' -import { PKG_PATH, ROOT_PATH } from '../utils/paths.js' -import { parseJSONc } from '../utils/jsonc.js' +import { awaitTask, watchTask } from '../utils/task.ts' +import { PKG_PATH, ROOT_PATH } from '../utils/paths.ts' +import { parseJSONc } from '../utils/jsonc.ts' import { transform } from '@swc/core' import { dest, lastRun, parallel, src, type TaskFunction } from 'gulp' import { parseArgs } from 'node:util' -import { getLanguageFamilyName } from '../locale-kit-next/index.js' +import { getLanguageFamilyName } from '../locale-kit-next/index.ts' const require = createRequire(new URL(import.meta.url)) const sandboxedPlugins = new URL('./sandboxed-plugins/', PKG_PATH) @@ -110,14 +110,14 @@ export async function buildSandboxedPluginConfigurable(distPath: string, isProdu join(distPath, './mv3-preload.js'), mv3PreloadList.size ? (function* () { - yield `importScripts(\n` + yield 'importScripts(\n' for (const file of mv3PreloadList) { if (file.includes('\\') || file.includes('"')) throw new TypeError('Invalid path') yield ' "/sandboxed-modules/' yield file yield '", \n' } - yield `)\nnull` + yield ')\nnull' })() : 'null', { encoding: 'utf-8' }, @@ -199,7 +199,7 @@ async function getLocales(manifest: any, manifestPath: string): Promise x.isFile()).map((x) => x.name)) return [...languageFamily].map( @@ -210,11 +210,12 @@ async function getLocales(manifest: any, manifestPath: string): Promise void, - ) { + public origin: string + public onJS: (id: string, relative: string) => void + constructor(origin: string, onJS: (id: string, relative: string) => void) { super({ objectMode: true, defaultEncoding: 'utf-8' }) + this.origin = origin + this.onJS = onJS } wasm = require.resolve('@masknet/static-module-record-swc') override _transform( @@ -225,7 +226,7 @@ class TransformStream extends Transform { if (!(file.path.endsWith('.js') || file.path.endsWith('.mjs'))) { return callback(null, file) } - const relative = file.relative.replace(/\\/g, '/') + const relative = file.relative.replaceAll('\\', '/') this.onJS(this.origin, file.relative) const sandboxedPath = 'mask-modules://' + this.origin + '/' + relative const options = { diff --git a/packages/scripts/src/projects/sentry.ts b/packages/scripts/src/projects/sentry.ts index 5763a6adaa67..e46f125a81f5 100644 --- a/packages/scripts/src/projects/sentry.ts +++ b/packages/scripts/src/projects/sentry.ts @@ -1,3 +1,3 @@ -import { fromNPMTask, PKG_PATH } from '../utils/index.js' +import { fromNPMTask, PKG_PATH } from '../utils/index.ts' -export const [buildSentry] = fromNPMTask(new URL('sentry/', PKG_PATH), 'build-sentry', 'Build sentry.') +export const [buildSentry] = fromNPMTask(new URL('./sentry/', PKG_PATH), 'build-sentry', 'Build sentry.') diff --git a/packages/scripts/src/spellcheck/index.ts b/packages/scripts/src/spellcheck/index.ts index f13e044721f3..a99b1b409cbc 100644 --- a/packages/scripts/src/spellcheck/index.ts +++ b/packages/scripts/src/spellcheck/index.ts @@ -1,7 +1,7 @@ -import { readFile, writeFile } from 'fs/promises' -import { prettier, ROOT_PATH, task } from '../utils/index.js' +import { readFile, writeFile } from 'node:fs/promises' +import { prettier, ROOT_PATH, task } from '../utils/index.ts' -const CONFIGURE_PATH = new URL('cspell.json', ROOT_PATH) +const CONFIGURE_PATH = new URL('./cspell.json', ROOT_PATH) interface RootConfigure extends Configure { overrides?: Configure[] diff --git a/packages/scripts/src/utils/awaitChildProcess.ts b/packages/scripts/src/utils/awaitChildProcess.ts index 9a982f599f76..069e96a71e5d 100644 --- a/packages/scripts/src/utils/awaitChildProcess.ts +++ b/packages/scripts/src/utils/awaitChildProcess.ts @@ -1,4 +1,4 @@ -import type { ChildProcess } from 'child_process' +import type { ChildProcess } from 'node:child_process' export function awaitChildProcess(child: ChildProcess) { return new Promise((resolve, reject) => { diff --git a/packages/scripts/src/utils/exit.ts b/packages/scripts/src/utils/exit.ts index 9ab6358dfb4b..5f9e145bf2ae 100644 --- a/packages/scripts/src/utils/exit.ts +++ b/packages/scripts/src/utils/exit.ts @@ -1,4 +1,4 @@ -import type { ChildProcess } from 'child_process' +import type { ChildProcess } from 'node:child_process' import { series, type TaskFunction } from 'gulp' const childProcess: ChildProcess[] = [] diff --git a/packages/scripts/src/utils/index.ts b/packages/scripts/src/utils/index.ts index 93406d28a644..3c199b164dfe 100644 --- a/packages/scripts/src/utils/index.ts +++ b/packages/scripts/src/utils/index.ts @@ -1,8 +1,8 @@ -export * from './paths.js' -export * from './awaitChildProcess.js' -export * from './prettier.js' -export * from './task.js' -export * from './run.js' -export * from './process-lock.js' -export * from './write.js' -export * from './exit.js' +export * from './paths.ts' +export * from './awaitChildProcess.ts' +export * from './prettier.ts' +export * from './task.ts' +export * from './run.ts' +export * from './process-lock.ts' +export * from './write.ts' +export * from './exit.ts' diff --git a/packages/scripts/src/utils/paths.ts b/packages/scripts/src/utils/paths.ts index 90f7370cfd8b..bcefa077e6da 100644 --- a/packages/scripts/src/utils/paths.ts +++ b/packages/scripts/src/utils/paths.ts @@ -1,2 +1,2 @@ export const ROOT_PATH = new URL('../../../../', import.meta.url) -export const PKG_PATH = new URL('packages/', ROOT_PATH) +export const PKG_PATH = new URL('./packages/', ROOT_PATH) diff --git a/packages/scripts/src/utils/prettier.ts b/packages/scripts/src/utils/prettier.ts index 969edc2729de..2cb815eb72e0 100644 --- a/packages/scripts/src/utils/prettier.ts +++ b/packages/scripts/src/utils/prettier.ts @@ -1,5 +1,5 @@ import type { Options } from 'prettier' -import { ROOT_PATH } from './paths.js' +import { ROOT_PATH } from './paths.ts' export async function prettier(code: string, parser: Options['parser'] = 'typescript', tabWidth = 4) { const { diff --git a/packages/scripts/src/utils/process-lock.ts b/packages/scripts/src/utils/process-lock.ts index efd8cb165f31..fb632abd1933 100644 --- a/packages/scripts/src/utils/process-lock.ts +++ b/packages/scripts/src/utils/process-lock.ts @@ -1,12 +1,14 @@ // TODO: load this lazy import Lock from 'proper-lockfile' -import { fileURLToPath } from 'url' +import { fileURLToPath } from 'node:url' export async function getProcessLock(lockName: string) { const lockfilePath = getLockPosition(lockName) while (true) { if (isLocked(lockName)) { - await new Promise((resolve) => setTimeout(resolve, 500)) + await new Promise((resolve) => { + setTimeout(resolve, 500) + }) } else { try { Lock.lockSync(import.meta.filename, { lockfilePath, update: 200 }) diff --git a/packages/scripts/src/utils/run.ts b/packages/scripts/src/utils/run.ts index 258f5f4ae402..3daf81dd2fec 100644 --- a/packages/scripts/src/utils/run.ts +++ b/packages/scripts/src/utils/run.ts @@ -1,9 +1,9 @@ -import { spawn } from 'child_process' -import { ROOT_PATH } from './paths.js' -import { relative } from 'path' +import { spawn } from 'node:child_process' +import { ROOT_PATH } from './paths.ts' +import { relative } from 'node:path' import chalk from 'chalk' -import { fileURLToPath } from 'url' -import { markChildProcess } from './exit.js' +import { fileURLToPath } from 'node:url' +import { markChildProcess } from './exit.ts' function logShell(e: string, args: string[], url: URL | string) { if (typeof url === 'object') url = fileURLToPath(url) diff --git a/packages/scripts/src/utils/task.ts b/packages/scripts/src/utils/task.ts index 0ac6cacee613..6582ee84e6e6 100644 --- a/packages/scripts/src/utils/task.ts +++ b/packages/scripts/src/utils/task.ts @@ -1,7 +1,7 @@ import { series, type TaskFunction } from 'gulp' -import { shell } from './run.js' -import { awaitChildProcess } from './awaitChildProcess.js' -import { cleanupWhenExit } from './exit.js' +import { shell } from './run.ts' +import { awaitChildProcess } from './awaitChildProcess.ts' +import { cleanupWhenExit } from './exit.ts' export function task( f: T, diff --git a/packages/scripts/src/utils/write.ts b/packages/scripts/src/utils/write.ts index 78f3bbae4fbb..5f9fd138e5dc 100644 --- a/packages/scripts/src/utils/write.ts +++ b/packages/scripts/src/utils/write.ts @@ -1,5 +1,5 @@ -import { readFile, writeFile } from 'fs/promises' -import { prettier } from './prettier.js' +import { readFile, writeFile } from 'node:fs/promises' +import { prettier } from './prettier.ts' export async function changeFile(path: string | URL, f: (x: string) => string | Promise) { const content = await readFile(path, 'utf8') diff --git a/packages/scripts/tsconfig.json b/packages/scripts/tsconfig.json index 2848410355a0..29157ea692da 100644 --- a/packages/scripts/tsconfig.json +++ b/packages/scripts/tsconfig.json @@ -3,7 +3,8 @@ "compilerOptions": { "lib": ["ESNext"], "composite": false, - "incremental": false + "incremental": false, + "allowImportingTsExtensions": true }, "include": ["./src"] } diff --git a/packages/web3-shared/evm/src/helpers/isValidDomain.ts b/packages/web3-shared/evm/src/helpers/isValidDomain.ts index 2cd11f0ee19c..c9223a326e93 100644 --- a/packages/web3-shared/evm/src/helpers/isValidDomain.ts +++ b/packages/web3-shared/evm/src/helpers/isValidDomain.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line unicorn/prefer-node-protocol import punycode from 'punycode' // cspell:ignore binanceus klever kresus taiko diff --git a/patches/gulp@5.0.0.patch b/patches/gulp.patch similarity index 55% rename from patches/gulp@5.0.0.patch rename to patches/gulp.patch index 6a033d6ad8e2..88e4e1954b8d 100644 --- a/patches/gulp@5.0.0.patch +++ b/patches/gulp.patch @@ -1,18 +1,16 @@ diff --git a/bin/gulp.js b/bin/gulp.js -index f4b80cc41c688105989296a0731729a171b27ac0..168717d5afce46eeefa118dd9aa6ef9a8f455ded 100755 +index f4b80cc41c688105989296a0731729a171b27ac0..d0703389c9cb8fc7bea0a1ef8e7b920fe354fa0a 100755 --- a/bin/gulp.js +++ b/bin/gulp.js -@@ -1,3 +1,3 @@ +@@ -1,3 +1,2 @@ #!/usr/bin/env node - --require('gulp-cli')(); -+const cli = require('gulp-cli'); -+cli(); -diff --git a/bin/swc-gulp.js b/bin/swc-gulp.js + require('gulp-cli')(); +diff --git a/bin/ts-gulp.js b/bin/ts-gulp.js new file mode 100644 -index 0000000000000000000000000000000000000000..a14351c2a7743af318d7efab246099c142bf3813 +index 0000000000000000000000000000000000000000..a8e66080f68b94741ebfc5fe76336f4aea9c4897 --- /dev/null -+++ b/bin/swc-gulp.js ++++ b/bin/ts-gulp.js @@ -0,0 +1,17 @@ +#!/usr/bin/env node + @@ -21,18 +19,18 @@ index 0000000000000000000000000000000000000000..a14351c2a7743af318d7efab246099c1 +const child = spawnSync( + process.execPath, + [ -+ '--import', -+ '@swc-node/register/esm-register', ++ '--disable-warning=ExperimentalWarning', ++ '--experimental-strip-types', + join(__dirname, './gulp.js'), + ...process.argv.slice(2), + ], + { + stdio: 'inherit', -+ } ++ }, +); +if (child.status) process.exit(child.status); diff --git a/package.json b/package.json -index be5477ddf77fc32ebce569347c38ac322dbda6e7..c27a348e4c84f08865c91ece656b41145440064b 100644 +index be5477ddf77fc32ebce569347c38ac322dbda6e7..68a2a528abe62341b10f31a87687833065724700 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ @@ -40,7 +38,7 @@ index be5477ddf77fc32ebce569347c38ac322dbda6e7..c27a348e4c84f08865c91ece656b4114 ], "bin": { - "gulp": "./bin/gulp.js" -+ "gulp": "./bin/swc-gulp.js" ++ "gulp": "./bin/ts-gulp.js" }, "scripts": { "lint": "eslint .", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e0fd1a6ebbb0..506a116d3ecc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -57,9 +57,9 @@ patchedDependencies: eslint-plugin-i@2.29.1: hash: zgide6rxzjqivhxxv36ouq6c4y path: patches/eslint-plugin-i@2.29.1.patch - gulp@5.0.0: - hash: 43h33nymtjr4cs2ejuui5ulgfe - path: patches/gulp@5.0.0.patch + gulp: + hash: tdwx5kqhf6grdas2dblneqarim + path: patches/gulp.patch react-devtools-inline@5.3.0: hash: jy5l47kz5zhgguiggeursqr63y path: patches/react-devtools-inline@5.3.0.patch @@ -189,9 +189,6 @@ importers: '@nice-labs/git-rev': specifier: ^3.5.1 version: 3.5.1 - '@swc-node/register': - specifier: ^1.10.9 - version: 1.10.9(@swc/core@1.11.7(@swc/helpers@0.5.15))(@swc/types@0.1.19)(typescript@5.8.2) '@swc/core': specifier: 1.11.7 version: 1.11.7(@swc/helpers@0.5.15) @@ -239,7 +236,7 @@ importers: version: 4.1.4(@typescript-eslint/eslint-plugin@8.26.0(@typescript-eslint/parser@8.26.0(eslint@9.21.0(jiti@2.4.2))(typescript@5.8.2))(eslint@9.21.0(jiti@2.4.2))(typescript@5.8.2))(eslint@9.21.0(jiti@2.4.2)) gulp: specifier: ^5.0.0 - version: 5.0.0(patch_hash=43h33nymtjr4cs2ejuui5ulgfe) + version: 5.0.0(patch_hash=tdwx5kqhf6grdas2dblneqarim) husky: specifier: ^9.1.7 version: 9.1.7 @@ -349,6 +346,10 @@ importers: gun: specifier: 0.2020.1234 version: 0.2020.1234(bufferutil@4.0.8)(utf-8-validate@5.0.10) + devDependencies: + '@swc/core': + specifier: 1.11.7 + version: 1.11.7(@swc/helpers@0.5.15) packages/icons: {} @@ -2184,9 +2185,6 @@ importers: packages/polyfills: dependencies: - '@types/webextension-polyfill': - specifier: ^0.10.7 - version: 0.10.7 core-js: specifier: 3.41.0 version: 3.41.0 @@ -2209,6 +2207,9 @@ importers: '@types/node': specifier: 22.13.9 version: 22.13.9 + '@types/webextension-polyfill': + specifier: ^0.10.7 + version: 0.10.7 core-js-compat: specifier: 3.41.0 version: 3.41.0 @@ -4072,15 +4073,6 @@ packages: '@dual-bundle/import-meta-resolve@4.1.0': resolution: {integrity: sha512-+nxncfwHM5SgAtrVzgpzJOI1ol0PkumhVo469KCf9lUi21IGcY90G98VuHm9VRrUypmAzawAHO9bs6hqeADaVg==} - '@emnapi/core@1.2.0': - resolution: {integrity: sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w==} - - '@emnapi/runtime@1.2.0': - resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} - - '@emnapi/wasi-threads@1.0.1': - resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} - '@emotion/babel-plugin@11.11.0': resolution: {integrity: sha512-m4HEDZleaaCH+XgDDsPF15Ht6wTLsgDTeR3WYj9Q/k76JtWhrJjcP4+/XlG8LGT/Rol9qUfOIztXeA84ATpqPQ==} @@ -5574,9 +5566,6 @@ packages: resolution: {integrity: sha512-odBwQ/EyQh3/CVMTxVD95EWsOI6I7T02+4gpVNVDNR4+yoQuFjsq8yb3+618oXJCunpShiKO9XmX4ve1mCzyLQ==} engines: {node: '>= 10'} - '@napi-rs/wasm-runtime@0.2.4': - resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} - '@nice-labs/emit-file-webpack-plugin@1.1.4': resolution: {integrity: sha512-yNYzYN6N2wrcoOcxfNgBP7GLVoewfV7vsg4muVLAJdIBQWnXx+t7d/MEp0n3BYhcxH4MEjm6IZ6jDVzFa3zkJw==} engines: {node: '>= 12'} @@ -5686,65 +5675,6 @@ packages: resolution: {integrity: sha512-ssLUjjj/DXl6m4oydyA6vgVHyJcis4Ui0hS7+EyOxZVMXbiVZeGOficfJfgELTNqTbHLmTb3TBVyJspNDkqbLw==} deprecated: OvernightJS/logger has been deprecated in favor of jet-logger - '@oxc-resolver/binding-darwin-arm64@1.10.2': - resolution: {integrity: sha512-aOCZYXqmFL+2sXlaVkYbAOtICGGeTFtmdul8OimQfOXHJods6YHJ2nR6+rEeBcJzaXyXPP18ne1IsEc4AYL1IA==} - cpu: [arm64] - os: [darwin] - - '@oxc-resolver/binding-darwin-x64@1.10.2': - resolution: {integrity: sha512-6WD7lHGkoduFZfUgnC2suKOlqttQRKxWsiVXiiGPu3mfXvQAhMd/gekuH1t8vOhFlPJduaww15n5UB0bSjCK+w==} - cpu: [x64] - os: [darwin] - - '@oxc-resolver/binding-freebsd-x64@1.10.2': - resolution: {integrity: sha512-nEqHWx/Ot5p7Mafj8qH6vFlLSvHjECxAcZwhnAMqRuQu1NgXC/QM3emkdhVGy7QJgsxZbHpPaF6TERNf5/NL9Q==} - cpu: [x64] - os: [freebsd] - - '@oxc-resolver/binding-linux-arm-gnueabihf@1.10.2': - resolution: {integrity: sha512-+AlZI0fPnpfArh8aC5k2295lmQrxa2p8gBLxC3buvCkz0ZpbVLxyyAXz3J2jGwJnmc5MUPLEqPYw6ZlAGH4XHA==} - cpu: [arm] - os: [linux] - - '@oxc-resolver/binding-linux-arm64-gnu@1.10.2': - resolution: {integrity: sha512-8fZ8NszFaUZaoA8eUwkF2lHjgUs76aFiewWgG/cjcZmwKp+ErZQLW8eOvIWZ4SohHQ+ScvhVsSaU2PU38c88gw==} - cpu: [arm64] - os: [linux] - libc: [glibc] - - '@oxc-resolver/binding-linux-arm64-musl@1.10.2': - resolution: {integrity: sha512-oPrLICrw96Ym9n04FWXWGkbkpF6qJtZ57JSnqI3oQ24xHTt4iWyjHKHQO46NbJAK9sFb3Qce4BzV8faDI5Rifg==} - cpu: [arm64] - os: [linux] - libc: [musl] - - '@oxc-resolver/binding-linux-x64-gnu@1.10.2': - resolution: {integrity: sha512-eli74jTAUiIfqi8IPFqiPxQS69Alcr6w/IFRyf3XxrkxeFGgcgxJkRIxWNTKJ6T3EXxjuma+49LdZn6l9rEj7A==} - cpu: [x64] - os: [linux] - libc: [glibc] - - '@oxc-resolver/binding-linux-x64-musl@1.10.2': - resolution: {integrity: sha512-HH9zmjNSQo3rkbqJH5nIjGrtjC+QPrUy0KGGMR/oRCSLuD0cNFJ/Uly1XAugwSm4oEw0+rv6PmeclXmVTKsxhw==} - cpu: [x64] - os: [linux] - libc: [musl] - - '@oxc-resolver/binding-wasm32-wasi@1.10.2': - resolution: {integrity: sha512-3ItX23q33sfVBtMMdMhVDSe0NX5zBHxHfmFiXhSJuwNaVIwGpLFU7WU2nmq9oNdnmTOvjL8vlhOqiGvumBLlRA==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@oxc-resolver/binding-win32-arm64-msvc@1.10.2': - resolution: {integrity: sha512-aVoj2V+jmQ1N+lVy9AhaLmzssJM0lcKt8D0UL83aNLZJ5lSN7hgBuUXTVmL+VF268f167khjo38z+fbELDVm8Q==} - cpu: [arm64] - os: [win32] - - '@oxc-resolver/binding-win32-x64-msvc@1.10.2': - resolution: {integrity: sha512-l8BDQWyP0Piw8hlmYPUqTRKLsq+ceG9h+9p6ZrjNzwW9AmJX7T7T2hgoVVHqS6f4WNA/CFkb3RyZP9QTzNkyyA==} - cpu: [x64] - os: [win32] - '@parcel/watcher-android-arm64@2.3.0': resolution: {integrity: sha512-f4o9eA3dgk0XRT3XhB0UWpWpLnKgrh1IwNJKJ7UJek7eTYccQ8LR7XUWFKqw6aEq5KUNlCcGvSzKqSX/vtWVVA==} engines: {node: '>= 10.0.0'} @@ -6634,22 +6564,6 @@ packages: '@streamparser/json@0.0.20': resolution: {integrity: sha512-VqAAkydywPpkw63WQhPVKCD3SdwXuihCUVZbbiY3SfSTGQyHmwRoq27y4dmJdZuJwd5JIlQoMPyGvMbUPY0RKQ==} - '@swc-node/core@1.13.3': - resolution: {integrity: sha512-OGsvXIid2Go21kiNqeTIn79jcaX4l0G93X2rAnas4LFoDyA9wAwVK7xZdm+QsKoMn5Mus2yFLCc4OtX2dD/PWA==} - engines: {node: '>= 10'} - peerDependencies: - '@swc/core': 1.11.7 - '@swc/types': '>= 0.1' - - '@swc-node/register@1.10.9': - resolution: {integrity: sha512-iXy2sjP0phPEpK2yivjRC3PAgoLaT4sjSk0LDWCTdcTBJmR4waEog0E6eJbvoOkLkOtWw37SB8vCkl/bbh4+8A==} - peerDependencies: - '@swc/core': 1.11.7 - typescript: '>= 4.3' - - '@swc-node/sourcemap-support@0.5.1': - resolution: {integrity: sha512-JxIvIo/Hrpv0JCHSyRpetAdQ6lB27oFYhv0PKCNf1g2gUXOjpeR1exrXccRxLMuAV5WAmGFBwRnNOJqN38+qtg==} - '@swc/core-darwin-arm64@1.11.7': resolution: {integrity: sha512-3+LhCP2H50CLI6yv/lhOtoZ5B/hi7Q/23dye1KhbSDeDprLTm/KfLJh/iQqwaHUponf5m8C2U0y6DD+HGLz8Yw==} engines: {node: '>=10'} @@ -6797,9 +6711,6 @@ packages: '@tsconfig/node16@1.0.3': resolution: {integrity: sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==} - '@tybys/wasm-util@0.9.0': - resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} - '@typechain/web3-v1@6.0.7': resolution: {integrity: sha512-HWkGplyPL3eWiP0sszqKZh6Bjrdm23srtirUdKp/4BEWKp/o6zofLt8lDn468bRQlQdHaobrbfEeT+3gf/r4eg==} peerDependencies: @@ -12843,9 +12754,6 @@ packages: outvariant@1.4.2: resolution: {integrity: sha512-Ou3dJ6bA/UJ5GVHxah4LnqDwZRwAmWxrG3wtrHrbGnP4RnLCtA64A4F+ae7Y8ww660JaddSoArUR5HjipWSHAQ==} - oxc-resolver@1.10.2: - resolution: {integrity: sha512-NIbwVqoU8Bhl7PVtItHCg+VFFokIDwBgIgFUwFG2Y8ePhxftFh5xG+KLar5PLWXlCP4WunPIuXD3jr3v6/MfRw==} - p-cancelable@2.1.1: resolution: {integrity: sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==} engines: {node: '>=8'} @@ -17536,22 +17444,6 @@ snapshots: '@dual-bundle/import-meta-resolve@4.1.0': {} - '@emnapi/core@1.2.0': - dependencies: - '@emnapi/wasi-threads': 1.0.1 - tslib: 2.8.1 - optional: true - - '@emnapi/runtime@1.2.0': - dependencies: - tslib: 2.8.1 - optional: true - - '@emnapi/wasi-threads@1.0.1': - dependencies: - tslib: 2.8.1 - optional: true - '@emotion/babel-plugin@11.11.0': dependencies: '@babel/helper-module-imports': 7.25.9 @@ -19802,13 +19694,6 @@ snapshots: '@napi-rs/image-win32-x64-msvc': 1.4.1 optional: true - '@napi-rs/wasm-runtime@0.2.4': - dependencies: - '@emnapi/core': 1.2.0 - '@emnapi/runtime': 1.2.0 - '@tybys/wasm-util': 0.9.0 - optional: true - '@nice-labs/emit-file-webpack-plugin@1.1.4(webpack@5.88.2)': dependencies: webpack: https://codeload.github.com/Jack-Works/webpack/tar.gz/f7244d8e23e799b84a536efb2fdccec5370ac37e(@swc/core@1.11.7(@swc/helpers@0.5.15))(webpack-cli@6.0.1) @@ -19934,41 +19819,6 @@ snapshots: colors: 1.4.0 util: 0.11.1 - '@oxc-resolver/binding-darwin-arm64@1.10.2': - optional: true - - '@oxc-resolver/binding-darwin-x64@1.10.2': - optional: true - - '@oxc-resolver/binding-freebsd-x64@1.10.2': - optional: true - - '@oxc-resolver/binding-linux-arm-gnueabihf@1.10.2': - optional: true - - '@oxc-resolver/binding-linux-arm64-gnu@1.10.2': - optional: true - - '@oxc-resolver/binding-linux-arm64-musl@1.10.2': - optional: true - - '@oxc-resolver/binding-linux-x64-gnu@1.10.2': - optional: true - - '@oxc-resolver/binding-linux-x64-musl@1.10.2': - optional: true - - '@oxc-resolver/binding-wasm32-wasi@1.10.2': - dependencies: - '@napi-rs/wasm-runtime': 0.2.4 - optional: true - - '@oxc-resolver/binding-win32-arm64-msvc@1.10.2': - optional: true - - '@oxc-resolver/binding-win32-x64-msvc@1.10.2': - optional: true - '@parcel/watcher-android-arm64@2.3.0': optional: true @@ -21103,31 +20953,6 @@ snapshots: '@streamparser/json@0.0.20': {} - '@swc-node/core@1.13.3(@swc/core@1.11.7(@swc/helpers@0.5.15))(@swc/types@0.1.19)': - dependencies: - '@swc/core': 1.11.7(@swc/helpers@0.5.15) - '@swc/types': 0.1.19 - - '@swc-node/register@1.10.9(@swc/core@1.11.7(@swc/helpers@0.5.15))(@swc/types@0.1.19)(typescript@5.8.2)': - dependencies: - '@swc-node/core': 1.13.3(@swc/core@1.11.7(@swc/helpers@0.5.15))(@swc/types@0.1.19) - '@swc-node/sourcemap-support': 0.5.1 - '@swc/core': 1.11.7(@swc/helpers@0.5.15) - colorette: 2.0.20 - debug: 4.3.7 - oxc-resolver: 1.10.2 - pirates: 4.0.6 - tslib: 2.8.1 - typescript: 5.8.2 - transitivePeerDependencies: - - '@swc/types' - - supports-color - - '@swc-node/sourcemap-support@0.5.1': - dependencies: - source-map-support: 0.5.21 - tslib: 2.8.1 - '@swc/core-darwin-arm64@1.11.7': optional: true @@ -21244,11 +21069,6 @@ snapshots: '@tsconfig/node16@1.0.3': {} - '@tybys/wasm-util@0.9.0': - dependencies: - tslib: 2.8.1 - optional: true - '@typechain/web3-v1@6.0.7(typechain@8.3.2(typescript@5.8.2))(typescript@5.8.2)(web3-core@1.10.4(encoding@0.1.13))(web3-eth-contract@1.10.2(encoding@0.1.13))(web3@1.10.2(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10))': dependencies: lodash: 4.17.21 @@ -21265,20 +21085,20 @@ snapshots: '@types/babel__core@7.20.5': dependencies: - '@babel/parser': 7.26.2 - '@babel/types': 7.26.0 + '@babel/parser': 7.26.9 + '@babel/types': 7.26.9 '@types/babel__generator': 7.6.8 '@types/babel__template': 7.4.4 '@types/babel__traverse': 7.20.6 '@types/babel__generator@7.6.8': dependencies: - '@babel/types': 7.26.0 + '@babel/types': 7.26.9 '@types/babel__template@7.4.4': dependencies: - '@babel/parser': 7.26.2 - '@babel/types': 7.26.0 + '@babel/parser': 7.26.9 + '@babel/types': 7.26.9 '@types/babel__traverse@7.20.6': dependencies: @@ -23194,7 +23014,7 @@ snapshots: babel-plugin-jest-hoist@28.1.3: dependencies: '@babel/template': 7.25.9 - '@babel/types': 7.26.0 + '@babel/types': 7.26.9 '@types/babel__core': 7.20.5 '@types/babel__traverse': 7.20.6 @@ -26494,7 +26314,7 @@ snapshots: v8flags: 4.0.1 yargs: 16.2.0 - gulp@5.0.0(patch_hash=43h33nymtjr4cs2ejuui5ulgfe): + gulp@5.0.0(patch_hash=tdwx5kqhf6grdas2dblneqarim): dependencies: glob-watcher: 6.0.0 gulp-cli: 3.0.0 @@ -27419,7 +27239,7 @@ snapshots: istanbul-lib-instrument@5.2.1: dependencies: '@babel/core': 7.26.0 - '@babel/parser': 7.26.2 + '@babel/parser': 7.26.9 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.2 semver: 6.3.1 @@ -27762,10 +27582,10 @@ snapshots: jest-snapshot@28.1.3: dependencies: '@babel/core': 7.26.0 - '@babel/generator': 7.26.2 + '@babel/generator': 7.26.9 '@babel/plugin-syntax-typescript': 7.25.9(@babel/core@7.26.0) - '@babel/traverse': 7.25.9 - '@babel/types': 7.26.0 + '@babel/traverse': 7.26.5 + '@babel/types': 7.26.9 '@jest/expect-utils': 28.1.3 '@jest/transform': 28.1.3 '@jest/types': 28.1.3 @@ -27783,7 +27603,7 @@ snapshots: jest-util: 28.1.3 natural-compare: 1.4.0 pretty-format: 28.1.3 - semver: 7.6.3 + semver: 7.7.1 transitivePeerDependencies: - supports-color @@ -28355,7 +28175,7 @@ snapshots: make-dir@4.0.0: dependencies: - semver: 7.6.3 + semver: 7.7.1 make-error@1.3.6: {} @@ -29317,20 +29137,6 @@ snapshots: outvariant@1.4.2: {} - oxc-resolver@1.10.2: - optionalDependencies: - '@oxc-resolver/binding-darwin-arm64': 1.10.2 - '@oxc-resolver/binding-darwin-x64': 1.10.2 - '@oxc-resolver/binding-freebsd-x64': 1.10.2 - '@oxc-resolver/binding-linux-arm-gnueabihf': 1.10.2 - '@oxc-resolver/binding-linux-arm64-gnu': 1.10.2 - '@oxc-resolver/binding-linux-arm64-musl': 1.10.2 - '@oxc-resolver/binding-linux-x64-gnu': 1.10.2 - '@oxc-resolver/binding-linux-x64-musl': 1.10.2 - '@oxc-resolver/binding-wasm32-wasi': 1.10.2 - '@oxc-resolver/binding-win32-arm64-msvc': 1.10.2 - '@oxc-resolver/binding-win32-x64-msvc': 1.10.2 - p-cancelable@2.1.1: {} p-cancelable@3.0.0: {} @@ -32926,6 +32732,3 @@ snapshots: zod@3.24.2: {} zwitch@2.0.2: {} - -time: - '@types/web@0.0.183': '2024-11-24T04:09:59.071Z' From 49df46cdac454dc214c17a80d7cd9a085531a862 Mon Sep 17 00:00:00 2001 From: Jack Works <5390719+Jack-Works@users.noreply.github.com> Date: Fri, 11 Apr 2025 15:27:18 +0800 Subject: [PATCH 15/20] refactor: remove TransactionWatcher hack (#12188) --- .../src/Web3/Base/state/TransactionWatcher.ts | 6 ++++-- packages/web3-providers/src/Web3/EVM/apis/Web3StateAPI.ts | 3 +-- packages/web3-shared/base/src/specs/index.ts | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/web3-providers/src/Web3/Base/state/TransactionWatcher.ts b/packages/web3-providers/src/Web3/Base/state/TransactionWatcher.ts index 9a9220db5adc..6b1ef9954034 100644 --- a/packages/web3-providers/src/Web3/Base/state/TransactionWatcher.ts +++ b/packages/web3-providers/src/Web3/Base/state/TransactionWatcher.ts @@ -85,13 +85,15 @@ export abstract class TransactionWatcherState Array> }, - ) { + ) {} + + start() { const checker = new Checker(this.options.getTransactionCheckers(), this.subscriptions, { delay: this.options.defaultBlockDelay * 1000, onNotify: this.notifyTransaction.bind(this), }) - mergeSubscription(subscriptions.chainId, subscriptions.transactions).subscribe(() => { + mergeSubscription(this.subscriptions.chainId, this.subscriptions.transactions).subscribe(() => { checker.startCheck() }) } diff --git a/packages/web3-providers/src/Web3/EVM/apis/Web3StateAPI.ts b/packages/web3-providers/src/Web3/EVM/apis/Web3StateAPI.ts index e140173c9cb6..fbb3b5d8c22e 100644 --- a/packages/web3-providers/src/Web3/EVM/apis/Web3StateAPI.ts +++ b/packages/web3-providers/src/Web3/EVM/apis/Web3StateAPI.ts @@ -91,7 +91,6 @@ export async function createEVMState(context: WalletAPI.IOContext): Promise { ) => Promise> } export interface TransactionWatcherState { + start(): void emitter: Emitter> /** Notify error */ From 968f06f8713ba636b7a30de10cf17979d18e14b6 Mon Sep 17 00:00:00 2001 From: Wukong Sun Date: Mon, 14 Apr 2025 12:49:56 +0800 Subject: [PATCH 16/20] fix: mf-6691 record cloud backup timestamp (#12202) --- .../modals/BackupPreviewModal/BackupPreviewDialog.tsx | 4 ++++ packages/mask/popups/modals/PersonaSettingModal/index.tsx | 1 + 2 files changed, 5 insertions(+) diff --git a/packages/mask/dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx b/packages/mask/dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx index 2e0e7c2adfe7..7053522997f6 100644 --- a/packages/mask/dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx +++ b/packages/mask/dashboard/modals/BackupPreviewModal/BackupPreviewDialog.tsx @@ -9,10 +9,12 @@ import { DashboardRoutes } from '@masknet/shared-base' import { ActionButton, makeStyles, useCustomSnackbar } from '@masknet/theme' import { encode } from '@msgpack/msgpack' import { Box, DialogActions, DialogContent, Typography } from '@mui/material' +import { format } from 'date-fns' import { memo, useCallback, useMemo, useRef } from 'react' import { Controller } from 'react-hook-form' import { useNavigate } from 'react-router-dom' import { useAsyncFn, useUpdateEffect } from 'react-use' +import { UserContext } from '../../../shared-ui/index.js' import { PersonasBackupPreview, WalletsBackupPreview } from '../../components/BackupPreview/index.js' import PasswordField from '../../components/PasswordField/index.js' import { useBackupFormState, type BackupFormInputs } from '../../hooks/useBackupFormState.js' @@ -98,6 +100,7 @@ export const BackupPreviewDialog = memo(function Backu const { data: previewInfo, isLoading: loading } = useBackupPreviewInfo() const { showSnackbar } = useCustomSnackbar() + const { updateUser } = UserContext.useContainer() const [{ loading: uploadLoading, value }, handleUploadBackup] = useAsyncFn( async (data: BackupFormInputs) => { try { @@ -119,6 +122,7 @@ export const BackupPreviewDialog = memo(function Backu const controller = new AbortController() controllerRef.current = controller await onUpload?.(encrypted, controller.signal) + updateUser({ cloudBackupAt: format(new Date(), 'yyyy-MM-dd HH:mm:ss') }) showSnackbar(Backup Successful, { variant: 'success', message: Data backed up successfully!, diff --git a/packages/mask/popups/modals/PersonaSettingModal/index.tsx b/packages/mask/popups/modals/PersonaSettingModal/index.tsx index 6c9c6f7a4102..f7ce442a444d 100644 --- a/packages/mask/popups/modals/PersonaSettingModal/index.tsx +++ b/packages/mask/popups/modals/PersonaSettingModal/index.tsx @@ -120,6 +120,7 @@ export const PersonaSettingModal = memo(function PersonaSe !user.backupPassword ? PopupModalRoutes.SetBackupPassword : PopupModalRoutes.verifyBackupPassword, + { to: PopupRoutes.ExportPrivateKey }, ) }} /> From 20714715d2cdfa6b2fd01a41b0ee83ce62180f8e Mon Sep 17 00:00:00 2001 From: Wukong Sun Date: Tue, 15 Apr 2025 15:30:45 +0800 Subject: [PATCH 17/20] feat: mf-6673 lens v3 follow/unfollow (#12198) * feat: mf-6673 lens v3 follow/unfollow * refactor: lens feeds migrate to lens v3 api * chore: lingui compile * fix: eslint --------- Co-authored-by: swkatmask --- cspell.json | 2 + packages/mask/popups/hooks/useSearchValue.ts | 31 +- .../mask/popups/pages/Friends/Home/index.tsx | 2 +- .../mask/shared-ui/initialization/fetch.ts | 7 +- .../SiteAdaptor/SocialFeeds/useSocialFeeds.ts | 18 +- .../RSS3/src/SiteAdaptor/hooks/index.ts | 1 - .../src/SiteAdaptor/hooks/usePublicationId.ts | 12 - .../SiteAdaptor/components/LinkModifier.tsx | 15 +- packages/plugins/Web3Profile/package.json | 1 + .../Web3ProfileGlobalInjection.tsx | 5 +- .../components/Lens/FollowLensDialog.tsx | 347 ++--- .../components/Lens/HandlerDescription.tsx | 26 +- .../SiteAdaptor/components/ProfilePopup.tsx | 51 +- .../components/SocialBadges/Badges.tsx | 6 +- .../components/SocialBadges/LensList.tsx | 64 +- .../components/SocialBadges/SocialPopup.tsx | 1 + .../src/SiteAdaptor/hooks/Lens/useFollow.ts | 191 --- .../src/SiteAdaptor/hooks/Lens/useFollow.tsx | 77 ++ .../hooks/Lens/useMyLensAccountAddress.ts | 22 + .../hooks/Lens/useQueryAuthenticate.ts | 62 - .../src/SiteAdaptor/hooks/Lens/useUnfollow.ts | 180 +-- .../hooks/Lens/useUpdateFollowingStatus.ts | 10 +- .../plugins/Web3Profile/src/locale/en-US.json | 5 + .../plugins/Web3Profile/src/locale/en-US.po | 56 +- .../plugins/Web3Profile/src/locale/ja-JP.json | 5 + .../plugins/Web3Profile/src/locale/ja-JP.po | 56 +- .../plugins/Web3Profile/src/locale/ko-KR.json | 5 + .../plugins/Web3Profile/src/locale/ko-KR.po | 56 +- .../plugins/Web3Profile/src/locale/zh-CN.json | 5 + .../plugins/Web3Profile/src/locale/zh-CN.po | 56 +- .../plugins/Web3Profile/src/locale/zh-TW.json | 5 + .../plugins/Web3Profile/src/locale/zh-TW.po | 56 +- packages/plugins/Web3Profile/src/utils.ts | 9 +- packages/shared-base/src/KVStorage/index.ts | 4 + packages/shared-base/src/Pageable/index.ts | 2 +- packages/shared/package.json | 1 + .../SocialAccountList/SocialListItem.tsx | 51 +- packages/shared/src/hooks/index.ts | 3 + .../src/hooks/useAvailableLensAccounts.ts | 19 + packages/shared/src/hooks/useLensClient.ts | 11 + .../src/hooks/useMyLensAccountAddress.ts | 23 + .../web3-hooks/base/src/useReverseAddress.ts | 12 +- packages/web3-providers/package.json | 4 +- .../web3-providers/src/Firefly/helpers.ts | 1 + packages/web3-providers/src/Lens/helpers.ts | 672 --------- packages/web3-providers/src/Lens/index.ts | 686 ---------- .../src/{Lens => LensV3}/constants.ts | 2 +- .../src/LensV3/fragments/accounts.ts | 29 + .../src/LensV3/fragments/index.ts | 3 + packages/web3-providers/src/LensV3/helpers.ts | 367 +++++ packages/web3-providers/src/LensV3/index.ts | 209 +++ packages/web3-providers/src/LensV3/types.ts | 6 + .../src/Web3/EVM/state/IdentityService.ts | 27 - .../src/Web3/EVM/state/NameService.ts | 3 +- packages/web3-providers/src/entry-types.ts | 2 +- packages/web3-providers/src/entry.ts | 2 +- .../src/types/{Lens.ts => LensV3.ts} | 2 +- packages/web3-providers/src/types/Social.ts | 8 +- pnpm-lock.yaml | 1200 ++++------------- 59 files changed, 1576 insertions(+), 3218 deletions(-) delete mode 100644 packages/plugins/RSS3/src/SiteAdaptor/hooks/usePublicationId.ts delete mode 100644 packages/plugins/Web3Profile/src/SiteAdaptor/hooks/Lens/useFollow.ts create mode 100644 packages/plugins/Web3Profile/src/SiteAdaptor/hooks/Lens/useFollow.tsx create mode 100644 packages/plugins/Web3Profile/src/SiteAdaptor/hooks/Lens/useMyLensAccountAddress.ts delete mode 100644 packages/plugins/Web3Profile/src/SiteAdaptor/hooks/Lens/useQueryAuthenticate.ts create mode 100644 packages/shared/src/hooks/useAvailableLensAccounts.ts create mode 100644 packages/shared/src/hooks/useLensClient.ts create mode 100644 packages/shared/src/hooks/useMyLensAccountAddress.ts delete mode 100644 packages/web3-providers/src/Lens/helpers.ts delete mode 100644 packages/web3-providers/src/Lens/index.ts rename packages/web3-providers/src/{Lens => LensV3}/constants.ts (72%) create mode 100644 packages/web3-providers/src/LensV3/fragments/accounts.ts create mode 100644 packages/web3-providers/src/LensV3/fragments/index.ts create mode 100644 packages/web3-providers/src/LensV3/helpers.ts create mode 100644 packages/web3-providers/src/LensV3/index.ts create mode 100644 packages/web3-providers/src/LensV3/types.ts rename packages/web3-providers/src/types/{Lens.ts => LensV3.ts} (99%) diff --git a/cspell.json b/cspell.json index 3cd369cbb7e3..d6adcdaa4644 100644 --- a/cspell.json +++ b/cspell.json @@ -249,6 +249,8 @@ "linkedin", "luma", "muln", + "reposted", + "reposts", "sepolia", "tanstack", "tiktok", diff --git a/packages/mask/popups/hooks/useSearchValue.ts b/packages/mask/popups/hooks/useSearchValue.ts index 267ab4d04c8f..59827fcfd1f3 100644 --- a/packages/mask/popups/hooks/useSearchValue.ts +++ b/packages/mask/popups/hooks/useSearchValue.ts @@ -1,18 +1,25 @@ -import { useAsyncRetry } from 'react-use' -import type { AsyncStateRetry } from 'react-use/lib/useAsyncRetry.js' +import { useLensClient } from '@masknet/shared' import { ECKeyIdentifier, NextIDPlatform } from '@masknet/shared-base' -import { ENS, Lens } from '@masknet/web3-providers' +import { ENS } from '@masknet/web3-providers' +import { useQuery } from '@tanstack/react-query' -export function useSearchValue(value: string, type?: NextIDPlatform): AsyncStateRetry { - return useAsyncRetry(async () => { - if (!type) return '' - if (value.length === 44) return new ECKeyIdentifier('secp256k1', value).publicKeyAsHex ?? value - if (type === NextIDPlatform.Twitter) return value.replace(/^@/, '').toLowerCase() +export function useSearchValue(value: string, type?: NextIDPlatform) { + const lensClient = useLensClient() + return useQuery({ + queryKey: ['search-value', value, type, !lensClient], + queryFn: async () => { + if (!type) return '' + if (value.length === 44) return new ECKeyIdentifier('secp256k1', value).publicKeyAsHex ?? value + if (type === NextIDPlatform.Twitter) return value.replace(/^@/, '').toLowerCase() - if (value.endsWith('.eth')) return (await ENS.lookup(value))?.toLowerCase() + if (value.endsWith('.eth')) return (await ENS.lookup(value))?.toLowerCase() - if (value.endsWith('.lens')) return (await Lens.getProfileByHandle(value)).ownedBy.address?.toLowerCase() + if (value.endsWith('.lens') && lensClient) { + const account = await lensClient?.getAccountByHandle(value) + return (account?.username?.ownedBy as string).toLowerCase() + } - return value.toLowerCase() - }, [value]) + return value.toLowerCase() + }, + }) } diff --git a/packages/mask/popups/pages/Friends/Home/index.tsx b/packages/mask/popups/pages/Friends/Home/index.tsx index c65dfd9bace5..3f63fef83eb5 100644 --- a/packages/mask/popups/pages/Friends/Home/index.tsx +++ b/packages/mask/popups/pages/Friends/Home/index.tsx @@ -22,7 +22,7 @@ export const Component = memo(function FriendsHome() { const friends = useMemo(() => data?.pages.flatMap((x) => x.friends) ?? EMPTY_LIST, [data]) const [searchValue, setSearchValue] = useState('') const type = resolveNextIDPlatform(searchValue) - const { loading: resolveLoading, value: keyword = '' } = useSearchValue(searchValue, type) + const { isLoading: resolveLoading, data: keyword = '' } = useSearchValue(searchValue, type) const fuse = useMemo(() => { return new Fuse(records, { keys: ['profile.userId'], diff --git a/packages/mask/shared-ui/initialization/fetch.ts b/packages/mask/shared-ui/initialization/fetch.ts index 64e3073e0560..471e51c75d44 100644 --- a/packages/mask/shared-ui/initialization/fetch.ts +++ b/packages/mask/shared-ui/initialization/fetch.ts @@ -8,7 +8,7 @@ const { fetch: original_fetch } = globalThis function contentFetch(input: RequestInfo | URL, init?: RequestInit) { const request = new Request(input, init) - if (canAccessAsContent(request.url)) { + if (shouldAccessViaContent(request.url)) { if ( navigator.userAgent.includes('Firefox') && browser.runtime.getManifest().manifest_version === 2 && @@ -48,14 +48,15 @@ function fetchingTwitterResource(target: URL) { function fetchingInsResource(target: URL) { // cspell:disable-next-line - return location.origin.endsWith('instagram.com') && target.origin.match(/(fbcdn\.net|cdninstagram\.com)$/) + if (isHostName(location, 'instagram.com') && target.origin.match(/(fbcdn\.net|cdninstagram\.com)$/)) return true + return target.host === 'api.lens.xyz' } function fetchingGoogleDriveResource(target: URL) { return target.origin === 'https://www.googleapis.com' } -function canAccessAsContent(url: string) { +function shouldAccessViaContent(url: string) { const target = new URL(url, location.href) if (fetchingTwitterResource(target) || fetchingInsResource(target) || fetchingGoogleDriveResource(target)) return true diff --git a/packages/plugins/RSS3/src/SiteAdaptor/SocialFeeds/useSocialFeeds.ts b/packages/plugins/RSS3/src/SiteAdaptor/SocialFeeds/useSocialFeeds.ts index cb965022d7ea..cf423f86dde7 100644 --- a/packages/plugins/RSS3/src/SiteAdaptor/SocialFeeds/useSocialFeeds.ts +++ b/packages/plugins/RSS3/src/SiteAdaptor/SocialFeeds/useSocialFeeds.ts @@ -1,8 +1,9 @@ import { t } from '@lingui/core/macro' import { timeout } from '@masknet/kit' +import { useLensClient } from '@masknet/shared' import { EMPTY_LIST, type PageIndicator } from '@masknet/shared-base' import { useFireflyFarcasterAccounts, useFireflyLensAccounts } from '@masknet/web3-hooks-base' -import { FireflyConfig, FireflyFarcaster, Lens } from '@masknet/web3-providers' +import { FireflyConfig, FireflyFarcaster } from '@masknet/web3-providers' import { skipToken, useInfiniteQuery, useQuery } from '@tanstack/react-query' import { sortBy, uniq } from 'lodash-es' import { useCallback } from 'react' @@ -48,12 +49,14 @@ export function useSocialFeeds({ userId, address }: Options) { }, }) + const lensClient = useLensClient() const lensHandles = uniq(lensAccounts.map((x) => x.handle).concat(profiles?.lensHandles || [])) - const { data: lensIds = EMPTY_LIST } = useQuery({ - queryKey: ['lens', 'popup-list', lensHandles], + const { data: accounts = EMPTY_LIST } = useQuery({ + queryKey: ['lens', 'popup-list', lensHandles, !lensClient], queryFn: async () => { - const profiles = await Lens.getProfilesByHandles(lensHandles) - return profiles.map((x) => x.id) + if (!lensClient) return + const profiles = await lensClient.getAccountsByHandles(lensHandles) + return profiles?.map((x) => x.address) || EMPTY_LIST }, }) const { @@ -65,9 +68,10 @@ export function useSocialFeeds({ userId, address }: Options) { hasNextPage: hasNextLensPage, isLoading: isLoadingLens, } = useInfiniteQuery({ - queryKey: ['social-feeds', 'lens', lensIds], + enabled: !!lensClient, + queryKey: ['social-feeds', 'lens', accounts, !lensClient], queryFn: async ({ pageParam }) => { - return timeout(Lens.getPostsByProfileId(lensIds, pageParam), 30_000, t`Request timed out`) + return timeout(lensClient!.getPostsByAccounts(accounts, pageParam), 30_000, t`Request timed out`) }, initialPageParam: undefined as PageIndicator | undefined, getNextPageParam: (lastPage) => lastPage?.nextIndicator, diff --git a/packages/plugins/RSS3/src/SiteAdaptor/hooks/index.ts b/packages/plugins/RSS3/src/SiteAdaptor/hooks/index.ts index a337083261f2..118c5d6955b5 100644 --- a/packages/plugins/RSS3/src/SiteAdaptor/hooks/index.ts +++ b/packages/plugins/RSS3/src/SiteAdaptor/hooks/index.ts @@ -1,4 +1,3 @@ export * from './useAddressLabel.js' export * from './useFeeds.js' -export * from './usePublicationId.js' export * from './useMarkdownStyles.js' diff --git a/packages/plugins/RSS3/src/SiteAdaptor/hooks/usePublicationId.ts b/packages/plugins/RSS3/src/SiteAdaptor/hooks/usePublicationId.ts deleted file mode 100644 index 9c1d42a5b44d..000000000000 --- a/packages/plugins/RSS3/src/SiteAdaptor/hooks/usePublicationId.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Lens } from '@masknet/web3-providers' -import { useQuery } from '@tanstack/react-query' - -export function usePublicationId(txId: string | null) { - return useQuery({ - queryKey: ['lens', 'transaction-publication-id', txId], - queryFn: async () => { - if (!txId) return null - return Lens.queryTransactionPublicationId(txId) - }, - }) -} diff --git a/packages/plugins/ScamWarning/src/SiteAdaptor/components/LinkModifier.tsx b/packages/plugins/ScamWarning/src/SiteAdaptor/components/LinkModifier.tsx index 1675a7657bf3..12e4a374c069 100644 --- a/packages/plugins/ScamWarning/src/SiteAdaptor/components/LinkModifier.tsx +++ b/packages/plugins/ScamWarning/src/SiteAdaptor/components/LinkModifier.tsx @@ -1,13 +1,14 @@ import { Icons } from '@masknet/icons' import type { Plugin } from '@masknet/plugin-infra' +import { useDirtyDetectionDependency } from '@masknet/plugin-infra/dom' import { makeStyles, ShadowRootPopper } from '@masknet/theme' import { Link } from '@mui/material' import { memo } from 'react' -import { usePopoverControl } from './usePopoverControl.js' -import { WarningCard } from './WarningCard.js' +import { useCheckLink } from '../hooks/useCheckLink.js' import { useDetectAddress } from '../hooks/useDetectAddress.js' import { AddressTag } from './TextModifier.js' -import { useCheckLink } from '../hooks/useCheckLink.js' +import { usePopoverControl } from './usePopoverControl.js' +import { WarningCard } from './WarningCard.js' const useStyles = makeStyles()((theme) => ({ link: { @@ -37,10 +38,14 @@ export const LinkModifier = memo { - if (!ev.open) { - setHandle('') - } - setHandle(ev.handle) + setHandle(ev.open ? ev.handle : '') }, ) diff --git a/packages/plugins/Web3Profile/src/SiteAdaptor/components/Lens/FollowLensDialog.tsx b/packages/plugins/Web3Profile/src/SiteAdaptor/components/Lens/FollowLensDialog.tsx index a85004debdb9..9a40f4a66c78 100644 --- a/packages/plugins/Web3Profile/src/SiteAdaptor/components/Lens/FollowLensDialog.tsx +++ b/packages/plugins/Web3Profile/src/SiteAdaptor/components/Lens/FollowLensDialog.tsx @@ -1,24 +1,25 @@ +import { type Account, type EvmAddress } from '@lens-protocol/client' import { Trans } from '@lingui/react/macro' import { Icons } from '@masknet/icons' import { ChainBoundary, - EthereumERC20TokenApprovedBoundary, InjectedDialog, + setMyLensAccountAddress, + useAvailableLensAccounts, + useLensClient, + useMyLensAccountAddress, WalletConnectedBoundary, } from '@masknet/shared' -import { NetworkPluginID, PersistentStorages } from '@masknet/shared-base' +import { NetworkPluginID } from '@masknet/shared-base' import { ActionButton, makeStyles, useCustomSnackbar } from '@masknet/theme' -import { useChainContext, useFungibleTokenBalance, useNetworkContext, useWallet } from '@masknet/web3-hooks-base' -import { Lens } from '@masknet/web3-providers' -import { FollowModuleType, type LensBaseAPI } from '@masknet/web3-providers/types' -import { ZERO, formatBalance, isLessThan, isSameAddress } from '@masknet/web3-shared-base' -import { ChainId, createERC20Token, formatAmount } from '@masknet/web3-shared-evm' -import { Avatar, Box, Button, CircularProgress, DialogContent, Typography, buttonClasses } from '@mui/material' +import { useChainContext, useNetworkContext, useWallet } from '@masknet/web3-hooks-base' +import { isSameAddress } from '@masknet/web3-shared-base' +import { ChainId } from '@masknet/web3-shared-evm' +import { Avatar, Box, Button, buttonClasses, CircularProgress, DialogContent, Typography } from '@mui/material' import { useQuery } from '@tanstack/react-query' import { first } from 'lodash-es' -import { useCallback, useMemo, useState, type MouseEvent } from 'react' -import { useAsyncRetry } from 'react-use' -import { getFireflyLensProfileLink, getProfileAvatar } from '../../../utils.js' +import { useCallback, useMemo, useState } from 'react' +import { getFireflyLensProfileLink } from '../../../utils.js' import { useConfettiExplosion } from '../../hooks/ConfettiExplosion/index.js' import { useFollow } from '../../hooks/Lens/useFollow.js' import { useUnfollow } from '../../hooks/Lens/useUnfollow.js' @@ -111,219 +112,117 @@ let task: Promise | undefined export function FollowLensDialog({ handle, onClose }: Props) { const wallet = useWallet() - const [currentProfile, setCurrentProfile] = useState() const [isHovering, setIsHovering] = useState(false) const { classes } = useStyles({ account: !!wallet }) - const { account, chainId, providerType } = useChainContext() + const { account: walletAccount } = useChainContext() const { pluginID } = useNetworkContext() const { showSnackbar } = useCustomSnackbar() + const lensClient = useLensClient() + const myLensAccount = useMyLensAccountAddress() - // #region profile information - const { value, loading } = useAsyncRetry(async () => { - if (!handle || !open || !open) return - const profile = await Lens.getProfileByHandle(handle) - - if (!profile) return - - const defaultProfile = await Lens.queryDefaultProfileByAddress(account) - - const profiles = await Lens.queryProfilesByAddress(account) - - const latestProfile = PersistentStorages.Settings.storage.latestLensProfile?.value - setCurrentProfile((prev) => { - const profile = defaultProfile ?? profiles.find((x) => x.id === latestProfile) ?? first(profiles) - if (!prev && profile) { - if (latestProfile) PersistentStorages.Settings.storage.latestLensProfile.setValue(profile.id) - return profile - } - return prev - }) - return { - profile, - isSelf: isSameAddress(profile.ownedBy.address, account), - profiles, - defaultProfile: defaultProfile || first(profiles), - } - }, [handle, open, account]) - - const { profile, defaultProfile, isSelf, profiles } = value || {} + const { data: lensAccount, isLoading } = useQuery({ + enabled: !!handle && !!open, + queryKey: ['lens', 'profile-info', !lensClient, handle], + queryFn: async () => { + if (!handle || !lensClient) return + const lensAccount = await lensClient.getAccountByHandle(handle) + return lensAccount + }, + }) + const { data: accounts } = useAvailableLensAccounts() + const isSelf = isSameAddress(lensAccount?.username?.ownedBy as string, walletAccount) - const currentProfileId = currentProfile?.id - const targetProfileId = value?.profile.id + const currentAccount = accounts?.find((p) => isSameAddress(p.account.address, myLensAccount)) || first(accounts) + const currentAccountAddress: EvmAddress | undefined = currentAccount?.account.address + const targetAccountAddress: EvmAddress | undefined = lensAccount?.address const { isPending, data: isFollowing } = useQuery({ - queryKey: ['lens', 'following-status', currentProfileId, handle, targetProfileId], + queryKey: ['lens', 'following-status', currentAccountAddress, targetAccountAddress, !lensClient], queryFn: async () => { - if (!targetProfileId || !currentProfileId) return false - const result = await Lens.queryFollowStatus(currentProfileId, targetProfileId) - return result + if (!targetAccountAddress || !currentAccountAddress || !lensClient) return false + const res = await lensClient.getFollowStatus([ + { account: targetAccountAddress, follower: currentAccountAddress }, + ]) + const status = res[0].isFollowing + return status.onChain || status.optimistic }, refetchOnWindowFocus: false, staleTime: 0, }) const updateFollowingStatus = useUpdateFollowingStatus() - const followModule = useMemo(() => { - if (profile?.followModule?.type === FollowModuleType.ProfileFollowModule && defaultProfile) { - return { - profileFollowModule: { - profileId: defaultProfile.id, - }, - } - } else if (profile?.followModule?.type === FollowModuleType.FeeFollowModule && profile.followModule.amount) { - return { - feeFollowModule: { - currency: profile.followModule.amount.asset.contract.address, - value: profile.followModule.amount.value, - }, - } - } - return - }, [profile, defaultProfile]) - // #endregion - - const approved = useMemo(() => { - if (!profile?.followModule?.amount?.asset) return { amount: ZERO.toFixed() } - const { - contract: { address }, - name, - symbol, - decimals, - } = profile.followModule.amount.asset - const token = createERC20Token(chainId, address, name, symbol, decimals) - const amount = formatAmount(profile.followModule.amount.value, decimals) - - return { - token, - amount, - } - }, [profile?.followModule?.amount, chainId]) - // #region follow and unfollow event handler const { showConfettiExplosion, canvasRef } = useConfettiExplosion() - const { loading: followLoading, handleFollow } = useFollow( - profile?.id, - currentProfile?.id, - followModule, - currentProfile?.signless, - (event: MouseEvent) => { - showConfettiExplosion(event.currentTarget.offsetWidth, event.currentTarget.offsetHeight) - updateFollowingStatus(currentProfileId, handle, true) + const { loading: followLoading, handleFollow } = useFollow({ + accountAddress: lensAccount?.address, + onSuccess: (width: number, height: number) => { + showConfettiExplosion(width, height) + updateFollowingStatus(currentAccountAddress, targetAccountAddress, true) }, - () => updateFollowingStatus(currentProfileId, handle, false), - ) - const { loading: unfollowLoading, handleUnfollow } = useUnfollow( - profile?.id, - currentProfile?.id, - currentProfile?.signless, - () => updateFollowingStatus(currentProfileId, handle, false), - () => updateFollowingStatus(currentProfileId, handle, true), - ) + onFailed: () => updateFollowingStatus(currentAccountAddress, handle, false), + }) + const { loading: unfollowLoading, handleUnfollow } = useUnfollow({ + accountAddress: lensAccount?.address as string, + onSuccess: () => updateFollowingStatus(currentAccountAddress, targetAccountAddress, false), + onFailed: () => updateFollowingStatus(currentAccountAddress, targetAccountAddress, true), + }) // #endregion - const { data: feeTokenBalance, isPending: getBalanceLoading } = useFungibleTokenBalance( - NetworkPluginID.PLUGIN_EVM, - profile?.followModule?.amount?.asset.contract.address ?? '', - ) - - const handleClick = useCallback( - (event: MouseEvent) => { - if (task) { - showSnackbar(isFollowing ? Lens Unfollow : Lens Follow, { - processing: true, - message: - isFollowing ? - Previous unfollow transaction is in processing, please wait and try again. - : Previous follow transaction is in processing, please wait and try again., - autoHideDuration: 2000, - }) - return - } - task = (isFollowing ? handleUnfollow(event) : handleFollow(event)).finally(() => (task = undefined)) - }, - [handleFollow, handleUnfollow, isFollowing], - ) - - const disabled = useMemo(() => { - if ( - !account || - !currentProfile || - !!wallet?.owner || - pluginID !== NetworkPluginID.PLUGIN_EVM || - followLoading || - unfollowLoading || - profile?.followModule?.type === FollowModuleType.UnknownFollowModule || - (profile?.followModule?.type === FollowModuleType.ProfileFollowModule && !defaultProfile) || - (profile?.followModule?.type === FollowModuleType.FeeFollowModule && - profile.followModule.amount && - (!feeTokenBalance || - isLessThan( - formatBalance(feeTokenBalance, profile.followModule.amount.asset.decimals), - profile.followModule.amount.value, - ))) || - profile?.followModule?.type === FollowModuleType.RevertFollowModule - ) - return true + const handleClick = useCallback(() => { + if (task) { + showSnackbar(isFollowing ? Lens Unfollow : Lens Follow, { + processing: true, + message: + isFollowing ? + Previous unfollow transaction is in processing, please wait and try again. + : Previous follow transaction is in processing, please wait and try again., + autoHideDuration: 2000, + }) + return + } + task = (isFollowing ? handleUnfollow() : handleFollow()).finally(() => (task = undefined)) + }, [handleFollow, handleUnfollow, isFollowing, showSnackbar]) - return false - }, [ - currentProfile, - account, - wallet?.owner, - chainId, - followLoading, - unfollowLoading, - feeTokenBalance, - profile?.followModule, - pluginID, - ]) + const accountConditions = + !walletAccount || !currentAccount || !!wallet?.owner || pluginID !== NetworkPluginID.PLUGIN_EVM + const operationConditions = followLoading || unfollowLoading + const disabled = accountConditions || operationConditions const buttonText = useMemo(() => { if (isFollowing) { return isHovering ? Unfollow : Following - } else if (profile?.followModule?.type === FollowModuleType.UnknownFollowModule) { - return This profile can not be followed. - } else if (profile?.followModule?.type === FollowModuleType.FeeFollowModule && profile.followModule.amount) { - return ( - - Follow for {profile.followModule.amount.value} {profile.followModule.amount.asset.symbol} - - ) + } + switch (lensAccount?.operations?.canFollow.__typename) { + case 'AccountFollowOperationValidationPassed': + return Follow + case 'AccountFollowOperationValidationUnknown': + return This profile can not be followed. + case 'AccountFollowOperationValidationFailed': + return This profile can not be followed: {lensAccount.operations.canFollow.reason} } return Follow - }, [isFollowing, isHovering, profile]) + }, [isFollowing, isHovering, lensAccount]) const tips = useMemo(() => { if (wallet?.owner || pluginID !== NetworkPluginID.PLUGIN_EVM) return Current wallet does not support to interact with Lens protocol. - else if (profile?.followModule?.type === FollowModuleType.ProfileFollowModule && !defaultProfile) - return Only holding lens handle can follow. - else if ( - profile?.followModule?.type === FollowModuleType.FeeFollowModule && - profile.followModule.amount && - (!feeTokenBalance || - isLessThan( - formatBalance(feeTokenBalance, profile.followModule.amount.asset.decimals), - profile.followModule.amount.value, - )) - ) - return No enough balance to complete follow process. - else if (profile?.followModule?.type === FollowModuleType.RevertFollowModule) - return This user has banned follow function. - else if (!currentProfile) { + else if (lensAccount?.operations?.canFollow.__typename === 'AccountFollowOperationValidationFailed') + return Can not follow: {lensAccount.operations.canFollow.reason} + else if (!currentAccount) { return The current wallet does not hold a lens and cannot follow/unfollow } return - }, [wallet?.owner, chainId, profile, feeTokenBalance, pluginID, providerType, isSelf, currentProfile]) + }, [wallet?.owner, lensAccount, pluginID, currentAccount]) - const avatar = useMemo(() => getProfileAvatar(profile), [profile]) + const avatar = lensAccount?.metadata?.picture - const handleProfileChange = useCallback((profile: LensBaseAPI.Profile) => { - setCurrentProfile(profile) - PersistentStorages.Settings.storage.latestLensProfile.setValue(profile.id) + const handleProfileChange = useCallback((profile: Account) => { + setMyLensAccountAddress(profile.address) }, []) + const loading = followLoading || unfollowLoading || isLoading || isPending + return ( Lens} classes={{ dialogTitle: classes.dialogTitle, paper: classes.dialogContent }}> - {!value && (loading || getBalanceLoading) ? + {!lensAccount && isLoading ? @@ -341,13 +240,12 @@ export function FollowLensDialog({ handle, onClose }: Props) { sx={{ width: 64, height: 64 }} /> - {profile?.metadata?.displayName ?? profile?.handle.localName} + {lensAccount?.metadata?.name ?? lensAccount?.username?.localName} - @{profile?.handle.localName} + @{handle || '--'} - {profile?.stats.followers ?? '0'} Followers{' '} - {profile?.stats.following ?? '0'} Following + 0 Followers 0 Following @@ -355,7 +253,7 @@ export function FollowLensDialog({ handle, onClose }: Props) { : <> - - Unlock {value?.profile.followModule?.amount?.value ?? ZERO.toFixed()}{' '} - {approved.token?.symbol ?? ''} and follow - - } - failedContent={ - - Unlock {value?.profile.followModule?.amount?.value ?? ZERO.toFixed()}{' '} - {approved.token?.symbol ?? ''} and follow - - }> - Switch to Polygon and Follow}> - setIsHovering(true)} - onMouseOut={() => setIsHovering(false)}> - {buttonText} - - - + switchText={Switch to Polygon and Follow}> + setIsHovering(true)} + onMouseOut={() => setIsHovering(false)}> + {buttonText} + +