From fd42e3b06d2eb5141f03188332cda520554613ee Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Mon, 8 Feb 2021 12:01:17 -0330 Subject: [PATCH 01/11] Update `ja` localized messages (#10265) * Update `jp` localized messages These translations were provided by Lionbridge. * `ja` localized messages patch via @nyatla * i18n/ja - remove extra code * Update app/_locales/ja/messages.json * Update messages.json Co-authored-by: kumavis Co-authored-by: kumavis --- app/_locales/ja/messages.json | 1836 +++++++++++++++++++++++++++++++-- 1 file changed, 1750 insertions(+), 86 deletions(-) diff --git a/app/_locales/ja/messages.json b/app/_locales/ja/messages.json index a8cfd9bbe..86b131c4b 100644 --- a/app/_locales/ja/messages.json +++ b/app/_locales/ja/messages.json @@ -1,9 +1,20 @@ { + "about": { + "message": "バージョン情報" + }, "aboutSettingsDescription": { - "message": "バージョンやサポート、問合せ先など" + "message": "バージョン、サポートセンター、問い合わせ情報" }, "acceleratingATransaction": { - "message": "*より高いガス価格を使用すると、ネットワークでより速く処理され、トランザクションを高速化できる可能性が高くなりますが、常に保証されるとは限りません。" + "message": "* より高いGas料金を支払うと、トランザクションはより早くネットワークで処理される可能性が高くなります。ただし、これは常に保証されるとは限りません。" + }, + "acceptTermsOfUse": { + "message": "$1 の内容を確認し、同意します", + "description": "$1 is the `terms` message" + }, + "accessAndSpendNotice": { + "message": "$1 はアクセスしてこの最大量まで使用する可能性があります", + "description": "$1 is the url of the site requesting ability to spend" }, "accessingYourCamera": { "message": "カメラにアクセスしています..." @@ -12,7 +23,7 @@ "message": "アカウント" }, "accountDetails": { - "message": "アカウント詳細" + "message": "アカウントの詳細" }, "accountName": { "message": "アカウント名" @@ -21,28 +32,37 @@ "message": "アカウント設定" }, "accountSelectionRequired": { - "message": "アカウントを選択してください。" + "message": "アカウントを選択する必要があります!" + }, + "active": { + "message": "アクティブ" + }, + "activity": { + "message": "アクティビティ" }, "activityLog": { - "message": "アクティビティログ" + "message": "アクティビティのログ" + }, + "addAccount": { + "message": "アカウントの追加" }, "addAcquiredTokens": { - "message": "MetaMaskで獲得したトークンを追加する" + "message": "MetaMaskで取得したトークンを追加する" }, "addAlias": { - "message": "エイリアスを追加" + "message": "エイリアスの追加" }, "addNetwork": { - "message": "ネットワーク追加" + "message": "ネットワークの追加" }, "addRecipient": { - "message": "受取人追加" + "message": "受取人を追加" }, "addSuggestedTokens": { - "message": "推奨トークンを追加" + "message": "推奨されたトークンを追加" }, "addToAddressBook": { - "message": "アドレス帳に追加" + "message": "アドレス帳へ追加" }, "addToAddressBookModalPlaceholder": { "message": "例: John D" @@ -62,19 +82,77 @@ "advancedSettingsDescription": { "message": "開発者向け機能では、状態ログのダウンロード、アカウントリセットし、テストネットやカスタムRPCの設定が可能です。" }, + "affirmAgree": { + "message": "同意します" + }, + "aggregatorFeeCost": { + "message": "アグリゲータのネットワーク手数料" + }, + "alertDisableTooltip": { + "message": "\"設定 > 警告の設定\"で変更できます" + }, + "alertSettingsUnconnectedAccount": { + "message": "未接続のアカウントを選択してWebサイト閲覧した時に警告する" + }, + "alertSettingsUnconnectedAccountDescription": { + "message": "この警告は、選択中のアカウントが未接続のままWeb3サイトを閲覧しているときにポップアップ表示されます。" + }, + "alertSettingsWeb3ShimUsage": { + "message": "廃止されたwindow.web3 APIの使用を警告する" + }, + "alertSettingsWeb3ShimUsageDescription": { + "message": "この警告は、選択中のアカウントが廃止されたwindow.web3 APIを使用してサイトを閲覧したときにポップアップ表示されます。サイトは恐らく機能しません。" + }, + "alerts": { + "message": "警告の設定" + }, + "alertsSettingsDescription": { + "message": "警告を有効化または無効化" + }, + "allowExternalExtensionTo": { + "message": "外部拡張機能に次の操作を許可します:" + }, + "allowOriginSpendToken": { + "message": "$1 に $2 の使用を許可しますか?", + "description": "$1 is the url of the site and $2 is the symbol of the token they are requesting to spend" + }, + "allowThisSiteTo": { + "message": "このサイトに次の操作を許可します:" + }, + "allowWithdrawAndSpend": { + "message": "$1 に以下の額までの引き出しと使用を許可します。", + "description": "The url of the site that requested permission to 'withdraw and spend'" + }, "amount": { "message": "金額" }, + "amountInEth": { + "message": "$1 ETH", + "description": "Displays an eth amount to the user. $1 is a decimal number" + }, + "amountWithColon": { + "message": "金額:" + }, "appDescription": { - "message": "Ethereumのブラウザ・エクステンション", + "message": "Ethereumウォレットのブラウザ・エクステンション", "description": "The description of the application" }, "appName": { "message": "MetaMask", "description": "The name of the application" }, + "approvalAndAggregatorTxFeeCost": { + "message": "承認とアグリゲータのネットワーク手数料" + }, + "approvalTxGasCost": { + "message": "承認のトランザクションGas料金" + }, "approve": { - "message": "承認する" + "message": "使用限度額の承認" + }, + "approveSpendLimit": { + "message": "使用限度額 $1 を承認", + "description": "The token symbol that is being approved" }, "approved": { "message": "承認済み" @@ -82,23 +160,29 @@ "asset": { "message": "アセット" }, + "assets": { + "message": "アセット" + }, "attemptToCancel": { - "message": "キャンセルを試みますか?" + "message": "キャンセルを要求しますか?" }, "attemptToCancelDescription": { - "message": "このキャンセルを送信しても、元のトランザクションがキャンセルされることは保証されません。キャンセルが成功した場合、上記の取引手数料が請求されます。" + "message": "キャンセルを要求しても、取引のキャンセルは保証されません。キャンセルが成功した場合、上記の取引手数料が請求されます。" }, "attemptingConnect": { "message": "ブロックチェーンに接続中" }, "attributions": { - "message": "属性" + "message": "ソフトウェアの著作権告知" + }, + "authorizedPermissions": { + "message": "以下の権限を許可しました" }, "autoLockTimeLimit": { - "message": "自動ログアウト(分)" + "message": "自動ロック(分)" }, "autoLockTimeLimitDescription": { - "message": "MetaMaskが自動的にログアウトするまでのアイドル時間を分単位で設定します。" + "message": "MetaMaskが自動的にロックするまでのアイドル時間を分単位で設定します。" }, "average": { "message": "平均" @@ -106,59 +190,292 @@ "back": { "message": "戻る" }, + "backToAll": { + "message": "一覧に戻る" + }, + "backupApprovalInfo": { + "message": "シードフレーズはウォレットの復旧に必要です。デバイスやパスワードの紛失、MetaMaskの再インストール時、または別のデバイスでウォレットを使用する時に必要です。" + }, + "backupApprovalNotice": { + "message": "シードフレーズをバックアップして、ウォレットと資金の安全を確保してください。" + }, + "backupNow": { + "message": "今すぐバックアップ" + }, "balance": { - "message": "残高:" + "message": "残高" + }, + "balanceOutdated": { + "message": "残高情報は最新ではない可能性があります" + }, + "basic": { + "message": "基本" + }, + "blockExplorerUrl": { + "message": "ブロックエクスプローラ" + }, + "blockExplorerView": { + "message": "$1 のアカウントを表示", + "description": "$1 replaced by URL for custom block explorer" }, "blockiesIdenticon": { - "message": "Blockies Identicon を使用" + "message": "Blockies Identiconを使用" + }, + "browserNotSupported": { + "message": "このブラウザーはサポートしていません。" + }, + "builtInCalifornia": { + "message": "MetaMaskはカリフォルニアで設計、作成されました。" + }, + "buy": { + "message": "入金" + }, + "buyWithWyre": { + "message": "WyreでETHを購入" + }, + "buyWithWyreDescription": { + "message": "Wyreでは、デビットカードを使用してETHをMetaMaskアカウントに直接入金できます。" + }, + "bytes": { + "message": "バイト" + }, + "canToggleInSettings": { + "message": "通知は設定->警告の設定で再度有効にできます。" }, "cancel": { "message": "キャンセル" }, + "cancellationGasFee": { + "message": "キャンセルのGas料金" + }, + "cancelled": { + "message": "キャンセル済み" + }, + "chainId": { + "message": "チェーンID" + }, + "chromeRequiredForHardwareWallets": { + "message": "ハードウェアウォレットへ接続するには、MetaMask on Google Chrome を使用する必要があります。" + }, + "clickToRevealSeed": { + "message": "シードフレーズを表示するにはここをクリックします" + }, + "close": { + "message": "閉じる" + }, "confirm": { "message": "確認" }, "confirmPassword": { "message": "パスワードの確認" }, + "confirmSecretBackupPhrase": { + "message": "シードフレーズの確認" + }, + "confirmed": { + "message": "確認しました" + }, + "congratulations": { + "message": "おめでとうございます" + }, + "connect": { + "message": "接続" + }, + "connectAccountOrCreate": { + "message": "アカウントを接続するか、または新規に作成します" + }, + "connectHardwareWallet": { + "message": "ハードウェアウォレットの接続" + }, + "connectManually": { + "message": "手動で現在のサイトに接続します" + }, + "connectTo": { + "message": "接続先 $1", + "description": "$1 is the name/origin of a web3 site/application that the user can connect to metamask" + }, + "connectToAll": { + "message": "全ての $1 に接続", + "description": "$1 will be replaced by the translation of connectToAllAccounts" + }, + "connectToAllAccounts": { + "message": "アカウント", + "description": "will replace $1 in connectToAll, completing the sentence 'connect to all of your accounts', will be text that shows list of accounts on hover" + }, + "connectToMultiple": { + "message": "$1 に接続", + "description": "$1 will be replaced by the translation of connectToMultipleNumberOfAccounts" + }, + "connectToMultipleNumberOfAccounts": { + "message": "$1個のアカウント", + "description": "$1 is the number of accounts to which the web3 site/application is asking to connect; this will substitute $1 in connectToMultiple" + }, + "connectWithMetaMask": { + "message": "MetaMaskをサイトに接続する" + }, + "connectedAccountsDescriptionPlural": { + "message": "このサイトに接続されたアカウントは $1個あります。", + "description": "$1 is the number of accounts" + }, + "connectedAccountsDescriptionSingular": { + "message": "このサイトに接続されたアカウントは $1個あります。" + }, + "connectedAccountsEmptyDescription": { + "message": "MetaMaskはこのサイトに接続されていません。Web3サイトに接続するには、サイト内にある接続ボタンを使用します。" + }, + "connectedSites": { + "message": "接続済みのサイト" + }, + "connectedSitesDescription": { + "message": "$1 はサイトに接続されています。サイトはアカウントアドレスを見ることができます。", + "description": "$1 is the account name" + }, + "connectedSitesEmptyDescription": { + "message": "$1 はどのサイトとも接続されていません。", + "description": "$1 is the account name" + }, + "connecting": { + "message": "接続しています..." + }, + "connectingTo": { + "message": "$1 への接続" + }, + "connectingToGoerli": { + "message": "Goerliテストネットワークへの接続" + }, + "connectingToKovan": { + "message": "Kovanテストネットワークへの接続" + }, + "connectingToMainnet": { + "message": "Ethereumメインネットへの接続" + }, + "connectingToRinkeby": { + "message": "Rinkebyテストネットワークへの接続" + }, + "connectingToRopsten": { + "message": "Ropstenテストネットワークへ接続" + }, + "contactUs": { + "message": "問い合わせ" + }, + "contacts": { + "message": "アドレス帳" + }, + "contactsSettingsDescription": { + "message": "アドレス帳の追加、編集、削除、管理" + }, + "continueToWyre": { + "message": "Wyreへ進む" + }, "contractDeployment": { "message": "コントラクトのデプロイ" }, "contractInteraction": { - "message": "コントラクトへのアクセス" + "message": "コントラクトのインタラクション" }, "copiedExclamation": { "message": "コピー完了!" }, + "copiedTransactionId": { + "message": "コピーしたトランザクションID" + }, + "copyAddress": { + "message": "アドレスをクリップボードにコピーしました" + }, "copyPrivateKey": { "message": "これはあなたの秘密鍵です(クリックでコピー)" }, "copyToClipboard": { "message": "クリップボードへコピー" }, + "copyTransactionId": { + "message": "トランザクションIDをコピー" + }, "create": { "message": "作成" }, + "createAWallet": { + "message": "ウォレットの作成" + }, "createAccount": { "message": "アカウント作成" }, + "createPassword": { + "message": "パスワードの作成" + }, + "currencyConversion": { + "message": "通貨換算" + }, + "currentAccountNotConnected": { + "message": "現在のアカウントは接続されていません" + }, + "currentExtension": { + "message": "現在のエクステンションページ" + }, + "currentLanguage": { + "message": "現在の言語" + }, "customGas": { - "message": "ガスのカスタマイズ" + "message": "Gasのカスタマイズ" + }, + "customGasSubTitle": { + "message": "手数料を増やすと処理までの時間が短縮できます。(短縮できない場合もあります。)" }, "customRPC": { "message": "カスタムRPC" }, + "customSpendLimit": { + "message": "カスタム使用限度額" + }, "customToken": { "message": "カスタムトークン" }, + "dataBackupFoundInfo": { + "message": "一部のアカウントデータはMetaMaskの前回のインストール時にバックアップされました。これには、設定、アドレス帳、トークンが含まれます。データを今すぐ復元しますか?" + }, "decimal": { "message": "小数点桁数" }, + "decimalsMustZerotoTen": { + "message": "小数桁数は、0 以上 36 以下の範囲にする必要があります。" + }, + "decrypt": { + "message": "復号" + }, + "decryptCopy": { + "message": "暗号化したメッセージをコピー" + }, + "decryptInlineError": { + "message": "エラーです。メッセージを復号できません:$1", + "description": "$1 is error message" + }, + "decryptMessageNotice": { + "message": "$1 はメッセージを読み取ってアクションを完了しようとしています", + "description": "$1 is the web3 site name" + }, + "decryptMetamask": { + "message": "メッセージを復号" + }, + "decryptRequest": { + "message": "復号のリクエスト" + }, "defaultNetwork": { - "message": "デフォルトのEther送受信ネットワークはメインネットです。" + "message": "デフォルトのEther取引ネットワークはメインネットです。" + }, + "delete": { + "message": "削除" + }, + "deleteAccount": { + "message": "アカウントの削除" + }, + "deleteNetwork": { + "message": "ネットワークを削除しますか?" + }, + "deleteNetworkDescription": { + "message": "本当にこのネットワークを削除しますか?" }, "depositEther": { - "message": "Etherを振込" + "message": "Etherを入金" }, "details": { "message": "詳細" @@ -167,68 +484,316 @@ "message": "Etherを直接入金" }, "directDepositEtherExplainer": { - "message": "既にEtherをお持ちなら、MetaMaskの新しいウォレットにEtherを送信することができます。" + "message": "Etherが既にあるなら、MetaMaskの新しいウォレットにEtherを送金することができます。" + }, + "disconnect": { + "message": "切断" + }, + "disconnectAllAccounts": { + "message": "すべてのアカウントを切断する" + }, + "disconnectAllAccountsConfirmationDescription": { + "message": "本当に切断しますか?サイトの機能を失う可能性があります。" + }, + "disconnectPrompt": { + "message": "$1 を切断" + }, + "disconnectThisAccount": { + "message": "このアカウントを切断" + }, + "dismiss": { + "message": "却下" }, "done": { "message": "完了" }, + "dontHaveAHardwareWallet": { + "message": "ハードウェアウォレットをお持ちではありませんか?" + }, + "dontShowThisAgain": { + "message": "再度表示しない" + }, + "downloadGoogleChrome": { + "message": "Google Chromeのダウンロード" + }, + "downloadSecretBackup": { + "message": "シードフレーズをダウンロードして、外部の暗号化されたハードウェアドライブまたはストレージ媒体に安全に保管してください。" + }, + "downloadStateLogs": { + "message": "状態ログのダウンロード" + }, + "dropped": { + "message": "削除済" + }, "edit": { "message": "編集" }, + "editContact": { + "message": "連絡先の編集" + }, + "editPermission": { + "message": "アクセス許可の編集" + }, + "encryptionPublicKeyNotice": { + "message": "$1 は公開暗号鍵を使用しようとしています。同意すると、このサイトは暗号化されたメッセージを作成できます。", + "description": "$1 is the web3 site name" + }, + "encryptionPublicKeyRequest": { + "message": "公開暗号鍵の要求" + }, + "endOfFlowMessage1": { + "message": "テストに合格しました。シードフレーズを安全に保管してください。これは利用者の責務です。" + }, "endOfFlowMessage10": { "message": "全て完了" }, + "endOfFlowMessage2": { + "message": "安全に保管するためのヒント" + }, + "endOfFlowMessage3": { + "message": "バックアップは複数の場所に保管してください。" + }, + "endOfFlowMessage4": { + "message": "シードフレーズは絶対に誰にも教えないでください。" + }, + "endOfFlowMessage5": { + "message": "フィッシング詐欺に注意してください!MetaMaskは自発的にシードフレーズを絶対に要求しません。" + }, + "endOfFlowMessage6": { + "message": "シードフレーズを再度バックアップする場合は、[設定] -> [セキュリティとプライバシー] で見つけることができます。" + }, + "endOfFlowMessage7": { + "message": "問題や不審な点がある場合は、support@metamask.io 宛に電子メールをお送りください。" + }, + "endOfFlowMessage8": { + "message": "MetaMaskはシードフレーズを復元できません。" + }, + "endOfFlowMessage9": { + "message": "詳細を表示。" + }, + "endpointReturnedDifferentChainId": { + "message": "エンドポイントは別のチェーンID:$1 を返してきました", + "description": "$1 is the return value of eth_chainId from an RPC endpoint" + }, + "ensNotFoundOnCurrentNetwork": { + "message": "ENS名が現在のネットワーク上で見つかりません。Ethereumメインネットへの切り替えを試みてください。" + }, + "ensRegistrationError": { + "message": "ENS名の登録のエラーです" + }, + "enterAnAlias": { + "message": "エイリアスを入力してください" + }, + "enterMaxSpendLimit": { + "message": "使用限度額の最大値を入力してください" + }, "enterPassword": { - "message": "パスワードを入力" + "message": "パスワードを入力してください" + }, + "enterPasswordContinue": { + "message": "続行するには、パスワードを入力してください" + }, + "errorCode": { + "message": "コード:$1", + "description": "Displayed error code for debugging purposes. $1 is the error code" + }, + "errorDetails": { + "message": "エラーの詳細", + "description": "Title for collapsible section that displays error details for debugging purposes" + }, + "errorMessage": { + "message": "メッセージ:$1", + "description": "Displayed error message for debugging purposes. $1 is the error message" + }, + "errorName": { + "message": "エラー名:$1", + "description": "Displayed error name for debugging purposes. $1 is the error name" + }, + "errorPageMessage": { + "message": "ページをリロードして再試行するか、サポート(support@metamask.io)までお問い合わせください", + "description": "Message displayed on generic error page in the fullscreen or notification UI" + }, + "errorPagePopupMessage": { + "message": "ポップアップを閉じてから再び開いてもう一度実行するか、サポート(support@metamask.io)までお問い合わせください", + "description": "Message displayed on generic error page in the popup UI" + }, + "errorPageTitle": { + "message": "MetaMaskにエラーが発生しました", + "description": "Title of generic error page" + }, + "errorStack": { + "message": "スタック:", + "description": "Title for error stack, which is displayed for debugging purposes" + }, + "estimatedProcessingTimes": { + "message": "推定処理時間" + }, + "eth_accounts": { + "message": "許可したアカウントのアドレスの読み取り(必須)", + "description": "The description for the `eth_accounts` permission" + }, + "ethereumPublicAddress": { + "message": "パブリックEthereumアドレス" + }, + "etherscan": { + "message": "Etherscan" }, "etherscanView": { - "message": "Etherscanでアカウントを確認" + "message": "Etherscanでアカウントを表示" + }, + "expandView": { + "message": "ウインドウで表示" }, "exportPrivateKey": { "message": "秘密鍵のエクスポート" }, + "externalExtension": { + "message": "外部拡張機能" + }, + "extraApprovalGas": { + "message": "+$1 承認Gas", + "description": "Expresses an additional gas amount the user will have to pay, on top of some other displayed amount. $1 is a decimal amount of gas" + }, "failed": { "message": "失敗" }, + "failedToFetchChainId": { + "message": "チェーンIDを取り込むことができませんでした。RPCのURLが正しいか確認してください。" + }, + "failureMessage": { + "message": "問題が発生しました。アクションを完了することができません" + }, + "fast": { + "message": "高速" + }, + "fastest": { + "message": "最高速" + }, + "feeAssociatedRequest": { + "message": "このリクエストにかかる手数料です。" + }, "fiat": { "message": "法定通貨", "description": "Exchange type" }, "fileImportFail": { - "message": "ファイルがインポートされなければ、ここをクリック!", + "message": "ファイルのインポート方法について", "description": "Helps user import their account from a JSON file" }, + "forbiddenIpfsGateway": { + "message": "IPFSゲートウェイの使用は禁止されています:CID ゲートウェイを指定してください" + }, + "forgetDevice": { + "message": "このデバイスを無視する" + }, "from": { "message": "送信元" }, + "fromAddress": { + "message": "送信元:$1", + "description": "$1 is the address to include in the From label. It is typically shortened first using shortenAddress" + }, + "functionApprove": { + "message": "機能:承認" + }, + "functionType": { + "message": "機能の種類" + }, "gasLimit": { - "message": "ガスリミット" + "message": "Gasリミット" + }, + "gasLimitInfoTooltipContent": { + "message": "Gasリミットは、使用するガスの最大量です。" }, "gasLimitTooLow": { - "message": "ガスリミットは最低21000です。" + "message": "Gasリミットは21000以上にする必要があります" + }, + "gasLimitTooLowWithDynamicFee": { + "message": "Gasリミットは $1 以上にする必要があります", + "description": "$1 is the custom gas limit, in decimal." }, "gasPrice": { - "message": "ガスプライス (GWEI)" + "message": "Gas価格 (GWEI)" + }, + "gasPriceExtremelyLow": { + "message": "Gas価格が安すぎます" + }, + "gasPriceInfoTooltipContent": { + "message": "Gas価格は1Gas当たりのEther価格です。" + }, + "gasUsed": { + "message": "Gas使用量" + }, + "gdprMessage": { + "message": "このデータは、General Data Protection Regulation (EU) 2016/679 のため、匿名で収集されます。個人情報の取り扱いに関する詳細については、$1 をご覧ください。", + "description": "$1 refers to the gdprMessagePrivacyPolicy message, the translation of which is meant to be used exclusively in the context of gdprMessage" + }, + "gdprMessagePrivacyPolicy": { + "message": "プライバシーポリシーはこちら", + "description": "this translation is intended to be exclusively used as the replacement for the $1 in the gdprMessage translation" + }, + "general": { + "message": "一般" + }, + "generalSettingsDescription": { + "message": "通貨換算、通貨単位、言語、アカウントのidenticon" }, "getEther": { "message": "Etherを取得する" }, "getEtherFromFaucet": { - "message": "フォーセットで $1のEtherを得ることができます。", + "message": "$1 のFaucetでEtherを得ることができます。", "description": "Displays network name for Ether faucet" }, + "getHelp": { + "message": "サポートを受ける。" + }, + "getStarted": { + "message": "はじめる" + }, + "goerli": { + "message": "Goerliテストネットワーク" + }, + "happyToSeeYou": { + "message": "また会えましたね!" + }, + "hardware": { + "message": "ハードウェア" + }, + "hardwareWalletConnected": { + "message": "ハードウェアウォレットが接続されました" + }, + "hardwareWallets": { + "message": "ハードウェアウォレットの接続" + }, + "hardwareWalletsMsg": { + "message": "MetaMaskに接続するハードウェアウォレットを選択してください" + }, + "havingTroubleConnecting": { + "message": "接続に問題がありますか?" + }, "here": { - "message": "ここ", + "message": "こちら", "description": "as in -click here- for more information (goes with troubleTokenBalances)" }, + "hexData": { + "message": "16進数データ" + }, "hide": { - "message": "隠す" + "message": "非表示" }, "hideTokenPrompt": { - "message": "トークンを隠しますか?" + "message": "トークンを非表示にしますか?" + }, + "hideTokenSymbol": { + "message": "$1 を非表示にする", + "description": "$1 is the symbol for a token (e.g. 'DAI')" + }, + "history": { + "message": "履歴" }, "import": { - "message": "追加", + "message": "インポート", "description": "Button to import an account from a selected file" }, "importAccount": { @@ -237,137 +802,540 @@ "importAccountMsg": { "message": "追加したアカウントはMetaMaskのアカウントパスフレーズとは関連付けられません。インポートしたアカウントについての詳細は" }, + "importAccountSeedPhrase": { + "message": "シードフレーズを使用してアカウントをインポート" + }, + "importUsingSeed": { + "message": "アカウントのシードフレーズから復元する" + }, + "importWallet": { + "message": "ウォレットのインポート" + }, + "importYourExisting": { + "message": "12単語のシードフレーズを使用して既存のウォレットをインポートします" + }, "imported": { - "message": "インポート完了", + "message": "インポート済", "description": "status showing that an account has been fully loaded into the keyring" }, "infoHelp": { "message": "情報とヘルプ" }, + "initialTransactionConfirmed": { + "message": "最初のトランザクションがネットワークに確認されました。戻るにはOKをクリックします。" + }, + "insufficientBalance": { + "message": "残高不足です。" + }, "insufficientFunds": { "message": "残高不足" }, + "insufficientTokens": { + "message": "トークンが不足しています。" + }, "invalidAddress": { - "message": "アドレスが無効です。" + "message": "無効なアドレスです" + }, + "invalidAddressRecipient": { + "message": "無効な送金先アドレスです" + }, + "invalidAddressRecipientNotEthNetwork": { + "message": "ETH ネットワークではなく、小文字を設定してください" + }, + "invalidBlockExplorerURL": { + "message": "無効なブロックエクスプローラURLです。" + }, + "invalidChainIdTooBig": { + "message": "無効なチェーンIDです。チェーンIDが大きすぎます。" + }, + "invalidCustomNetworkAlertContent1": { + "message": "カスタムネットワーク'$1'のチェーンIDを再入力してください。", + "description": "$1 is the name/identifier of the network." + }, + "invalidCustomNetworkAlertContent2": { + "message": "悪意や欠陥のあるネットワークプロバイダから利用者を保護するため、すべてのカスタムネットワークにチェーンIDが必要です" + }, + "invalidCustomNetworkAlertContent3": { + "message": "設定 > ネットワーク を選択して、チェーンIDを入力してください。よく使用されるネットワークのチェーンIDは $1 にあります。", + "description": "$1 is a link to https://chainid.network" + }, + "invalidCustomNetworkAlertTitle": { + "message": "無効なカスタムネットワークです" + }, + "invalidHexNumber": { + "message": "無効な10進数です。" + }, + "invalidHexNumberLeadingZeros": { + "message": "無効な10進数です。先頭の0を削除してください。" + }, + "invalidIpfsGateway": { + "message": "無効なIPFSゲートウェイです:正しいURLを設定してください。" + }, + "invalidNumber": { + "message": "無効な数値です。10進数、または'0x'を付けた16進数を入力します。" + }, + "invalidNumberLeadingZeros": { + "message": "無効な数値です。先頭の 0 を削除してください。" + }, + "invalidRPC": { + "message": "無効な RPC URL" + }, + "invalidSeedPhrase": { + "message": "無効なシードフレーズ" + }, + "ipfsGateway": { + "message": "IPFSゲートウェイ" + }, + "ipfsGatewayDescription": { + "message": "ENSコンテンツレゾリューションに使用する、IPFS CIDゲートウェイのURLを設定します" }, "jsonFile": { "message": "JSONファイル", "description": "format for importing an account" }, + "knownAddressRecipient": { + "message": "既知のコントラクトアドレスです。" + }, + "knownTokenWarning": { + "message": "このアクションは既にウォレット一覧に表示あるトークンを編集します。これは、フィッシング詐欺の手段として指示されることがあります。変更の意図が明確な場合にのみ実施してください。" + }, "kovan": { "message": "Kovanテストネットワーク" }, + "lastConnected": { + "message": "最後の接続" + }, "learnMore": { - "message": "詳細" + "message": "詳しい使用手順" + }, + "ledgerAccountRestriction": { + "message": "新しいアカウントを追加するには、その前に使用した最後のアカウントが必要です。" + }, + "letsGoSetUp": { + "message": "セットアップを始めましょう!" }, "likeToAddTokens": { - "message": "トークンを追加しますか?" + "message": "これらのトークンを追加しますか?" }, "links": { "message": "リンク" }, + "loadMore": { + "message": "続きをロード" + }, "loading": { - "message": "ロード中..." + "message": "ロードしています..." }, "loadingTokens": { - "message": "トークンをロード中..." + "message": "トークンをロードしています..." + }, + "localhost": { + "message": "Localhost 8545" }, "lock": { - "message": "ログアウト" + "message": "ロック" + }, + "lockTimeTooGreat": { + "message": "ロック時間が長すぎます" }, "mainnet": { - "message": "Ethereumメインネットワーク" + "message": "Ethereumメインネット" }, "max": { "message": "最大" }, + "memo": { + "message": "メモ" + }, + "memorizePhrase": { + "message": "このフレーズを記録してください。" + }, "message": { "message": "メッセージ" }, + "metaMaskConnectStatusParagraphOne": { + "message": "アカウントの接続をMetaMaskで詳細に制御できるようになりました。" + }, + "metaMaskConnectStatusParagraphThree": { + "message": "接続しているアカウントを管理するにはクリックしてください。" + }, + "metaMaskConnectStatusParagraphTwo": { + "message": "現在選択しているアカウントが訪問中のWebサイトに接続されている場合、接続ステータスボタンが表示されます。" + }, + "metamaskDescription": { + "message": "Ethereumの分散型Webに接続しています。" + }, + "metamaskSwapsOfflineDescription": { + "message": "MetaMask Swapsはメンテナンス中です。後でもう一度確認してください。" + }, + "metamaskVersion": { + "message": "MetaMaskのバージョン" + }, + "metametricsCommitmentsAllowOptOut": { + "message": "設定からいつでも離脱できます" + }, + "metametricsCommitmentsBoldNever": { + "message": "実行しない", + "description": "This string is localized separately from some of the commitments so that we can bold it" + }, + "metametricsCommitmentsIntro": { + "message": "MetaMaskが実行する内容は…" + }, + "metametricsCommitmentsNeverCollectIP": { + "message": "$1 が識別可能なIPアドレスを収集することはありません", + "description": "The $1 is the bolded word 'Never', from 'metametricsCommitmentsBoldNever'" + }, + "metametricsCommitmentsNeverCollectKeysEtc": { + "message": "$1 は、キー、アドレス、トランザクション、残高、ハッシュなど、いかなる個人情報も収集しません", + "description": "The $1 is the bolded word 'Never', from 'metametricsCommitmentsBoldNever'" + }, + "metametricsCommitmentsNeverSellDataForProfit": { + "message": "$1 が営利目的でデータを販売することは'永遠に'ありません。", + "description": "The $1 is the bolded word 'Never', from 'metametricsCommitmentsBoldNever'" + }, + "metametricsCommitmentsSendAnonymizedEvents": { + "message": "匿名化されたクリックイベントとページビューイベントを送信する" + }, + "metametricsHelpImproveMetaMask": { + "message": "MetaMaskの品質向上へのご協力のお願い" + }, + "metametricsOptInDescription": { + "message": "MetaMaskでは、ユーザーによる拡張機能の操作方法をより理解するため、基本的な使用状況データを収集させて頂きたいと考えています。このデータは、我々の製品およびEthereumエコシステムの使いやすさとユーザーエクスペリエンスを継続的に改善するために使用されます。" + }, + "mobileSyncText": { + "message": "本人認証のため、パスワードを入力してください!" + }, "mustSelectOne": { - "message": "一つ以上のトークンを選択してください。" + "message": "1つ以上のトークンを選択してください。" }, "myAccounts": { "message": "マイアカウント" }, + "myWalletAccounts": { + "message": "このウォレットのアカウント" + }, + "myWalletAccountsDescription": { + "message": "MetaMaskで作成したすべてのアカウントは、このセクションに自動的に追加されます。" + }, "needEtherInWallet": { - "message": "MetaMaskで分散型アプリケーションを使用するためには、このウォレットにEtherが必要です。" + "message": "MetaMaskで分散型アプリケーションを操作するには、ウォレットにEtherが必要です。" }, "needImportFile": { "message": "インポートするファイルを選択してください。", "description": "User is important an account and needs to add a file to continue" }, + "negativeETH": { + "message": "マイナス額のETHを送付することはできません。" + }, + "networkName": { + "message": "ネットワーク名" + }, + "networkSettingsChainIdDescription": { + "message": "チェーンIDはトランザクションの署名に使用します。チェーンIDはネットワークのチェーンIDと一致する必要があります。10進数、または'0x'を付けた16進数を入力します。表示は10進数です。" + }, + "networkSettingsDescription": { + "message": "カスタムRPCネットワークの追加と編集" + }, "networks": { "message": "ネットワーク" }, + "nevermind": { + "message": "後で試す" + }, "newAccount": { - "message": "新規アカウント" + "message": "新しいアカウント" + }, + "newAccountDetectedDialogMessage": { + "message": "新しいアカウントを検出しました!アドレス帳に追加するにはここをクリックします。" }, "newAccountNumberName": { "message": "アカウント $1", "description": "Default name of next account to be created on create account screen" }, + "newContact": { + "message": "新しい連絡先" + }, "newContract": { - "message": "新規コントラクト" + "message": "新しいコントラクト" + }, + "newNetwork": { + "message": "新しいネットワーク" }, "newPassword": { - "message": "新規パスワード(最低8文字)" + "message": "新しいパスワード(最低 8文字)" + }, + "newToMetaMask": { + "message": "MetaMaskは初めてですか?" + }, + "newTotal": { + "message": "新しい合計" + }, + "newTransactionFee": { + "message": "新しいトランザクション手数料" }, "next": { "message": "次へ" }, + "nextNonceWarning": { + "message": "Nonce $1 は提案された値より大きいです", + "description": "The next nonce according to MetaMask's internal logic" + }, + "noAccountsFound": { + "message": "指定された検索クエリでアカウントは見つかりませんでした" + }, "noAddressForName": { "message": "この名前にはアドレスが設定されていません。" }, "noAlreadyHaveSeed": { - "message": "すでにシードを持っています" + "message": "いいえ、既にシードフレーズがあります" + }, + "noConversionRateAvailable": { + "message": "どの換算レートも利用できません" + }, + "noThanks": { + "message": "やめておく" }, "noTransactions": { - "message": "トランザクションがありません。" + "message": "トランザクションがありません" }, - "password": { - "message": "パスワード" + "noWebcamFound": { + "message": "このコンピューターのウェブカメラが見つかりません。もう一度実行してください。" }, - "pastePrivateKey": { - "message": "秘密鍵をここにペーストして下さい:", - "description": "For importing an account from a private key" + "noWebcamFoundTitle": { + "message": "ウェブカメラが見つかりません" }, - "privacyMsg": { - "message": "プライバシーポリシー" + "nonceField": { + "message": "トランザクションNonceのカスタマイズ" }, - "privateKey": { - "message": "秘密鍵", - "description": "select this type of file to use to import an account" + "nonceFieldDescription": { + "message": "オンにすると、確認画面上でNonce(トランザクション番号)を変更できます。これは高度な機能です。慎重に使用してください。" }, - "privateKeyWarning": { - "message": "警告: この鍵は絶対に公開しないで下さい。公開すると、誰でもあなたのアカウント内の資産を盗むことができてしまいます。" + "nonceFieldHeading": { + "message": "カスタムNonce" + }, + "notCurrentAccount": { + "message": "これは正しいアカウントですか?現在ウォレットで選択中のアカウントと異なります" + }, + "notEnoughGas": { + "message": "Gasが不足しています" + }, + "ofTextNofM": { + "message": "of" + }, + "off": { + "message": "オフ" + }, + "offlineForMaintenance": { + "message": "メンテナンスのためにオフラインです" + }, + "ok": { + "message": "OK" + }, + "on": { + "message": "オン" + }, + "onboardingReturnNotice": { + "message": "\"$1\" はこのタブを閉じます。 $2 に戻ってください。", + "description": "Return the user to the site that initiated onboarding" + }, + "onlyAddTrustedNetworks": { + "message": "悪意のあるEthereumネットワークプロバイダは、不正なブロックチェーンによりネットワーク行動を記録することがあります。信頼できるカスタムネットワークのみを追加してください。" + }, + "onlyAvailableOnMainnet": { + "message": "メインネットのみ使用可能です" + }, + "onlyConnectTrust": { + "message": "信頼するサイトにのみ接続してください。" + }, + "optionalBlockExplorerUrl": { + "message": "ブロックエクスプローラのURL(オプション)" + }, + "optionalCurrencySymbol": { + "message": "通貨シンボル(オプション)" + }, + "orderOneHere": { + "message": "Trezor又はLedgerを注文して資金をコールドストレージに保管できます" + }, + "origin": { + "message": "要求元" + }, + "parameters": { + "message": "パラメータ" + }, + "participateInMetaMetrics": { + "message": "MetaMetricsに参加" + }, + "participateInMetaMetricsDescription": { + "message": "MetaMaskの改善のため、MetaMetricsに参加します" + }, + "password": { + "message": "パスワード" + }, + "passwordNotLongEnough": { + "message": "パスワードの長さが足りません" + }, + "passwordsDontMatch": { + "message": "パスワードが一致しません" + }, + "pastePrivateKey": { + "message": "秘密鍵をペーストして下さい:", + "description": "For importing an account from a private key" + }, + "pending": { + "message": "保留中" + }, + "permissionCheckedIconDescription": { + "message": "この許可を承認しました。" + }, + "permissionUncheckedIconDescription": { + "message": "この許可は承認を完了していません。" + }, + "permissions": { + "message": "権限" + }, + "personalAddressDetected": { + "message": "個人アドレスが検出されました。トークンコントラクトのアドレスを入力してください。" + }, + "plusXMore": { + "message": "+$1 以上", + "description": "$1 is a number of additional but unshown items in a list- this message will be shown in place of those items" + }, + "prev": { + "message": "戻る" + }, + "primaryCurrencySetting": { + "message": "基準通貨" + }, + "primaryCurrencySettingDescription": { + "message": "値の表示をチェーンの通貨(ETHなど)で優先するには、通貨(ETHなど)を選択します。選択した基準通貨を優先するには、[法定通貨] を選択します。" + }, + "privacyMsg": { + "message": "プライバシーポリシー" + }, + "privateKey": { + "message": "秘密鍵", + "description": "select this type of file to use to import an account" + }, + "privateKeyWarning": { + "message": "警告: この鍵は絶対に公開しないで下さい。公開すると、アカウント内の資産を盗まれます。" }, "privateNetwork": { - "message": "プライベート・ネットワーク" + "message": "プライベートネットワーク" + }, + "proposedApprovalLimit": { + "message": "承認限度額の提案" + }, + "protectYourKeys": { + "message": "キーを保護してください!" + }, + "protectYourKeysMessage1": { + "message": "シードフレーズは厳重に取り扱ってください。MetaMaskの偽物がWebサイトで報告されています。MetaMaskがシードフレーズを要求することは絶対にありえません!" + }, + "protectYourKeysMessage2": { + "message": "シードフレーズを厳重に保管してください。不審な点がやWebサイトについて不明確な場合は、support@metamask.io まで電子メールでお問い合わせください" + }, + "provide": { + "message": "提供する" + }, + "queue": { + "message": "保留中" + }, + "queued": { + "message": "追加済" }, "readdToken": { - "message": "アカウントのオプションメニューから「トークンを追加」すれば、将来このトークンを追加し直すことができます。" + "message": "アカウントオプションのメニューで\"トークンの追加\"を選択すると、後でこのトークンを戻すことができます。" + }, + "readyToConnect": { + "message": "接続準備はよろしいですか?" + }, + "receive": { + "message": "受け取る" + }, + "recents": { + "message": "最近の履歴" }, "recipientAddress": { - "message": "受取人アドレス" + "message": "受取アドレス" + }, + "recipientAddressPlaceholder": { + "message": "パブリックアドレス(0x)、またはENSを検索" }, "reject": { "message": "拒否" }, + "rejectAll": { + "message": "すべて拒否" + }, + "rejectTxsDescription": { + "message": "$1個のトランザクションを一括拒否しようとしています。" + }, + "rejectTxsN": { + "message": "$1個のトランザクションを拒否" + }, "rejected": { - "message": "拒否されました" + "message": "拒否しました" + }, + "remindMeLater": { + "message": "後で通知" + }, + "remove": { + "message": "削除" + }, + "removeAccount": { + "message": "アカウントの削除" + }, + "removeAccountDescription": { + "message": "このアカウントはウォレットから削除されます。続行する前に、ウォレットにインポートしたアカウントのシードフレーズか秘密鍵を保管してください。アカウントは、アカウントのドロップダウンから再度インポート、または作成できます。" + }, + "requestsAwaitingAcknowledgement": { + "message": "承認されるまで待機する" }, "required": { - "message": "必要です。" + "message": "必須" + }, + "reset": { + "message": "リセット" }, "resetAccount": { "message": "アカウントをリセット" }, + "resetAccountDescription": { + "message": "アカウントをリセットするとトランザクション履歴がクリアされます。シードフレーズの再入力は不要です。これによりアカウント内の残高が変更されることはありません。" + }, + "restore": { + "message": "復元" + }, + "restoreAccountWithSeed": { + "message": "シードフレーズでアカウントを復元" + }, "restoreFromSeed": { - "message": "パスフレーズから復元する" + "message": "アカウントを復元しますか?" + }, + "restoreWalletPreferences": { + "message": "$1 のデータバックアップが見つかりました。ウォレットの基本設定を復元しますか?", + "description": "$1 is the date at which the data was backed up" + }, + "retryTransaction": { + "message": "トランザクションを再試行" + }, + "reusedTokenNameWarning": { + "message": "既に登録されているトークンシンボルと同じシンボルの登録はお勧めしません。混乱や操作ミスの原因になります。" }, "revealSeedWords": { - "message": "パスフレーズを表示" + "message": "シードフレーズを表示" + }, + "revealSeedWordsDescription": { + "message": "ブラウザを変更したりコンピュータを変更した場合は、アカウントにアクセスするためにシードフレーズが必要になります。安全で秘密の場所に保管してください。" + }, + "revealSeedWordsTitle": { + "message": "シードフレーズ" + }, + "revealSeedWordsWarning": { + "message": "シードフレーズは全てのアカウントを盗む手段にも使えます。" + }, + "revealSeedWordsWarningTitle": { + "message": "シードフレーズは誰にも教えないでください。" }, "rinkeby": { "message": "Rinkebyテストネットワーク" @@ -375,38 +1343,156 @@ "ropsten": { "message": "Ropstenテストネットワーク" }, + "rpcUrl": { + "message": "RPC URL" + }, "save": { "message": "保存" }, + "saveAsCsvFile": { + "message": "CSVファイルとして保存" + }, + "scanInstructions": { + "message": "カメラでQRコードを置いてください" + }, + "scanQrCode": { + "message": "QRコードのスキャン" + }, + "scrollDown": { + "message": "下へスクロール" + }, "search": { "message": "検索" }, + "searchAccounts": { + "message": "アカウントの検索" + }, "searchResults": { "message": "検索結果" }, "searchTokens": { "message": "トークンの検索" }, + "secretBackupPhrase": { + "message": "シードフレーズのバックアップ" + }, + "secretBackupPhraseDescription": { + "message": "シードフレーズを使用すると、アカウントのバックアップと復元が簡単になります。" + }, + "secretBackupPhraseWarning": { + "message": "警告:シードフレーズは絶対に公開しないでください。シードフレーズを使うと、誰でもアカウントからETHを盗み出せます。" + }, + "secretPhrase": { + "message": "アカウント情報を復元するには、12単語で構成されたシードフレーズを入力してください。" + }, + "securityAndPrivacy": { + "message": "セキュリティとプライバシー" + }, + "securitySettingsDescription": { + "message": "プライバシーの設定とウォレットのシードフレーズ" + }, + "seedPhrasePlaceholder": { + "message": "シードフレーズを単語ごとに半角スペースで分割して入力して下さい" + }, + "seedPhrasePlaceholderPaste": { + "message": "シードフレーズをクリップボードからペーストして下さい" + }, + "seedPhraseReq": { + "message": "シードフレーズには、12,15,18,21、または24単語が含まれます" + }, + "selectAHigherGasFee": { + "message": "トランザクションの処理を早めるには、より高いガス料金を選択してください。" + }, + "selectAccounts": { + "message": "アカウントを選択してください" + }, + "selectAll": { + "message": "すべて選択" + }, + "selectAnAccount": { + "message": "アカウントを1個選択" + }, + "selectAnAccountHelp": { + "message": "MetaMaskで表示するアカウントを選択してください" + }, "selectCurrency": { "message": "通貨を選択" }, + "selectEachPhrase": { + "message": "単語を選択して、各フレーズが正しいことを確認してください。" + }, + "selectHdPath": { + "message": "HDパスの選択" + }, + "selectLocale": { + "message": "言語の選択" + }, + "selectPathHelp": { + "message": "既存のLedgerのアカウントが以下に表示されない場合は、パスを \"Legacy (MEW / MyCrypto)\" に変えてください。" + }, "selectType": { - "message": "キーの種類" + "message": "形式の選択" + }, + "selectingAllWillAllow": { + "message": "すべてを選択すると、このサイトは現在の全アカウントを見ることができます。サイトが信頼できるか確認してください。" }, "send": { - "message": "送信" + "message": "送る" + }, + "sendAmount": { + "message": "送金額" }, "sendETH": { - "message": "ETHの送信" + "message": "ETHの送金" + }, + "sendSpecifiedTokens": { + "message": "$1 を送る", + "description": "Symbol of the specified token" }, "sendTokens": { - "message": "トークンを送信" + "message": "トークンを送る" + }, + "sentEther": { + "message": "Etherの送金" + }, + "separateEachWord": { + "message": "単語ごとに1文字のスペースで分離してください" }, "settings": { "message": "設定" }, + "showAdvancedGasInline": { + "message": "高度なGasの設定" + }, + "showAdvancedGasInlineDescription": { + "message": "オンにするとGas価格とGasリミットが送金画面と確認画面に直接表示されます。" + }, + "showFiatConversionInTestnets": { + "message": "テストネットで法定通貨換算額を表示" + }, + "showFiatConversionInTestnetsDescription": { + "message": "オンにすると、テストネットで法定通貨換算額を表示します" + }, + "showHexData": { + "message": "16進データの表示" + }, + "showHexDataDescription": { + "message": "オンにすると、送金画面に16進データフィールドを表示します" + }, + "showIncomingTransactions": { + "message": "着信したトランザクションの表示" + }, + "showIncomingTransactionsDescription": { + "message": "オンにすると、Etherscanを使用して、着信トランザクションをトランザクションリストに表示します" + }, + "showPermissions": { + "message": "権限の表示" + }, "showPrivateKeys": { - "message": "秘密鍵を表示" + "message": "秘密鍵の表示" + }, + "showSeedPhrase": { + "message": "シードフレーズの表示" }, "sigRequest": { "message": "署名リクエスト" @@ -415,64 +1501,642 @@ "message": "署名" }, "signNotice": { - "message": "このメッセージへの署名は危険となる可能性があります。\n完全に信頼するサイトからのメッセージのみ、\nあなたのアカウントで署名して下さい。今後のバージョンでは、\nこの危険なメソッドは削除される予定です。" + "message": "メッセージへの署名は、アカウント全体に対して危険な副作用を起こす可能性があります。\n完全に信頼できるサイトからのメッセージのみに署名してください。\nこの方法は危険です。将来のバージョンでは削除されます。" }, "signatureRequest": { "message": "署名リクエスト" }, + "signatureRequest1": { + "message": "メッセージ" + }, + "signed": { + "message": "署名が完了しました" + }, + "slow": { + "message": "低速" + }, + "somethingWentWrong": { + "message": "おおぅ!問題が発生しました。" + }, + "speedUp": { + "message": "高速化" + }, + "speedUpCancellation": { + "message": "キャンセルを高速化" + }, + "speedUpTransaction": { + "message": "トランザクションを高速化" + }, + "spendLimitAmount": { + "message": "使用限度額" + }, + "spendLimitInsufficient": { + "message": "使用限度額が不十分です" + }, + "spendLimitInvalid": { + "message": "使用限度額が無効です。正の数値をである必要があります" + }, + "spendLimitPermission": { + "message": "使用限度額の許可" + }, + "spendLimitRequestedBy": { + "message": "使用限度額が $1 によって要求されました", + "description": "Origin of the site requesting the spend limit" + }, + "spendLimitTooLarge": { + "message": "使用限度額が多すぎます" + }, + "stateLogError": { + "message": "状態ログの検索中にエラーが発生しました。" + }, + "stateLogFileName": { + "message": "MetaMask State Logs" + }, + "stateLogs": { + "message": "状態ログ" + }, + "stateLogsDescription": { + "message": "状態ログには、アカウントアドレスと送信済みトランザクションが含まれています。" + }, + "statusConnected": { + "message": "接続済" + }, + "statusNotConnected": { + "message": "未接続" + }, + "step1HardwareWallet": { + "message": "1.ハードウェア ウォレットの接続" + }, + "step1HardwareWalletMsg": { + "message": "コンピューターに直接ハードウェアウォレットを接続してください。" + }, + "step2HardwareWallet": { + "message": "2.アカウントを選択" + }, + "step2HardwareWalletMsg": { + "message": "読取るアカウントを1つ選択します。" + }, + "step3HardwareWallet": { + "message": "3.web3を使用してサイトに接続しましょう!" + }, + "step3HardwareWalletMsg": { + "message": "Ethereumアカウントと同じように、ハードウェアアカウントを使用します。web3サイトに接続してETH を送金し、ERC20トークンやCryptoKittiesのようなトークンを購入して保管できます。" + }, + "storePhrase": { + "message": "このフレーズを1Passwordのようなパスワードマネージャーに保管てください。" + }, + "submit": { + "message": "送信" + }, + "submitted": { + "message": "送信済み" + }, + "supportCenter": { + "message": "サポートセンターへ移動" + }, + "swap": { + "message": "スワップ" + }, + "swapAdvancedSlippageInfo": { + "message": "注文した時点と注文が承認された時点で価格が変わることをスリッページと呼びます。スリッページが最大スリッページ設定を超えると、スワップは自動的にキャンセルされます。" + }, + "swapAggregator": { + "message": "アグリゲータ" + }, + "swapAmountReceived": { + "message": "受け取り保証額" + }, + "swapAmountReceivedInfo": { + "message": "これは受け取る最低額です。スリッページに基づいて、それ以上の額を受け取ることができます。" + }, + "swapApproval": { + "message": "$1 のスワップを承認", + "description": "Used in the transaction display list to describe a transaction that is an approve call on a token that is to be swapped.. $1 is the symbol of a token that has been approved." + }, + "swapApproveNeedMoreTokens": { + "message": "このスワップを完了するには、さらに $1 の $2 が必要です。", + "description": "Tells the user how many more of a given token they need for a specific swap. $1 is an amount of tokens and $2 is the token symbol." + }, + "swapBetterQuoteAvailable": { + "message": "より良い見積があります。" + }, + "swapBuildQuotePlaceHolderText": { + "message": "$1 と一致するトークンがありません", + "description": "Tells the user that a given search string does not match any tokens in our token lists. $1 can be any string of text" + }, + "swapCheckingQuote": { + "message": "$1 をチェック中", + "description": "Shown to the user during quote loading. $1 is the name of an aggregator. The message indicates that metamask is currently checking if that aggregator has a trade/quote for their requested swap." + }, + "swapCustom": { + "message": "カスタム" + }, + "swapDecentralizedExchange": { + "message": "分散型取引所" + }, + "swapEditLimit": { + "message": "限度額の変更" + }, + "swapEnableDescription": { + "message": "MetaMaskで $1 のスワップを許可します。(必須)", + "description": "Gives the user info about the required approval transaction for swaps. $1 will be the symbol of a token being approved for swaps." + }, + "swapEstimatedNetworkFee": { + "message": "推定のネットワーク手数料" + }, + "swapEstimatedNetworkFeeSummary": { + "message": "“$1”は現状から予測された手数料です。正確な額はネットワーク状態によって変わります。", + "description": "$1 will be the translation of swapEstimatedNetworkFee, with the font bolded" + }, + "swapEstimatedNetworkFees": { + "message": "推定のネットワーク手数料" + }, + "swapEstimatedNetworkFeesInfo": { + "message": "これは、スワップを完了するために使用されるネットワーク手数料の推定値です。実際の額はネットワークの状態によって変わる可能性があります。" + }, + "swapFailedErrorDescription": { + "message": "資金はウォレットに安全で利用可能な状態にあります。" + }, + "swapFailedErrorTitle": { + "message": "スワップに失敗しました" + }, + "swapFetchingQuotesErrorDescription": { + "message": "ぐぬぬ...問題が発生しました。もう一度実行してください。エラーが解決しななければ、カスタマサポート担当者へお問い合わせください。" + }, + "swapFetchingQuotesErrorTitle": { + "message": "見積の取得エラー" + }, + "swapFetchingTokens": { + "message": "トークンを取り出し中..." + }, + "swapFinalizing": { + "message": "終了中..." + }, + "swapHighSlippageWarning": { + "message": "非常に大きいスリッページ額です。本当に実行するか確認してください。" + }, + "swapIntroLearnMoreHeader": { + "message": "詳細を表示しますか?" + }, + "swapIntroLearnMoreLink": { + "message": "MetaMask Swapsの詳細" + }, + "swapIntroLiquiditySourcesLabel": { + "message": "流動性ソースには以下が含まれます。" + }, + "swapIntroPopupSubTitle": { + "message": "トークンをMetaMaskで直接スワップできるようになりました。MetaMask Swapsは、多数の分散型取引所アグリゲーター、専門のマーケットメーカー、DEX取引所を統合し、ユーザーは常に最低のネットワーク手数料、最適な価格で取引できます。" + }, + "swapIntroPopupTitle": { + "message": "トークンのスワップはこちら!" + }, + "swapLearnMoreContractsAuditReview": { + "message": "MetaSwapのコントラクト監査のレビュー" + }, + "swapLowSlippageError": { + "message": "トランザクションが失敗する可能性があります。最大スリッページが少なすぎます。" + }, + "swapMaxNetworkFeeInfo": { + "message": " $1 は最大支払額です。ネットワークのボラビリティが高いと、大きな値になることがあります。", + "description": "$1 will be the translation of swapMaxNetworkFees, with the font bolded" + }, + "swapMaxNetworkFees": { + "message": "最大ネットワーク手数料" + }, + "swapMaxSlippage": { + "message": "最大スリッページ" + }, + "swapMetaMaskFee": { + "message": "MetaMask手数料" + }, + "swapMetaMaskFeeDescription": { + "message": "MetaMaskは取引毎に最上位の流動性の供給者から最良価格を探します。見積には $1% の手数料が自動的に組み込まれ、MetaMaskの将来の開発をサポートします。", + "description": "Provides information about the fee that metamask takes for swaps. $1 is a decimal number." + }, + "swapNQuotes": { + "message": "$1個の見積", + "description": "$1 is the number of quotes that the user can select from when opening the list of quotes on the 'view quote' screen" + }, + "swapNetworkFeeSummary": { + "message": "ネットワーク手数料には、スワップの結果をEthereumネットワークに保管する費用も含まれています。MetaMaskは手数料から利益を得ません。" + }, + "swapNewQuoteIn": { + "message": "見積の有効期限 $1", + "description": "Tells the user the amount of time until the currently displayed quotes are update. $1 is a time that is counting down from 1:00 to 0:00" + }, + "swapOnceTransactionHasProcess": { + "message": "このトランザクション処理を完了すると、$1 がアカウントに追加されます。", + "description": "This message communicates the token that is being transferred. It is shown on the awaiting swap screen. The $1 will be a token symbol." + }, + "swapPriceDifference": { + "message": "$1 $2 ($3) を $4 $5 ($6)にスワップします。", + "description": "This message represents the price slippage for the swap. $1 and $4 are a number (ex: 2.89), $2 and $5 are symbols (ex: ETH), and $3 and $6 are fiat currency amounts." + }, + "swapPriceDifferenceTitle": { + "message": "価格差は $1% です", + "description": "$1 is a number (ex: 1.23) that represents the price difference." + }, + "swapPriceDifferenceTooltip": { + "message": "市場価格の違いは、仲介業者が負担する手数料、市場規模、取引量、または取引価格差の影響を受けることがあります。" + }, + "swapPriceDifferenceUnavailable": { + "message": "マーケット価格は利用できません。続行する前に、返金額に問題がないことを確認してください。" + }, + "swapProcessing": { + "message": "処理中" + }, + "swapQuoteDetails": { + "message": "見積の詳細" + }, + "swapQuoteDetailsSlippageInfo": { + "message": "注文した時点と注文が承認された時点で価格が変わることを\"スリッページ\"と呼びます。スリッページが\"最大スリッページ\"設定を超える場合、スワップは自動的にキャンセルされます。" + }, + "swapQuoteIncludesRate": { + "message": "見積には $1% のMetaMask手数料が含まれています", + "description": "Provides information about the fee that metamask takes for swaps. $1 is a decimal number." + }, + "swapQuoteNofN": { + "message": "$2個中の $1個の見積", + "description": "A count of loaded quotes shown to the user while they are waiting for quotes to be fetched. $1 is the number of quotes already loaded, and $2 is the total number of quotes to load." + }, + "swapQuoteSource": { + "message": "取引ソース" + }, + "swapQuotesAreRefreshed": { + "message": "現在のマーケット状態を反映して、見積はリアルタイム更新されます。" + }, + "swapQuotesExpiredErrorDescription": { + "message": "最新のレートで見積を取得するには再試行してください。" + }, + "swapQuotesExpiredErrorTitle": { + "message": "見積のタイムアウト" + }, + "swapQuotesNotAvailableErrorDescription": { + "message": "取引額を調整するかスリッページを再設定して、もう一度実行してください。" + }, + "swapQuotesNotAvailableErrorTitle": { + "message": "見積を取得できません" + }, + "swapRate": { + "message": "レート" + }, + "swapReceiving": { + "message": "受取額" + }, + "swapReceivingInfoTooltip": { + "message": "これは推定値です。正確な額はスリッページによって異なります。" + }, + "swapRequestForQuotation": { + "message": "見積の要求" + }, + "swapSearchForAToken": { + "message": "トークンを検索" + }, + "swapSelect": { + "message": "選択" + }, + "swapSelectAQuote": { + "message": "見積の選択" + }, + "swapSelectAToken": { + "message": "トークンの選択" + }, + "swapSelectQuotePopoverDescription": { + "message": "以下は複数の流動性ソースから収集したすべての見積です。" + }, + "swapSlippageTooLow": { + "message": "スリッページは 0 より多くする必要があります。" + }, + "swapSource": { + "message": "流動性ソース" + }, + "swapSourceInfo": { + "message": "最良のレートと最小のネットワーク手数料を探すため、複数の流動性ソース(取引所、アグリゲーター、専門のマーケットメーカー)を検索します。" + }, + "swapStartSwapping": { + "message": "スワップの開始" + }, + "swapSwapFrom": { + "message": "スワップ元" + }, + "swapSwapSwitch": { + "message": "スワップ先と元の交換" + }, + "swapSwapTo": { + "message": "スワップ先" + }, + "swapThisWillAllowApprove": { + "message": "$1 のスワップが可能になります。" + }, + "swapTokenAvailable": { + "message": "$1 がアカウントに追加されました。", + "description": "This message is shown after a swap is successful and communicates the exact amount of tokens the user has received for a swap. The $1 is a decimal number of tokens followed by the token symbol." + }, + "swapTokenToToken": { + "message": "$1 を $2 にスワップ", + "description": "Used in the transaction display list to describe a swap. $1 and $2 are the symbols of tokens in involved in a swap." + }, + "swapTransactionComplete": { + "message": "トランザクションが完了しました" + }, + "swapUnknown": { + "message": "不明" + }, + "swapUsingBestQuote": { + "message": "最適な見積を使用する" + }, + "swapVerifyTokenExplanation": { + "message": "複数のトークンが同じ名前とシンボルであることがあります。Etherscanで実際のトークンでを確認してください。" + }, + "swapViewToken": { + "message": "$1 を表示" + }, + "swapYourTokenBalance": { + "message": "$1 $2 はスワップに使用できます", + "description": "Tells the user how much of a token they have in their balance. $1 is a decimal number amount of tokens, and $2 is a token symbol" + }, + "swapZeroSlippage": { + "message": "0% スリッページ" + }, + "swapsAdvancedOptions": { + "message": "詳細オプション" + }, + "swapsExcessiveSlippageWarning": { + "message": "スリッページが大きすぎてレートが悪化しています。スリッページ最大値を 15% 未満にしてください。" + }, + "swapsMaxSlippage": { + "message": "最大スリッページ" + }, + "swapsNotEnoughForTx": { + "message": "トランザクションを完了するには $1 は不十分です。", + "description": "Tells the user that they don't have enough of a token for a proposed swap. $1 is a token symbol" + }, + "swapsViewInActivity": { + "message": "アクティビティの表示" + }, + "switchNetworks": { + "message": "ネットワークを切替え" + }, + "switchToThisAccount": { + "message": "このアカウントへ切替え" + }, + "symbol": { + "message": "シンボル" + }, + "symbolBetweenZeroTwelve": { + "message": "シンボルは11文字以下にする必要があります。" + }, + "syncWithMobile": { + "message": "モバイルアプリと同期" + }, + "syncWithMobileBeCareful": { + "message": "コードをスキャンする前に、誰にも画面を見られていないことを確認してください" + }, + "syncWithMobileComplete": { + "message": "データの同期に成功しました。MetaMaskモバイルアプリを利用できます!" + }, + "syncWithMobileDesc": { + "message": "アカウントと情報をスマートフォンアプリと同期させることができます。MetaMaskモバイルアプリを開き、\"設定\" に進み、\"ブラウザー拡張機能から同期\" をタップします。" + }, + "syncWithMobileDescNewUsers": { + "message": "MetaMaskモバイルアプリを初めて使用する場合は、スマートフォンを以下のステップに従って操作してください。" + }, + "syncWithMobileScanThisCode": { + "message": "MetaMaskモバイルアプリでこのコードをスキャンしてください" + }, + "syncWithMobileTitle": { + "message": "モバイルアプリとの同期" + }, + "syncWithThreeBox": { + "message": "データを3Boxと同期(試験中)" + }, + "syncWithThreeBoxDescription": { + "message": "オンにすると、設定が3Box でバックアップされます。この機能は試験中です。ご自身の責任で使用してください。" + }, + "syncWithThreeBoxDisabled": { + "message": "3Boxは、初期同期のエラーにより、使用不能です。" + }, "terms": { "message": "利用規約" }, + "termsOfService": { + "message": "サービス利用規約" + }, "testFaucet": { - "message": "Faucetをテスト" + "message": "テストFaucet" + }, + "thisWillCreate": { + "message": "新しいウォレットとシードフレーズが作成されます" + }, + "tips": { + "message": "ヒント" }, "to": { - "message": "送信先" + "message": "受信先" + }, + "toAddress": { + "message": "受信先:$1", + "description": "$1 is the address to include in the To label. It is typically shortened first using shortenAddress" + }, + "toWithColon": { + "message": "受信先:" }, "token": { "message": "トークン" }, + "tokenAlreadyAdded": { + "message": "トークンは既に追加されています。" + }, + "tokenContractAddress": { + "message": "トークンコントラクトのアドレス" + }, + "tokenOptions": { + "message": "トークンのオプション" + }, "tokenSymbol": { "message": "トークンシンボル" }, "total": { "message": "合計" }, + "transaction": { + "message": "トランザクション" + }, + "transactionCancelAttempted": { + "message": "トランザクションのキャンセルをGas料金 $1 で試みました。$2" + }, + "transactionCancelSuccess": { + "message": "トランザクションのキャンセルが成功しました。$2" + }, + "transactionConfirmed": { + "message": "トランザクションが確定しました。$2" + }, + "transactionCreated": { + "message": "トランザクションは $1 の値を作成しました。$2" + }, + "transactionDropped": { + "message": "トランザクションは削除されました。$2" + }, + "transactionError": { + "message": "トランザクションエラー。コントラクトコードで例外がスローされました。" + }, + "transactionErrorNoContract": { + "message": "コントラクト外アドレスに対して関数呼出を試みています。" + }, + "transactionErrored": { + "message": "トランザクションでエラーが発生しました。" + }, + "transactionFee": { + "message": "トランザクション手数料" + }, + "transactionResubmitted": { + "message": "トランザクションを追加Gas料金: $1 で再送信しました。$2" + }, + "transactionSubmitted": { + "message": "トランザクションがGas料金 $1 で送信されました。$2" + }, + "transactionUpdated": { + "message": "トランザクションが更新されました。$2" + }, + "transfer": { + "message": "転送" + }, + "transferBetweenAccounts": { + "message": "自分のアカウント間での移動" + }, + "transferFrom": { + "message": "転送元" + }, + "troubleConnectingToWallet": { + "message": "$1 への接続に失敗しました。 $2 を再確認して、もう一度実行してください。", + "description": "$1 is the wallet device name; $2 is a link to wallet connection guide" + }, "troubleTokenBalances": { "message": "トークン残高を取得できません。こちらでご確認ください。", "description": "Followed by a link (here) to view token balances" }, + "trustSiteApprovePermission": { + "message": "このサイトを信頼しますか?許可を与えることにより、$1 は $2 の支払トランザクションを自動化します。", + "description": "$1 is the url requesting permission and $2 is the symbol of the currency that the request is for" + }, + "tryAgain": { + "message": "再試行" + }, "typePassword": { - "message": "パスワードの入力" + "message": "MetaMaskのパスワードを入力" + }, + "unapproved": { + "message": "未承認" + }, + "units": { + "message": "単位" }, "unknown": { "message": "不明" }, + "unknownCameraError": { + "message": "カメラにアクセスしているときにエラーが発生しました。もう一度実行してください。" + }, + "unknownCameraErrorTitle": { + "message": "おおぅ!問題が発生しました。" + }, "unknownNetwork": { "message": "不明なプライベートネットワーク" }, + "unknownQrCode": { + "message": "エラー:QRコードを識別できませんでした" + }, + "unlimited": { + "message": "無制限" + }, "unlock": { - "message": "ログイン" + "message": "ロック解除" + }, + "unlockMessage": { + "message": "分散型Webが待っています" + }, + "updatedWithDate": { + "message": "$1 に更新しました" + }, + "urlErrorMsg": { + "message": "URLには適切なHTTP/HTTPSプレフィックスが必要です。" + }, + "urlExistsErrorMsg": { + "message": "URLはネットワークリストに既に存在します" + }, + "usePhishingDetection": { + "message": "フィッシング検出を使用" + }, + "usePhishingDetectionDescription": { + "message": "Ethereumユーザーを対象としたドメインのフィッシングに対して警告を表示します" }, "usedByClients": { - "message": "様々なクライアントによって使用されています。" + "message": "Ethereumクライアントなどで使用されています。" + }, + "userName": { + "message": "ユーザー名" + }, + "verifyThisTokenOn": { + "message": "トークンを $1 で検証する", + "description": "Points the user to etherscan as a place they can verify information about a token. $1 is replaced with the translation for \"etherscan\"" }, "viewAccount": { - "message": "アカウントを見る" + "message": "アカウントを表示" + }, + "viewContact": { + "message": "連絡先を表示" + }, + "viewOnCustomBlockExplorer": { + "message": "$1 で表示" }, "viewOnEtherscan": { - "message": "Etherscan で見る" + "message": "Etherscanで表示" + }, + "viewinExplorer": { + "message": "Explorerで表示" + }, + "visitWebSite": { + "message": "ウェブサイト" + }, + "walletConnectionGuide": { + "message": "ハードウェアウォレット接続ガイド" }, "walletSeed": { - "message": "ウォレットのパスフレーズ" + "message": "シードフレーズ" + }, + "web3ShimUsageNotification": { + "message": "このサイトは削除されたwindow.web3 APIを使用します。サイトに問題が発生しているなら、$1 で詳細を見ることができます。", + "description": "$1 is a clickable link." }, "welcome": { - "message": "MetaMask ベータ版へようこそ!" + "message": "MetaMaskへようこそ!" }, "welcomeBack": { "message": "おかえりなさい!" }, + "whatsThis": { + "message": "これは何ですか?" + }, + "writePhrase": { + "message": "このパスフレーズを紙に書いて、安全な場所に保管してください。セキュリティが必要な場合は、フレーズを分割して複数の紙に書き、それぞれを別の場所に保管します。" + }, + "xOfY": { + "message": "$1 / $2", + "description": "$1 and $2 are intended to be two numbers, where $2 is a total, and $1 is a count towards that total" + }, + "yesLetsTry": { + "message": "試す" + }, + "youNeedToAllowCameraAccess": { + "message": "この機能を使用するには、カメラへのアクセスを許可が必要です。" + }, "youSign": { - "message": "署名しています。" + "message": "署名しています" + }, + "yourPrivateSeedPhrase": { + "message": "秘密のシードフレーズ" + }, + "zeroGasPriceOnSpeedUpError": { + "message": "追加のGas価格を0にできません" } } From 1e086aeb06cf63adb79bc8e2bc09e1d70c5ed7db Mon Sep 17 00:00:00 2001 From: kumavis Date: Mon, 8 Feb 2021 23:45:06 +0800 Subject: [PATCH 02/11] storybook/i18n - add i18n party button (#10382) --- .storybook/i18n-party-addon/register.js | 37 +++ .storybook/main.js | 1 + .storybook/preview.js | 51 ++-- package.json | 12 +- yarn.lock | 328 ++++++------------------ 5 files changed, 148 insertions(+), 281 deletions(-) create mode 100644 .storybook/i18n-party-addon/register.js diff --git a/.storybook/i18n-party-addon/register.js b/.storybook/i18n-party-addon/register.js new file mode 100644 index 000000000..20175a80e --- /dev/null +++ b/.storybook/i18n-party-addon/register.js @@ -0,0 +1,37 @@ +// import { useGlobals } from '@storybook/api'; +const { useGlobals } = require('@storybook/api') +const React = require("react") +const { addons, types } = require("@storybook/addons") +const { Icons, IconButton } = require('@storybook/components') +const localeList = require('../../app/_locales/index.json') +const { useEffect } = React + +addons.register("i18n-party", () => { + + addons.add("i18n-party", { + title: "rotates through every i18n locale", + //👇 Sets the type of UI element in Storybook + type: types.TOOL, + match: () => true, + render: (...args) => { + // https://github.com/storybookjs/storybook/blob/6490a0d646dbaa293b76bbde477daca615efe789/addons/toolbars/src/components/MenuToolbar.tsx#L2 + const [globals, updateGlobals] = useGlobals() + useEffect(() => { + if (!globals.localeParty) return + const interval = setInterval((...args) => { + const currentIndex = localeList.findIndex(({ code }) => code === globals.locale) + const nextIndex = (currentIndex + 1) % localeList.length + const nextLocale = localeList[nextIndex].code + updateGlobals({ locale: nextLocale }) + }, 2000) + return () => clearInterval(interval) + }) + + return ( + updateGlobals({ localeParty: !globals.localeParty })}> + + + ) + }, + }) +}) diff --git a/.storybook/main.js b/.storybook/main.js index b2ff41a8e..2e708e264 100644 --- a/.storybook/main.js +++ b/.storybook/main.js @@ -9,6 +9,7 @@ module.exports = { '@storybook/addon-actions', '@storybook/addon-backgrounds', '@storybook/addon-toolbars', + './i18n-party-addon/register.js', ], webpackFinal: async (config) => { config.module.strictExportPresence = true diff --git a/.storybook/preview.js b/.storybook/preview.js index 8c6c910cf..e8c6a3b1b 100644 --- a/.storybook/preview.js +++ b/.storybook/preview.js @@ -1,22 +1,23 @@ -import React from 'react' -import { addDecorator, addParameters } from '@storybook/react' -import { withKnobs } from '@storybook/addon-knobs' -import { Provider } from 'react-redux' -import configureStore from '../ui/app/store/store' -import '../ui/app/css/index.scss' -import localeList from '../app/_locales/index.json' -import * as allLocales from './locales' -import { I18nProvider, LegacyI18nProvider } from './i18n' +import React, { useEffect } from 'react'; +import { addDecorator, addParameters } from '@storybook/react'; +import { useGlobals } from '@storybook/api'; +import { withKnobs } from '@storybook/addon-knobs'; +import { Provider } from 'react-redux'; +import configureStore from '../ui/app/store/store'; +import '../ui/app/css/index.scss'; +import localeList from '../app/_locales/index.json'; +import * as allLocales from './locales'; +import { I18nProvider, LegacyI18nProvider } from './i18n'; addParameters({ backgrounds: { default: 'light', values: [ - { name: 'light', value: '#FFFFFF'}, + { name: 'light', value: '#FFFFFF' }, { name: 'dark', value: '#333333' }, ], - } -}) + }, +}); export const globalTypes = { locale: { @@ -26,8 +27,8 @@ export const globalTypes = { toolbar: { icon: 'globe', items: localeList.map(({ code, name }) => { - return { value: code, right: code, title: name } - }) + return { value: code, right: code, title: name }; + }), }, }, }; @@ -37,15 +38,15 @@ const styles = { display: 'flex', justifyContent: 'center', alignItems: 'center', -} +}; const store = configureStore({ - metamask: { metamask: { } }, -}) + metamask: { metamask: {} }, +}); const metamaskDecorator = (story, context) => { - const currentLocale = context.globals.locale - const current = allLocales[currentLocale] + const currentLocale = context.globals.locale; + const current = allLocales[currentLocale]; return ( { en={allLocales.en} > -
- { story() } -
+
{story()}
- ) -} + ); +}; -addDecorator(withKnobs) -addDecorator(metamaskDecorator) +addDecorator(withKnobs); +addDecorator(metamaskDecorator); diff --git a/package.json b/package.json index 08dbb9fb9..6af974414 100644 --- a/package.json +++ b/package.json @@ -197,13 +197,13 @@ "@metamask/forwarder": "^1.1.0", "@metamask/test-dapp": "^4.0.1", "@sentry/cli": "^1.58.0", - "@storybook/addon-actions": "^6.1.9", - "@storybook/addon-backgrounds": "^6.1.9", - "@storybook/addon-knobs": "^6.1.9", + "@storybook/addon-actions": "^6.1.17", + "@storybook/addon-backgrounds": "^6.1.17", + "@storybook/addon-knobs": "^6.1.17", "@storybook/addon-toolbars": "^6.1.17", - "@storybook/core": "^6.1.9", - "@storybook/react": "^6.1.9", - "@storybook/storybook-deployer": "^2.8.6", + "@storybook/core": "^6.1.17", + "@storybook/react": "^6.1.17", + "@storybook/storybook-deployer": "^2.8.7", "@testing-library/react": "^10.4.8", "@testing-library/react-hooks": "^3.2.1", "@types/react": "^16.9.53", diff --git a/yarn.lock b/yarn.lock index efcfa3599..bd6390c83 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2243,7 +2243,7 @@ schema-utils "^2.6.5" source-map "^0.7.3" -"@popperjs/core@^2.4.0", "@popperjs/core@^2.4.4", "@popperjs/core@^2.5.4": +"@popperjs/core@^2.4.0", "@popperjs/core@^2.5.4": version "2.5.4" resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.5.4.tgz#de25b5da9f727985a3757fd59b5d028aba75841a" integrity sha512-ZpKr+WTb8zsajqgDkvCEWgp6d5eJT6Q63Ng2neTbzBO76Lbe91vX/iVIW9dikq+Fs3yEo+ls4cxeXABD2LtcbQ== @@ -2406,17 +2406,17 @@ resolved "https://registry.yarnpkg.com/@stablelib/utf8/-/utf8-0.10.1.tgz#eecf54884da7b2bee235e3c70efb8cd5c07ba5bd" integrity sha512-+uM1YZ4MhBC82vt99prF7DXNGqhYmJ9cQ3p5qNowMNkkzn9OWEkqBvguBW3ChAt7JvqZ3SD5HJOfc6YgnfMTHw== -"@storybook/addon-actions@^6.1.9": - version "6.1.9" - resolved "https://registry.yarnpkg.com/@storybook/addon-actions/-/addon-actions-6.1.9.tgz#b6d185b8e4e73691acc428b59e4d331195d64a40" - integrity sha512-vYqwuaBHrjRbbuyf4WBc5uDhrSejVEEiCabuu4g00R3dN7P5Ne/tbSw9EkYbbrRKxlEhdkk83DU1/J/+mCY5jw== - dependencies: - "@storybook/addons" "6.1.9" - "@storybook/api" "6.1.9" - "@storybook/client-api" "6.1.9" - "@storybook/components" "6.1.9" - "@storybook/core-events" "6.1.9" - "@storybook/theming" "6.1.9" +"@storybook/addon-actions@^6.1.17": + version "6.1.17" + resolved "https://registry.yarnpkg.com/@storybook/addon-actions/-/addon-actions-6.1.17.tgz#9d32336284738cefa69b99acafa4b132d5533600" + integrity sha512-4hyAvmjnI4C1ZQ7/t21jKKXE0jO1zAk310BkYin0NJf77Qi0tUE1DNOwirJY/xzRih36wWi1V79c/ZOJNsLv9Q== + dependencies: + "@storybook/addons" "6.1.17" + "@storybook/api" "6.1.17" + "@storybook/client-api" "6.1.17" + "@storybook/components" "6.1.17" + "@storybook/core-events" "6.1.17" + "@storybook/theming" "6.1.17" core-js "^3.0.1" fast-deep-equal "^3.1.1" global "^4.3.2" @@ -2429,17 +2429,17 @@ util-deprecate "^1.0.2" uuid "^8.0.0" -"@storybook/addon-backgrounds@^6.1.9": - version "6.1.9" - resolved "https://registry.yarnpkg.com/@storybook/addon-backgrounds/-/addon-backgrounds-6.1.9.tgz#4e9647001b2f396f56428218480f541e3a8a0e60" - integrity sha512-0/nnbnWZqo4NjyHFxcCHkcU+t8uUdk///9jSXRs4swmOLIFRaftEc/ZJ2rScu1Sc7y0CQdbk1Jjyx5/2cHBQtw== - dependencies: - "@storybook/addons" "6.1.9" - "@storybook/api" "6.1.9" - "@storybook/client-logger" "6.1.9" - "@storybook/components" "6.1.9" - "@storybook/core-events" "6.1.9" - "@storybook/theming" "6.1.9" +"@storybook/addon-backgrounds@^6.1.17": + version "6.1.17" + resolved "https://registry.yarnpkg.com/@storybook/addon-backgrounds/-/addon-backgrounds-6.1.17.tgz#df4eeec1df72d5f835e82bee433493110463f896" + integrity sha512-1a8Vu50eQWdwMek9w2QOehhu10aZYzyR404qwGvPCRGt5uMMsKxoKvv1M6/ETW7d2G4Srl/Ka+k4x6ykoHIepA== + dependencies: + "@storybook/addons" "6.1.17" + "@storybook/api" "6.1.17" + "@storybook/client-logger" "6.1.17" + "@storybook/components" "6.1.17" + "@storybook/core-events" "6.1.17" + "@storybook/theming" "6.1.17" core-js "^3.0.1" global "^4.3.2" memoizerific "^1.11.3" @@ -2447,18 +2447,18 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" -"@storybook/addon-knobs@^6.1.9": - version "6.1.9" - resolved "https://registry.yarnpkg.com/@storybook/addon-knobs/-/addon-knobs-6.1.9.tgz#49773931770effc208db094c61eeecbceaf5836b" - integrity sha512-aUKD9FaQGl/WOkGT6utElspYZJ7cBtUARe41JN59qOao7RNviabipQUASrjORcYUUU55sfKsLPEqQaEKB3x2bw== - dependencies: - "@storybook/addons" "6.1.9" - "@storybook/api" "6.1.9" - "@storybook/channels" "6.1.9" - "@storybook/client-api" "6.1.9" - "@storybook/components" "6.1.9" - "@storybook/core-events" "6.1.9" - "@storybook/theming" "6.1.9" +"@storybook/addon-knobs@^6.1.17": + version "6.1.17" + resolved "https://registry.yarnpkg.com/@storybook/addon-knobs/-/addon-knobs-6.1.17.tgz#c7cdd5be813c2b80ce7f464eabf8ceb06486e82d" + integrity sha512-WUkoGtHhXIurXFQybsMXZaphAtCNclZjZHvji8O5eg+ahx7pIM/Wldh3uJwOdOkW5LHxT76hLxPvuXvOEysnbw== + dependencies: + "@storybook/addons" "6.1.17" + "@storybook/api" "6.1.17" + "@storybook/channels" "6.1.17" + "@storybook/client-api" "6.1.17" + "@storybook/components" "6.1.17" + "@storybook/core-events" "6.1.17" + "@storybook/theming" "6.1.17" copy-to-clipboard "^3.0.8" core-js "^3.0.1" escape-html "^1.0.3" @@ -2498,21 +2498,6 @@ global "^4.3.2" regenerator-runtime "^0.13.7" -"@storybook/addons@6.1.9": - version "6.1.9" - resolved "https://registry.yarnpkg.com/@storybook/addons/-/addons-6.1.9.tgz#78f3cb27b7d934f091f311f89b6ca312d34f12b8" - integrity sha512-NRxdlGLmmSoVwlirVRgKC8xmW9cFkG+Sp5GEd4XkJDaaIg2vKR3RuFU9GuvIOVMxOhhERqhQ07bnDaAMKbFzGw== - dependencies: - "@storybook/api" "6.1.9" - "@storybook/channels" "6.1.9" - "@storybook/client-logger" "6.1.9" - "@storybook/core-events" "6.1.9" - "@storybook/router" "6.1.9" - "@storybook/theming" "6.1.9" - core-js "^3.0.1" - global "^4.3.2" - regenerator-runtime "^0.13.7" - "@storybook/api@6.1.17": version "6.1.17" resolved "https://registry.yarnpkg.com/@storybook/api/-/api-6.1.17.tgz#50393ce9b718063b67680212df895eceacc0c11d" @@ -2538,31 +2523,6 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" -"@storybook/api@6.1.9": - version "6.1.9" - resolved "https://registry.yarnpkg.com/@storybook/api/-/api-6.1.9.tgz#3f9bf00b2b18fa02965079fe775bd713677b30a3" - integrity sha512-S9SXlSiMeI450NIbOnx3UU9TZNyVD7jcBCjfNzhj0PqzRX/IG5Usj+R88Jm6MSIDjtsVjrWRCou+PrCh2xMnlQ== - dependencies: - "@reach/router" "^1.3.3" - "@storybook/channels" "6.1.9" - "@storybook/client-logger" "6.1.9" - "@storybook/core-events" "6.1.9" - "@storybook/csf" "0.0.1" - "@storybook/router" "6.1.9" - "@storybook/semver" "^7.3.2" - "@storybook/theming" "6.1.9" - "@types/reach__router" "^1.3.5" - core-js "^3.0.1" - fast-deep-equal "^3.1.1" - global "^4.3.2" - lodash "^4.17.15" - memoizerific "^1.11.3" - regenerator-runtime "^0.13.7" - store2 "^2.7.1" - telejson "^5.0.2" - ts-dedent "^2.0.0" - util-deprecate "^1.0.2" - "@storybook/channel-postmessage@6.1.17": version "6.1.17" resolved "https://registry.yarnpkg.com/@storybook/channel-postmessage/-/channel-postmessage-6.1.17.tgz#309ce67c94637ec13319d4ce360a8f3742ddbaf4" @@ -2576,19 +2536,6 @@ qs "^6.6.0" telejson "^5.0.2" -"@storybook/channel-postmessage@6.1.9": - version "6.1.9" - resolved "https://registry.yarnpkg.com/@storybook/channel-postmessage/-/channel-postmessage-6.1.9.tgz#5d73c67ba94bcf68b14138bba6c5bb0850c72c5e" - integrity sha512-tX7pD9Xrf1WsatpJqtJ6o8MlgxG7jH+oFhNPkGvUbWiolVDQmuDndwM8Hh1kUnOWlyE1AN5hlM7av8MY+9D3NA== - dependencies: - "@storybook/channels" "6.1.9" - "@storybook/client-logger" "6.1.9" - "@storybook/core-events" "6.1.9" - core-js "^3.0.1" - global "^4.3.2" - qs "^6.6.0" - telejson "^5.0.2" - "@storybook/channels@6.1.17": version "6.1.17" resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-6.1.17.tgz#2cc89a6b9727d19c24b15fa3cb15569b469db864" @@ -2598,15 +2545,6 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" -"@storybook/channels@6.1.9": - version "6.1.9" - resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-6.1.9.tgz#94f07ff3615b11c07d1902be6b6cd298c0eea55c" - integrity sha512-aV+KsZPuoTtFKSMUkSCyVlVmtVHkSH35dSbyMazjlUD9cOLwkXB1s+LZL/GxxSR6a6uR75V0QWxItfNxaJETMQ== - dependencies: - core-js "^3.0.1" - ts-dedent "^2.0.0" - util-deprecate "^1.0.2" - "@storybook/client-api@6.1.17": version "6.1.17" resolved "https://registry.yarnpkg.com/@storybook/client-api/-/client-api-6.1.17.tgz#3ced22f08a47af70ccf8929111bc44b79e9e8ec0" @@ -2631,30 +2569,6 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" -"@storybook/client-api@6.1.9": - version "6.1.9" - resolved "https://registry.yarnpkg.com/@storybook/client-api/-/client-api-6.1.9.tgz#d4a8d38bc657f26e4837831b961e085da1954d51" - integrity sha512-b2DFaGAS5G2ly3UJY5NJNXh/LxgLgSJLbqPL4t48MFW5XjH+rmEWXE9P+ujCaPclH1/y7mZRMprDj3ycDbRo3Q== - dependencies: - "@storybook/addons" "6.1.9" - "@storybook/channel-postmessage" "6.1.9" - "@storybook/channels" "6.1.9" - "@storybook/client-logger" "6.1.9" - "@storybook/core-events" "6.1.9" - "@storybook/csf" "0.0.1" - "@types/qs" "^6.9.0" - "@types/webpack-env" "^1.15.3" - core-js "^3.0.1" - global "^4.3.2" - lodash "^4.17.15" - memoizerific "^1.11.3" - qs "^6.6.0" - regenerator-runtime "^0.13.7" - stable "^0.1.8" - store2 "^2.7.1" - ts-dedent "^2.0.0" - util-deprecate "^1.0.2" - "@storybook/client-logger@6.1.17": version "6.1.17" resolved "https://registry.yarnpkg.com/@storybook/client-logger/-/client-logger-6.1.17.tgz#0d89aaf824457f19bf9aa585bbcada57595e7d01" @@ -2663,14 +2577,6 @@ core-js "^3.0.1" global "^4.3.2" -"@storybook/client-logger@6.1.9": - version "6.1.9" - resolved "https://registry.yarnpkg.com/@storybook/client-logger/-/client-logger-6.1.9.tgz#1d61a64000d4691780d75e19b78fd44adfdb5d9c" - integrity sha512-i7Q2ky9+Jwv+wmnlOGxmDOEdmaTIB69OQnnZNWGKufOwoIMjn6QO0VifARyA9W++nNSijjJ5th84tLJALaoCTA== - dependencies: - core-js "^3.0.1" - global "^4.3.2" - "@storybook/components@6.1.17": version "6.1.17" resolved "https://registry.yarnpkg.com/@storybook/components/-/components-6.1.17.tgz#f92d36e370ec6039d8c7cee9ef13dda866eed3da" @@ -2697,32 +2603,6 @@ react-textarea-autosize "^8.1.1" ts-dedent "^2.0.0" -"@storybook/components@6.1.9": - version "6.1.9" - resolved "https://registry.yarnpkg.com/@storybook/components/-/components-6.1.9.tgz#f25d18f3a410cc7e9549ddb3c971c40d9108d4d8" - integrity sha512-cYYm3fHo9MW0bbl47lu1ncwulV7V9VEF8FC96uvys07oaCTFWKzQ0z/FD0nCqeK6eEz1+SEqnGwLFmOtqlRXDQ== - dependencies: - "@popperjs/core" "^2.4.4" - "@storybook/client-logger" "6.1.9" - "@storybook/csf" "0.0.1" - "@storybook/theming" "6.1.9" - "@types/overlayscrollbars" "^1.9.0" - "@types/react-color" "^3.0.1" - "@types/react-syntax-highlighter" "11.0.4" - core-js "^3.0.1" - fast-deep-equal "^3.1.1" - global "^4.3.2" - lodash "^4.17.15" - markdown-to-jsx "^6.11.4" - memoizerific "^1.11.3" - overlayscrollbars "^1.10.2" - polished "^3.4.4" - react-color "^2.17.0" - react-popper-tooltip "^3.1.0" - react-syntax-highlighter "^13.5.0" - react-textarea-autosize "^8.1.1" - ts-dedent "^2.0.0" - "@storybook/core-events@6.1.17": version "6.1.17" resolved "https://registry.yarnpkg.com/@storybook/core-events/-/core-events-6.1.17.tgz#697ed916fcb2a411bc9f8bdbfacd0eb9d394eb58" @@ -2730,17 +2610,10 @@ dependencies: core-js "^3.0.1" -"@storybook/core-events@6.1.9": - version "6.1.9" - resolved "https://registry.yarnpkg.com/@storybook/core-events/-/core-events-6.1.9.tgz#0a88281837d1aa657a93a9abf7f5aad65b8d68e7" - integrity sha512-oOpqpjCTJCt0U5lnQ16OZU0iKIDh2/MIg4yrnDw+Pt6zGyX3zSvtB+9W8LQFnMwm+cXaNmiizGwt/W+4OiORjQ== - dependencies: - core-js "^3.0.1" - -"@storybook/core@6.1.9", "@storybook/core@^6.1.9": - version "6.1.9" - resolved "https://registry.yarnpkg.com/@storybook/core/-/core-6.1.9.tgz#e6575e294cb4d2d9b57d5976a145cae8f4a88594" - integrity sha512-guz+R6eDX923Cw7NqgS5PrpTmmjDB+m5X1iF9pwKlpPTfzIiT/wTzJm4PwhFoGONNoXrItObX/6hW6OQbX4aOA== +"@storybook/core@6.1.17", "@storybook/core@^6.1.17": + version "6.1.17" + resolved "https://registry.yarnpkg.com/@storybook/core/-/core-6.1.17.tgz#21c3d2c23fcaac4b930c9413f396d158aaeb7546" + integrity sha512-9x8ezlKlm8SQ+OW3kKwJwuVcaTDCw2OlA9YZEOo1kdRKsiiy5X14VqjJocl/BqnDt2VgzUUchz3m4neHYMAivQ== dependencies: "@babel/core" "^7.12.3" "@babel/plugin-proposal-class-properties" "^7.12.1" @@ -2764,20 +2637,20 @@ "@babel/preset-react" "^7.12.1" "@babel/preset-typescript" "^7.12.1" "@babel/register" "^7.12.1" - "@storybook/addons" "6.1.9" - "@storybook/api" "6.1.9" - "@storybook/channel-postmessage" "6.1.9" - "@storybook/channels" "6.1.9" - "@storybook/client-api" "6.1.9" - "@storybook/client-logger" "6.1.9" - "@storybook/components" "6.1.9" - "@storybook/core-events" "6.1.9" + "@storybook/addons" "6.1.17" + "@storybook/api" "6.1.17" + "@storybook/channel-postmessage" "6.1.17" + "@storybook/channels" "6.1.17" + "@storybook/client-api" "6.1.17" + "@storybook/client-logger" "6.1.17" + "@storybook/components" "6.1.17" + "@storybook/core-events" "6.1.17" "@storybook/csf" "0.0.1" - "@storybook/node-logger" "6.1.9" - "@storybook/router" "6.1.9" + "@storybook/node-logger" "6.1.17" + "@storybook/router" "6.1.17" "@storybook/semver" "^7.3.2" - "@storybook/theming" "6.1.9" - "@storybook/ui" "6.1.9" + "@storybook/theming" "6.1.17" + "@storybook/ui" "6.1.17" "@types/glob-base" "^0.3.0" "@types/micromatch" "^4.0.1" "@types/node-fetch" "^2.5.4" @@ -2851,10 +2724,10 @@ dependencies: lodash "^4.17.15" -"@storybook/node-logger@6.1.9": - version "6.1.9" - resolved "https://registry.yarnpkg.com/@storybook/node-logger/-/node-logger-6.1.9.tgz#c63a61f72209d76eeeffe9d151fec043864b9438" - integrity sha512-2gP9BSBXEOGIcUyzRdIkIJi1UEINUAIyuv9bfKODo4GfujRg7DLz/mpi/FdwmulGg/viXWSXa6ccb6ziIgY9RA== +"@storybook/node-logger@6.1.17": + version "6.1.17" + resolved "https://registry.yarnpkg.com/@storybook/node-logger/-/node-logger-6.1.17.tgz#468e65c9f0c103d4b0cd7f5da945af81e9aaa3d4" + integrity sha512-Z0xQ4kzvf7GnwFG9UY1HJO2UR66t8IBnC5GxvWrJ/kwXE+DRF3mm/MT41Zz/d9zAY5Vo4mhE5zRwlYSAtrxQIQ== dependencies: "@types/npmlog" "^4.1.2" chalk "^4.0.0" @@ -2862,17 +2735,17 @@ npmlog "^4.1.2" pretty-hrtime "^1.0.3" -"@storybook/react@^6.1.9": - version "6.1.9" - resolved "https://registry.yarnpkg.com/@storybook/react/-/react-6.1.9.tgz#063427015b3d0ce582b1b6b7826d40d963d265ce" - integrity sha512-HJWHQE+eCC7sz1vqvgmBMn2sA1uc0ByEj+NeSgyi45jBFI+Ke4a8hxx6k5XA7k9gLznqG8TPGg0z6EdQTJTLkQ== +"@storybook/react@^6.1.17": + version "6.1.17" + resolved "https://registry.yarnpkg.com/@storybook/react/-/react-6.1.17.tgz#cb48386d435984d7ca58a24e686a72159367077b" + integrity sha512-gBylKDuwUzWueB6mEhTo72SelWU3vPWHAFsi+NK6zWFIc2a5dJc9QqDfN+2rBhVOdRXqhSHzYwNWurqYpWuqew== dependencies: "@babel/preset-flow" "^7.12.1" "@babel/preset-react" "^7.12.1" "@pmmmwh/react-refresh-webpack-plugin" "^0.4.2" - "@storybook/addons" "6.1.9" - "@storybook/core" "6.1.9" - "@storybook/node-logger" "6.1.9" + "@storybook/addons" "6.1.17" + "@storybook/core" "6.1.17" + "@storybook/node-logger" "6.1.17" "@storybook/semver" "^7.3.2" "@types/webpack-env" "^1.15.3" babel-plugin-add-react-displayname "^0.0.5" @@ -2901,18 +2774,6 @@ memoizerific "^1.11.3" qs "^6.6.0" -"@storybook/router@6.1.9": - version "6.1.9" - resolved "https://registry.yarnpkg.com/@storybook/router/-/router-6.1.9.tgz#c0b24dc3ab53d58541b81c7abea2f11d7fbbebf6" - integrity sha512-kIlmSFBnqI198oMCncFZR7MxoV5/kP6KS0paFcyu1XE1zO2ovV6eQZ8pPpOjSsD/ISu4Y44uE+ZDNsEehjj6GQ== - dependencies: - "@reach/router" "^1.3.3" - "@types/reach__router" "^1.3.5" - core-js "^3.0.1" - global "^4.3.2" - memoizerific "^1.11.3" - qs "^6.6.0" - "@storybook/semver@^7.3.2": version "7.3.2" resolved "https://registry.yarnpkg.com/@storybook/semver/-/semver-7.3.2.tgz#f3b9c44a1c9a0b933c04e66d0048fcf2fa10dac0" @@ -2921,10 +2782,10 @@ core-js "^3.6.5" find-up "^4.1.0" -"@storybook/storybook-deployer@^2.8.6": - version "2.8.6" - resolved "https://registry.yarnpkg.com/@storybook/storybook-deployer/-/storybook-deployer-2.8.6.tgz#00c2e84f27dfaa88cb0785361453f23b1ebb4ea3" - integrity sha512-Bpe7ZtsR5NUuohK3VsQa+nxEHtVxMZZo3DRlRUZW5IZOmzmvSID3i+jkizloG9xO7sw5zUvlD31YMHm7OtdrMA== +"@storybook/storybook-deployer@^2.8.7": + version "2.8.7" + resolved "https://registry.yarnpkg.com/@storybook/storybook-deployer/-/storybook-deployer-2.8.7.tgz#c1eed33d03bd9267f884c60eea8e03dc3261ec11" + integrity sha512-O0hKHV6hg93fPMvKGC5M/sd7KTL473+SzMKm+WZNVEyLEfXXcVU+Ts9/VL1IhmC1P2A8Bg9oBnkcPqAqjAN46w== dependencies: git-url-parse "^11.1.2" glob "^7.1.3" @@ -2950,39 +2811,21 @@ resolve-from "^5.0.0" ts-dedent "^2.0.0" -"@storybook/theming@6.1.9": - version "6.1.9" - resolved "https://registry.yarnpkg.com/@storybook/theming/-/theming-6.1.9.tgz#8c584aa623f3d6e33b1e3b3de2ec1f41bdc5d9ab" - integrity sha512-orzMQkyEhAQEi0E9iwmUkzh5yPHoYGBz17t2aydDeT6oGKii6if8Mq2oPVycfVKZ84QO7GFAS9q1nVCRcuD8oA== - dependencies: - "@emotion/core" "^10.1.1" - "@emotion/is-prop-valid" "^0.8.6" - "@emotion/styled" "^10.0.23" - "@storybook/client-logger" "6.1.9" - core-js "^3.0.1" - deep-object-diff "^1.1.0" - emotion-theming "^10.0.19" - global "^4.3.2" - memoizerific "^1.11.3" - polished "^3.4.4" - resolve-from "^5.0.0" - ts-dedent "^2.0.0" - -"@storybook/ui@6.1.9": - version "6.1.9" - resolved "https://registry.yarnpkg.com/@storybook/ui/-/ui-6.1.9.tgz#1ed3168d9fe5827285c13d8507dd1fd872830542" - integrity sha512-4MK5iTf7kI5DYVeWRiD6lkXdd0S6eiQJu9lvWqMOQJLOH5Bq77g0Ejo+38RTEQpV6we7hCPWWnRXQBjmJ2+19w== +"@storybook/ui@6.1.17": + version "6.1.17" + resolved "https://registry.yarnpkg.com/@storybook/ui/-/ui-6.1.17.tgz#c29e7a03c645dd94793a3cbd587fcb6e0ba0f22e" + integrity sha512-D4Vri1MmqfmNq+g1hSRqZyld5zX2VLUexQHGSPmNj+FhlOzkeNA5RcoMBWMvIUSUENiBx3a5gmr/6cbXo7ljdQ== dependencies: "@emotion/core" "^10.1.1" - "@storybook/addons" "6.1.9" - "@storybook/api" "6.1.9" - "@storybook/channels" "6.1.9" - "@storybook/client-logger" "6.1.9" - "@storybook/components" "6.1.9" - "@storybook/core-events" "6.1.9" - "@storybook/router" "6.1.9" + "@storybook/addons" "6.1.17" + "@storybook/api" "6.1.17" + "@storybook/channels" "6.1.17" + "@storybook/client-logger" "6.1.17" + "@storybook/components" "6.1.17" + "@storybook/core-events" "6.1.17" + "@storybook/router" "6.1.17" "@storybook/semver" "^7.3.2" - "@storybook/theming" "6.1.9" + "@storybook/theming" "6.1.17" "@types/markdown-to-jsx" "^6.11.0" copy-to-clipboard "^3.0.8" core-js "^3.0.1" @@ -3145,11 +2988,6 @@ dependencies: "@types/unist" "*" -"@types/history@*": - version "4.7.3" - resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.3.tgz#856c99cdc1551d22c22b18b5402719affec9839a" - integrity sha512-cS5owqtwzLN5kY+l+KgKdRJ/Cee8tlmQoGQuIE9tWnSmS3JMKzmxo2HIAk2wODMifGwO20d62xZQLYz+RLfXmw== - "@types/html-minifier-terser@^5.0.0": version "5.1.1" resolved "https://registry.yarnpkg.com/@types/html-minifier-terser/-/html-minifier-terser-5.1.1.tgz#3c9ee980f1a10d6021ae6632ca3e79ca2ec4fb50" @@ -3304,14 +3142,6 @@ resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.5.tgz#434711bdd49eb5ee69d90c1d67c354a9a8ecb18b" integrity sha512-/JHkVHtx/REVG0VVToGRGH2+23hsYLHdyG+GrvoUGlGAd0ErauXDyvHtRI/7H7mzLm+tBCKA7pfcpkQ1lf58iQ== -"@types/reach__router@^1.3.5": - version "1.3.6" - resolved "https://registry.yarnpkg.com/@types/reach__router/-/reach__router-1.3.6.tgz#413417ce74caab331c70ce6a03a4c825188e4709" - integrity sha512-RHYataCUPQnt+GHoASyRLq6wmZ0n8jWlBW8Lxcwd30NN6vQfbmTeoSDfkgxO0S1lEzArp8OFDsq5KIs7FygjtA== - dependencies: - "@types/history" "*" - "@types/react" "*" - "@types/reach__router@^1.3.7": version "1.3.7" resolved "https://registry.yarnpkg.com/@types/reach__router/-/reach__router-1.3.7.tgz#de8ab374259ae7f7499fc1373b9697a5f3cd6428" @@ -21553,7 +21383,7 @@ react-motion@^0.5.2: prop-types "^15.5.8" raf "^3.1.0" -react-popper-tooltip@^3.1.0, react-popper-tooltip@^3.1.1: +react-popper-tooltip@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/react-popper-tooltip/-/react-popper-tooltip-3.1.1.tgz#329569eb7b287008f04fcbddb6370452ad3f9eac" integrity sha512-EnERAnnKRptQBJyaee5GJScWNUKQPDD2ywvzZyUjst/wj5U64C8/CnSYLNEmP2hG0IJ3ZhtDxE8oDN+KOyavXQ== From aadb8ac0ac42cd5bf5bd6afd526f93f831be9b72 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Mon, 8 Feb 2021 12:36:32 -0330 Subject: [PATCH 03/11] Fix `start:dev` script (#10399) The `start:dev` script relies upon `electron` and `sqlite`, both of which had their install scripts disabled by `allow-scripts`. Without those two packages, `start:dev` crashes immediately. The manifest has been updated to ensure install scripts run for both packages. `start:dev` now works. --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6af974414..4e3fc9343 100644 --- a/package.json +++ b/package.json @@ -308,6 +308,8 @@ "chromedriver": true, "geckodriver": true, "@sentry/cli": true, + "electron": true, + "sqlite3": true, "core-js": false, "core-js-pure": false, "keccak": false, @@ -316,10 +318,8 @@ "sha3": false, "bufferutil": false, "utf-8-validate": false, - "electron": false, "ejs": false, "sc-uws": false, - "sqlite3": false, "leveldown": false, "ursa-optional": false, "gc-stats": false, From b93046bdabc8e0107fc40d30b51b31095240798e Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Mon, 8 Feb 2021 12:36:58 -0330 Subject: [PATCH 04/11] Use string literals for transaction category localized messages (#10391) We now use string literals for all transaction category localized messages. This makes it easier to verify that we have translations for each of them, and that we aren't leaving any unused translations around. --- ui/app/helpers/utils/transactions.util.js | 42 +++++++++++++++++++ ui/app/hooks/useTransactionDisplayData.js | 11 ++++- .../confirm-transaction-base.component.js | 3 +- 3 files changed, 53 insertions(+), 3 deletions(-) diff --git a/ui/app/helpers/utils/transactions.util.js b/ui/app/helpers/utils/transactions.util.js index 61f2e1f8c..06a7a269e 100644 --- a/ui/app/helpers/utils/transactions.util.js +++ b/ui/app/helpers/utils/transactions.util.js @@ -205,3 +205,45 @@ export function getBlockExplorerUrlForTx(networkId, hash, rpcPrefs = {}) { const prefix = getEtherscanNetworkPrefix(networkId); return `https://${prefix}etherscan.io/tx/${hash}`; } + +/** + * Returns a title for the given transaction category. + * + * This will throw an error if the transaction category is unrecognized and no default is provided. + * @param {function} t - The translation function + * @param {TRANSACTION_CATEGORIES[keyof TRANSACTION_CATEGORIES]} transactionCategory - The transaction category constant + * @returns {string} The transaction category title + */ +export function getTransactionCategoryTitle(t, transactionCategory) { + switch (transactionCategory) { + case TRANSACTION_CATEGORIES.TOKEN_METHOD_TRANSFER: { + return t('transfer'); + } + case TRANSACTION_CATEGORIES.TOKEN_METHOD_TRANSFER_FROM: { + return t('transferfrom'); + } + case TRANSACTION_CATEGORIES.TOKEN_METHOD_APPROVE: { + return t('approve'); + } + case TRANSACTION_CATEGORIES.SENT_ETHER: { + return t('sentEther'); + } + case TRANSACTION_CATEGORIES.CONTRACT_INTERACTION: { + return t('contractInteraction'); + } + case TRANSACTION_CATEGORIES.DEPLOY_CONTRACT: { + return t('contractDeployment'); + } + case TRANSACTION_CATEGORIES.SWAP: { + return t('swap'); + } + case TRANSACTION_CATEGORIES.SWAP_APPROVAL: { + return t('swapApproval'); + } + default: { + throw new Error( + `Unrecognized transaction category: ${transactionCategory}`, + ); + } + } +} diff --git a/ui/app/hooks/useTransactionDisplayData.js b/ui/app/hooks/useTransactionDisplayData.js index ff0b7b6c9..18b0e7c39 100644 --- a/ui/app/hooks/useTransactionDisplayData.js +++ b/ui/app/hooks/useTransactionDisplayData.js @@ -1,6 +1,9 @@ import { useSelector } from 'react-redux'; import { getKnownMethodData } from '../selectors/selectors'; -import { getStatusKey } from '../helpers/utils/transactions.util'; +import { + getStatusKey, + getTransactionCategoryTitle, +} from '../helpers/utils/transactions.util'; import { camelCaseToCapitalize } from '../helpers/utils/common.util'; import { PRIMARY, SECONDARY } from '../helpers/constants/common'; import { getTokenAddressParam } from '../helpers/utils/token-util'; @@ -186,9 +189,13 @@ export function useTransactionDisplayData(transactionGroup) { transactionCategory === TRANSACTION_CATEGORIES.CONTRACT_INTERACTION ) { category = TRANSACTION_GROUP_CATEGORIES.INTERACTION; + const transactionCategoryTitle = getTransactionCategoryTitle( + t, + transactionCategory, + ); title = (methodData?.name && camelCaseToCapitalize(methodData.name)) || - t(transactionCategory); + transactionCategoryTitle; subtitle = origin; subtitleContainsOrigin = true; } else if (transactionCategory === TRANSACTION_CATEGORIES.INCOMING) { diff --git a/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js b/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js index 5d09b3198..d1b702df9 100644 --- a/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js +++ b/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js @@ -22,6 +22,7 @@ import { TRANSACTION_CATEGORIES, TRANSACTION_STATUSES, } from '../../../../shared/constants/transaction'; +import { getTransactionCategoryTitle } from '../../helpers/utils/transactions.util'; export default class ConfirmTransactionBase extends Component { static contextTypes = { @@ -690,7 +691,7 @@ export default class ConfirmTransactionBase extends Component { let functionType = getMethodName(name); if (!functionType) { if (transactionCategory) { - functionType = t(transactionCategory) || transactionCategory; + functionType = getTransactionCategoryTitle(t, transactionCategory); } else { functionType = t('contractInteraction'); } From 85cf35b2d1522e08994174a00dc8158b2baf1cf1 Mon Sep 17 00:00:00 2001 From: kumavis Date: Tue, 9 Feb 2021 00:49:49 +0800 Subject: [PATCH 05/11] Storybook: Signature Request (#10400) * storybook - add signature request storybook entry * storybook + improve test data + lint * styles - apply flex and align center to --network --- .storybook/preview.js | 5 +- .storybook/test-data.js | 218 ++++++++++++++++++ .../signature-request-header/index.scss | 5 +- .../signature-request.stories.js | 37 +++ 4 files changed, 259 insertions(+), 6 deletions(-) create mode 100644 .storybook/test-data.js create mode 100644 ui/app/components/app/signature-request/signature-request.stories.js diff --git a/.storybook/preview.js b/.storybook/preview.js index e8c6a3b1b..112c8f16e 100644 --- a/.storybook/preview.js +++ b/.storybook/preview.js @@ -8,6 +8,7 @@ import '../ui/app/css/index.scss'; import localeList from '../app/_locales/index.json'; import * as allLocales from './locales'; import { I18nProvider, LegacyI18nProvider } from './i18n'; +import testData from './test-data.js' addParameters({ backgrounds: { @@ -40,9 +41,7 @@ const styles = { alignItems: 'center', }; -const store = configureStore({ - metamask: { metamask: {} }, -}); +const store = configureStore(testData) const metamaskDecorator = (story, context) => { const currentLocale = context.globals.locale; diff --git a/.storybook/test-data.js b/.storybook/test-data.js new file mode 100644 index 000000000..99295cab0 --- /dev/null +++ b/.storybook/test-data.js @@ -0,0 +1,218 @@ +import { TRANSACTION_STATUSES } from '../shared/constants/transaction'; + +const state = { + metamask: { + isInitialized: true, + isUnlocked: true, + featureFlags: { sendHexData: true }, + rpcUrl: 'https://rawtestrpc.metamask.io/', + identities: { + '0xfdea65c8e26263f6d9a1b5de9555d2931a33b825': { + address: '0xfdea65c8e26263f6d9a1b5de9555d2931a33b825', + name: 'Send Account 1', + }, + '0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb': { + address: '0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb', + name: 'Send Account 2', + }, + '0x2f8d4a878cfa04a6e60d46362f5644deab66572d': { + address: '0x2f8d4a878cfa04a6e60d46362f5644deab66572d', + name: 'Send Account 3', + }, + '0xd85a4b6a394794842887b8284293d69163007bbb': { + address: '0xd85a4b6a394794842887b8284293d69163007bbb', + name: 'Send Account 4', + }, + }, + cachedBalances: {}, + currentBlockGasLimit: '0x4c1878', + currentCurrency: 'USD', + conversionRate: 1200.88200327, + conversionDate: 1489013762, + nativeCurrency: 'ETH', + frequentRpcList: [], + network: '3', + provider: { + type: 'ropsten', + chainId: '0x3', + }, + accounts: { + '0xfdea65c8e26263f6d9a1b5de9555d2931a33b825': { + code: '0x', + balance: '0x47c9d71831c76efe', + nonce: '0x1b', + address: '0xfdea65c8e26263f6d9a1b5de9555d2931a33b825', + }, + '0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb': { + code: '0x', + balance: '0x37452b1315889f80', + nonce: '0xa', + address: '0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb', + }, + '0x2f8d4a878cfa04a6e60d46362f5644deab66572d': { + code: '0x', + balance: '0x30c9d71831c76efe', + nonce: '0x1c', + address: '0x2f8d4a878cfa04a6e60d46362f5644deab66572d', + }, + '0xd85a4b6a394794842887b8284293d69163007bbb': { + code: '0x', + balance: '0x0', + nonce: '0x0', + address: '0xd85a4b6a394794842887b8284293d69163007bbb', + }, + }, + addressBook: { + '0x3': { + '0x06195827297c7a80a443b6894d3bdb8824b43896': { + address: '0x06195827297c7a80a443b6894d3bdb8824b43896', + name: 'Address Book Account 1', + chainId: '0x3', + }, + }, + }, + tokens: [ + { + address: '0x1a195821297c7a80a433b6894d3bdb8824b43896', + decimals: 18, + symbol: 'ABC', + }, + { + address: '0x8d6b81208414189a58339873ab429b6c47ab92d3', + decimals: 4, + symbol: 'DEF', + }, + { + address: '0xa42084c8d1d9a2198631988579bb36b48433a72b', + decimals: 18, + symbol: 'GHI', + }, + ], + transactions: {}, + currentNetworkTxList: [ + { + id: 'mockTokenTx1', + txParams: { + to: '0x8d6b81208414189a58339873ab429b6c47ab92d3', + from: '0xd85a4b6a394794842887b8284293d69163007bbb', + }, + time: 1700000000000, + }, + { + id: 'mockTokenTx2', + txParams: { + to: '0xafaketokenaddress', + from: '0xd85a4b6a394794842887b8284293d69163007bbb', + }, + time: 1600000000000, + }, + { + id: 'mockTokenTx3', + txParams: { + to: '0x8d6b81208414189a58339873ab429b6c47ab92d3', + from: '0xd85a4b6a394794842887b8284293d69163007bbb', + }, + time: 1500000000000, + }, + { + id: 'mockEthTx1', + txParams: { + to: '0xd85a4b6a394794842887b8284293d69163007bbb', + from: '0xd85a4b6a394794842887b8284293d69163007bbb', + }, + time: 1400000000000, + }, + ], + unapprovedMsgs: { + '0xabc': { id: 'unapprovedMessage1', time: 1650000000000 }, + '0xdef': { id: 'unapprovedMessage2', time: 1550000000000 }, + '0xghi': { id: 'unapprovedMessage3', time: 1450000000000 }, + }, + unapprovedMsgCount: 0, + unapprovedPersonalMsgs: {}, + unapprovedPersonalMsgCount: 0, + unapprovedDecryptMsgs: {}, + unapprovedDecryptMsgCount: 0, + unapprovedEncryptionPublicKeyMsgs: {}, + unapprovedEncryptionPublicKeyMsgCount: 0, + keyringTypes: ['Simple Key Pair', 'HD Key Tree'], + keyrings: [ + { + type: 'HD Key Tree', + accounts: [ + 'fdea65c8e26263f6d9a1b5de9555d2931a33b825', + 'c5b8dbac4c1d3f152cdeb400e2313f309c410acb', + '2f8d4a878cfa04a6e60d46362f5644deab66572d', + ], + }, + { + type: 'Simple Key Pair', + accounts: ['0xd85a4b6a394794842887b8284293d69163007bbb'], + }, + ], + selectedAddress: '0xd85a4b6a394794842887b8284293d69163007bbb', + send: { + gasLimit: '0xFFFF', + gasPrice: '0xaa', + gasTotal: '0xb451dc41b578', + tokenBalance: 3434, + from: '0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb', + to: '0x987fedabc', + amount: '0x080', + memo: '', + errors: { + someError: null, + }, + maxModeOn: false, + editingTransactionId: 97531, + }, + unapprovedTxs: { + 4768706228115573: { + id: 4768706228115573, + time: 1487363153561, + status: TRANSACTION_STATUSES.UNAPPROVED, + gasMultiplier: 1, + metamaskNetworkId: '3', + txParams: { + from: '0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb', + to: '0x18a3462427bcc9133bb46e88bcbe39cd7ef0e761', + value: '0xde0b6b3a7640000', + metamaskId: 4768706228115573, + metamaskNetworkId: '3', + gas: '0x5209', + }, + txFee: '17e0186e60800', + txValue: 'de0b6b3a7640000', + maxCost: 'de234b52e4a0800', + gasPrice: '4a817c800', + }, + }, + currentLocale: 'en', + }, + appState: { + menuOpen: false, + currentView: { + name: 'accountDetail', + detailView: null, + context: '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc', + }, + accountDetail: { + subview: 'transactions', + }, + modal: { + modalState: {}, + previousModalState: {}, + }, + isLoading: false, + warning: null, + scrollToBottom: false, + forgottenPassword: null, + }, + send: { + fromDropdownOpen: false, + toDropdownOpen: false, + errors: { someError: null }, + }, +}; + +export default state; diff --git a/ui/app/components/app/signature-request/signature-request-header/index.scss b/ui/app/components/app/signature-request/signature-request-header/index.scss index b4f3b5479..beaa5a92c 100644 --- a/ui/app/components/app/signature-request/signature-request-header/index.scss +++ b/ui/app/components/app/signature-request/signature-request-header/index.scss @@ -9,12 +9,11 @@ &--account, &--network { flex: 1; - } - - &--account { display: flex; align-items: center; + } + &--account { .account-list-item { &__top-row { display: flex; diff --git a/ui/app/components/app/signature-request/signature-request.stories.js b/ui/app/components/app/signature-request/signature-request.stories.js new file mode 100644 index 000000000..fd121cc86 --- /dev/null +++ b/ui/app/components/app/signature-request/signature-request.stories.js @@ -0,0 +1,37 @@ +import React from 'react'; +import testData from '../../../../../.storybook/test-data'; +import SignatureRequest from './signature-request.component'; + +const primaryIdentity = Object.values(testData.metamask.identities)[0]; + +const containerStyle = { + width: '357px', +}; + +export default { + title: 'Signature Request', +}; + +export const FirstLook = () => { + return ( +
+ +
+ ); +}; From 88f12338525517c576764c2c2107e99b5cfc949a Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Mon, 8 Feb 2021 14:00:27 -0330 Subject: [PATCH 06/11] Fix `transferFrom` localized message (#10395) The `transferFrom` localized message has been unused at least since the transaction list redesign was implemented. The `transactionCategory` has been used directly as the localized message key since then. For most of the other categories this was fine, but for `transferFrom` the message differs slightly from the category (the category is `transferfrom`, with a lower-cased 'f'). --- ui/app/helpers/utils/transactions.util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/helpers/utils/transactions.util.js b/ui/app/helpers/utils/transactions.util.js index 06a7a269e..463ddab5e 100644 --- a/ui/app/helpers/utils/transactions.util.js +++ b/ui/app/helpers/utils/transactions.util.js @@ -220,7 +220,7 @@ export function getTransactionCategoryTitle(t, transactionCategory) { return t('transfer'); } case TRANSACTION_CATEGORIES.TOKEN_METHOD_TRANSFER_FROM: { - return t('transferfrom'); + return t('transferFrom'); } case TRANSACTION_CATEGORIES.TOKEN_METHOD_APPROVE: { return t('approve'); From 22f3e79bd86fe0554d79caeaf53bce5c60eaebbc Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Mon, 8 Feb 2021 17:50:04 -0330 Subject: [PATCH 07/11] Update `eth-sig-util` and `ethashjs` lockfile versions (#10383) The packages `eth-sig-util` and `ethashjs` have been updated to their latest in-range versions in the lockfile. This removes the last instance of `ethereumjs-abi@0.6.5` from our dependency tree, as well as the last non-optional instance of `sha3` (it's still present as a transitive dependency of an optional development dependency via `ganache`) --- yarn.lock | 91 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 47 insertions(+), 44 deletions(-) diff --git a/yarn.lock b/yarn.lock index bd6390c83..d57a079e9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5869,12 +5869,12 @@ bn.js@^1.0.0: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-1.3.0.tgz#0db4cbf96f8f23b742f5bcb9d1aa7a9994a05e83" integrity sha1-DbTL+W+PI7dC9by50ap6mZSgXoM= -bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.10.0, bn.js@^4.11.0, bn.js@^4.11.1, bn.js@^4.11.6, bn.js@^4.11.7, bn.js@^4.11.8, bn.js@^4.11.9, bn.js@^4.4.0, bn.js@^4.8.0: +bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.11.0, bn.js@^4.11.1, bn.js@^4.11.6, bn.js@^4.11.7, bn.js@^4.11.8, bn.js@^4.11.9, bn.js@^4.4.0, bn.js@^4.8.0: version "4.11.9" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.9.tgz#26d556829458f9d1e81fc48952493d0ba3507828" integrity sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw== -bn.js@^5.1.1: +bn.js@^5.1.1, bn.js@^5.1.2: version "5.1.3" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.1.3.tgz#beca005408f642ebebea80b042b4d18d2ac0ee6b" integrity sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ== @@ -6348,6 +6348,13 @@ buffer-xor@^1.0.3: resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= +buffer-xor@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-2.0.2.tgz#34f7c64f04c777a1f8aac5e661273bb9dd320289" + integrity sha512-eHslX0bin3GB+Lx2p7lEYRShRewuNZL3fUl4qlVJGGiwoPGftmt8JQgk2Y9Ji5/01TnVDo33E5b5O3vUB1HdqQ== + dependencies: + safe-buffer "^5.1.1" + buffer@^4.3.0: version "4.9.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.1.tgz#6d1bb601b07a4efced97094132093027c95bc298" @@ -10091,27 +10098,23 @@ eth-sig-util@^1.4.0, eth-sig-util@^1.4.2: ethereumjs-util "^5.1.1" eth-sig-util@^2.0.0, eth-sig-util@^2.4.4, eth-sig-util@^2.5.0: - version "2.5.3" - resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-2.5.3.tgz#6938308b38226e0b3085435474900b03036abcbe" - integrity sha512-KpXbCKmmBUNUTGh9MRKmNkIPietfhzBqqYqysDavLseIiMUGl95k6UcPEkALAZlj41e9E6yioYXc1PC333RKqw== + version "2.5.4" + resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-2.5.4.tgz#577b01fe491b6bf59b0464be09633e20c1677bc5" + integrity sha512-aCMBwp8q/4wrW4QLsF/HYBOSA7TpLKmkVwP3pYQNkEEseW2Rr8Z5Uxc9/h6HX+OG3tuHo+2bINVSihIeBfym6A== dependencies: - buffer "^5.2.1" - elliptic "^6.4.0" - ethereumjs-abi "0.6.5" + ethereumjs-abi "0.6.8" ethereumjs-util "^5.1.1" - tweetnacl "^1.0.0" + tweetnacl "^1.0.3" tweetnacl-util "^0.15.0" eth-sig-util@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-3.0.0.tgz#75133b3d7c20a5731af0690c385e184ab942b97e" - integrity sha512-4eFkMOhpGbTxBQ3AMzVf0haUX2uTur7DpWiHzWyTURa28BVJJtOkcb9Ok5TV0YvEPG61DODPW7ZUATbJTslioQ== + version "3.0.1" + resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-3.0.1.tgz#8753297c83a3f58346bd13547b59c4b2cd110c96" + integrity sha512-0Us50HiGGvZgjtWTyAI/+qTzYPMLy5Q451D0Xy68bxq1QMWdoOddDwGvsqcFT27uohKgalM9z/yxplyt+mY2iQ== dependencies: - buffer "^5.2.1" - elliptic "^6.4.0" - ethereumjs-abi "0.6.5" + ethereumjs-abi "^0.6.8" ethereumjs-util "^5.1.1" - tweetnacl "^1.0.0" + tweetnacl "^1.0.3" tweetnacl-util "^0.15.0" eth-simple-keyring@^3.5.0: @@ -10154,13 +10157,13 @@ eth-tx-summary@^3.1.2: through2 "^2.0.3" ethashjs@~0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/ethashjs/-/ethashjs-0.0.7.tgz#30bfe4196726690a0c59d3b8272e70d4d0c34bae" - integrity sha1-ML/kGWcmaQoMWdO4Jy5w1NDDS64= + version "0.0.8" + resolved "https://registry.yarnpkg.com/ethashjs/-/ethashjs-0.0.8.tgz#227442f1bdee409a548fb04136e24c874f3aa6f9" + integrity sha512-/MSbf/r2/Ld8o0l15AymjOTlPqpN8Cr4ByUEA9GtR4x0yAh3TdtDzEg29zMjXCNPI7u6E5fOQdj/Cf9Tc7oVNw== dependencies: - async "^1.4.2" - buffer-xor "^1.0.3" - ethereumjs-util "^4.0.1" + async "^2.1.2" + buffer-xor "^2.0.1" + ethereumjs-util "^7.0.2" miller-rabin "^4.0.0" ethereum-bloom-filters@^1.0.6: @@ -10206,15 +10209,7 @@ ethereum-ens-network-map@^1.0.0, ethereum-ens-network-map@^1.0.2: resolved "https://registry.yarnpkg.com/ethereum-ens-network-map/-/ethereum-ens-network-map-1.0.2.tgz#4e27bad18dae7bd95d84edbcac2c9e739fc959b9" integrity sha512-5qwJ5n3YhjSpE6O/WEBXCAb2nagUgyagJ6C0lGUBWC4LjKp/rRzD+pwtDJ6KCiITFEAoX4eIrWOjRy0Sylq5Hg== -ethereumjs-abi@0.6.5: - version "0.6.5" - resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.5.tgz#5a637ef16ab43473fa72a29ad90871405b3f5241" - integrity sha1-WmN+8Wq0NHP6cqKa2QhxQFs/UkE= - dependencies: - bn.js "^4.10.0" - ethereumjs-util "^4.3.0" - -ethereumjs-abi@0.6.8, ethereumjs-abi@^0.6.4, ethereumjs-abi@^0.6.5: +ethereumjs-abi@0.6.8, ethereumjs-abi@^0.6.4, ethereumjs-abi@^0.6.5, ethereumjs-abi@^0.6.8: version "0.6.8" resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz#71bc152db099f70e62f108b7cdfca1b362c6fcae" integrity sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA== @@ -10335,17 +10330,6 @@ ethereumjs-util@6.2.1, ethereumjs-util@^6.0.0, ethereumjs-util@^6.1.0, ethereumj ethjs-util "0.1.6" rlp "^2.2.3" -ethereumjs-util@^4.0.1, ethereumjs-util@^4.3.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-4.5.0.tgz#3e9428b317eebda3d7260d854fddda954b1f1bc6" - integrity sha1-PpQosxfuvaPXJg2FT93alUsfG8Y= - dependencies: - bn.js "^4.8.0" - create-hash "^1.1.2" - keccakjs "^0.2.0" - rlp "^2.0.0" - secp256k1 "^3.0.1" - ethereumjs-util@^5.0.0, ethereumjs-util@^5.0.1, ethereumjs-util@^5.1.1, ethereumjs-util@^5.1.2, ethereumjs-util@^5.1.3, ethereumjs-util@^5.1.5, ethereumjs-util@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz#3e0c0d1741471acf1036052d048623dee54ad642" @@ -10359,6 +10343,18 @@ ethereumjs-util@^5.0.0, ethereumjs-util@^5.0.1, ethereumjs-util@^5.1.1, ethereum safe-buffer "^5.1.1" secp256k1 "^3.0.1" +ethereumjs-util@^7.0.2: + version "7.0.8" + resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.0.8.tgz#5258762b7b17e3d828e41834948363ff0a703ffd" + integrity sha512-JJt7tDpCAmDPw/sGoFYeq0guOVqT3pTE9xlEbBmc/nlCij3JRCoS2c96SQ6kXVHOT3xWUNLDm5QCJLQaUnVAtQ== + dependencies: + "@types/bn.js" "^4.11.3" + bn.js "^5.1.2" + create-hash "^1.1.2" + ethereum-cryptography "^0.1.3" + ethjs-util "0.1.6" + rlp "^2.2.4" + ethereumjs-util@~6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz#e9c51e5549e8ebd757a339cc00f5380507e799c8" @@ -15753,7 +15749,7 @@ keccak@^1.0.2: nan "^2.2.1" safe-buffer "^5.1.0" -keccakjs@^0.2.0, keccakjs@^0.2.1: +keccakjs@^0.2.1: version "0.2.3" resolved "https://registry.yarnpkg.com/keccakjs/-/keccakjs-0.2.3.tgz#5e4e969ce39689a3861f445d7752ee3477f9fe72" integrity sha512-BjLkNDcfaZ6l8HBG9tH0tpmDv3sS2mA7FNQxFHpCdzP3Gb2MVruXBSuoM66SnVxKJpAr5dKGdkHD+bDokt8fTg== @@ -22589,6 +22585,13 @@ rlp@^2.0.0, rlp@^2.2.1, rlp@^2.2.2, rlp@^2.2.3: dependencies: bn.js "^4.11.1" +rlp@^2.2.4: + version "2.2.6" + resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.6.tgz#c80ba6266ac7a483ef1e69e8e2f056656de2fb2c" + integrity sha512-HAfAmL6SDYNWPUOJNrM500x4Thn4PZsEy5pijPh40U9WfNk0z15hUYzO9xVIMAdIHdFtD8CBDHd75Td1g36Mjg== + dependencies: + bn.js "^4.11.1" + rn-host-detect@^1.1.5: version "1.2.0" resolved "https://registry.yarnpkg.com/rn-host-detect/-/rn-host-detect-1.2.0.tgz#8b0396fc05631ec60c1cb8789e5070cdb04d0da0" @@ -25256,7 +25259,7 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0: resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= -tweetnacl@^1.0.0, tweetnacl@^1.0.1: +tweetnacl@^1.0.0, tweetnacl@^1.0.1, tweetnacl@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== From 6677bd9ccedda916032d611eacaa5b87f3026ce1 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Mon, 8 Feb 2021 17:50:21 -0330 Subject: [PATCH 08/11] Remove unused `confirmTransaction` state (#10396) The `confirmTransaction` Redux slice had a lot of unused state and action creators. They have all been removed. --- ...gas-modal-page-container-container.test.js | 5 - .../confirm-transaction.duck.js | 127 --------- .../confirm-transaction.duck.test.js | 262 +----------------- 3 files changed, 1 insertion(+), 393 deletions(-) diff --git a/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-container.test.js b/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-container.test.js index ac355d656..8dc7c86ab 100644 --- a/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-container.test.js +++ b/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-container.test.js @@ -19,10 +19,6 @@ const gasActionSpies = { resetCustomData: sinon.spy(), }; -const confirmTransactionActionSpies = { - updateGasAndCalculate: sinon.spy(), -}; - const sendActionSpies = { hideGasButtonGroup: sinon.spy(), }; @@ -48,7 +44,6 @@ proxyquire('../gas-modal-page-container.container.js', { }, '../../../../store/actions': actionSpies, '../../../../ducks/gas/gas.duck': gasActionSpies, - '../../../../ducks/confirm-transaction/confirm-transaction.duck': confirmTransactionActionSpies, '../../../../ducks/send/send.duck': sendActionSpies, }); diff --git a/ui/app/ducks/confirm-transaction/confirm-transaction.duck.js b/ui/app/ducks/confirm-transaction/confirm-transaction.duck.js index a89eeae36..a59785c7a 100644 --- a/ui/app/ducks/confirm-transaction/confirm-transaction.duck.js +++ b/ui/app/ducks/confirm-transaction/confirm-transaction.duck.js @@ -1,4 +1,3 @@ -import { addHexPrefix } from '../../../../app/scripts/lib/util'; import { conversionRateSelector, currentCurrencySelector, @@ -24,32 +23,19 @@ import { conversionUtil } from '../../helpers/utils/conversion-util'; const createActionType = (action) => `metamask/confirm-transaction/${action}`; const UPDATE_TX_DATA = createActionType('UPDATE_TX_DATA'); -const CLEAR_TX_DATA = createActionType('CLEAR_TX_DATA'); const UPDATE_TOKEN_DATA = createActionType('UPDATE_TOKEN_DATA'); -const CLEAR_TOKEN_DATA = createActionType('CLEAR_TOKEN_DATA'); -const UPDATE_METHOD_DATA = createActionType('UPDATE_METHOD_DATA'); -const CLEAR_METHOD_DATA = createActionType('CLEAR_METHOD_DATA'); const CLEAR_CONFIRM_TRANSACTION = createActionType('CLEAR_CONFIRM_TRANSACTION'); const UPDATE_TRANSACTION_AMOUNTS = createActionType( 'UPDATE_TRANSACTION_AMOUNTS', ); const UPDATE_TRANSACTION_FEES = createActionType('UPDATE_TRANSACTION_FEES'); const UPDATE_TRANSACTION_TOTALS = createActionType('UPDATE_TRANSACTION_TOTALS'); -const UPDATE_TOKEN_PROPS = createActionType('UPDATE_TOKEN_PROPS'); const UPDATE_NONCE = createActionType('UPDATE_NONCE'); -const UPDATE_TO_SMART_CONTRACT = createActionType('UPDATE_TO_SMART_CONTRACT'); -const FETCH_DATA_START = createActionType('FETCH_DATA_START'); -const FETCH_DATA_END = createActionType('FETCH_DATA_END'); // Initial state const initState = { txData: {}, tokenData: {}, - methodData: {}, - tokenProps: { - tokenDecimals: '', - tokenSymbol: '', - }, fiatTransactionAmount: '', fiatTransactionFee: '', fiatTransactionTotal: '', @@ -60,8 +46,6 @@ const initState = { hexTransactionFee: '', hexTransactionTotal: '', nonce: '', - toSmartContract: false, - fetchingData: false, }; // Reducer @@ -74,11 +58,6 @@ export default function reducer(state = initState, action = {}) { ...action.payload, }, }; - case CLEAR_TX_DATA: - return { - ...state, - txData: {}, - }; case UPDATE_TOKEN_DATA: return { ...state, @@ -86,23 +65,6 @@ export default function reducer(state = initState, action = {}) { ...action.payload, }, }; - case CLEAR_TOKEN_DATA: - return { - ...state, - tokenData: {}, - }; - case UPDATE_METHOD_DATA: - return { - ...state, - methodData: { - ...action.payload, - }, - }; - case CLEAR_METHOD_DATA: - return { - ...state, - methodData: {}, - }; case UPDATE_TRANSACTION_AMOUNTS: { const { fiatTransactionAmount, @@ -146,37 +108,11 @@ export default function reducer(state = initState, action = {}) { hexTransactionTotal: hexTransactionTotal || state.hexTransactionTotal, }; } - case UPDATE_TOKEN_PROPS: { - const { tokenSymbol = '', tokenDecimals = '' } = action.payload; - return { - ...state, - tokenProps: { - ...state.tokenProps, - tokenSymbol, - tokenDecimals, - }, - }; - } case UPDATE_NONCE: return { ...state, nonce: action.payload, }; - case UPDATE_TO_SMART_CONTRACT: - return { - ...state, - toSmartContract: action.payload, - }; - case FETCH_DATA_START: - return { - ...state, - fetchingData: true, - }; - case FETCH_DATA_END: - return { - ...state, - fetchingData: false, - }; case CLEAR_CONFIRM_TRANSACTION: return initState; default: @@ -192,12 +128,6 @@ export function updateTxData(txData) { }; } -export function clearTxData() { - return { - type: CLEAR_TX_DATA, - }; -} - export function updateTokenData(tokenData) { return { type: UPDATE_TOKEN_DATA, @@ -205,25 +135,6 @@ export function updateTokenData(tokenData) { }; } -export function clearTokenData() { - return { - type: CLEAR_TOKEN_DATA, - }; -} - -export function updateMethodData(methodData) { - return { - type: UPDATE_METHOD_DATA, - payload: methodData, - }; -} - -export function clearMethodData() { - return { - type: CLEAR_METHOD_DATA, - }; -} - export function updateTransactionAmounts(amounts) { return { type: UPDATE_TRANSACTION_AMOUNTS, @@ -245,13 +156,6 @@ export function updateTransactionTotals(totals) { }; } -export function updateTokenProps(tokenProps) { - return { - type: UPDATE_TOKEN_PROPS, - payload: tokenProps, - }; -} - export function updateNonce(nonce) { return { type: UPDATE_NONCE, @@ -259,37 +163,6 @@ export function updateNonce(nonce) { }; } -export function updateToSmartContract(toSmartContract) { - return { - type: UPDATE_TO_SMART_CONTRACT, - payload: toSmartContract, - }; -} - -export function setFetchingData(isFetching) { - return { - type: isFetching ? FETCH_DATA_START : FETCH_DATA_END, - }; -} - -export function updateGasAndCalculate({ gasLimit, gasPrice }) { - return (dispatch, getState) => { - const { - confirmTransaction: { txData }, - } = getState(); - const newTxData = { - ...txData, - txParams: { - ...txData.txParams, - gas: addHexPrefix(gasLimit), - gasPrice: addHexPrefix(gasPrice), - }, - }; - - dispatch(updateTxDataAndCalculate(newTxData)); - }; -} - function increaseFromLastGasPrice(txData) { const { lastGasPrice, diff --git a/ui/app/ducks/confirm-transaction/confirm-transaction.duck.test.js b/ui/app/ducks/confirm-transaction/confirm-transaction.duck.test.js index 6f512a703..e67faa52d 100644 --- a/ui/app/ducks/confirm-transaction/confirm-transaction.duck.test.js +++ b/ui/app/ducks/confirm-transaction/confirm-transaction.duck.test.js @@ -2,21 +2,13 @@ import assert from 'assert'; import configureMockStore from 'redux-mock-store'; import thunk from 'redux-thunk'; import sinon from 'sinon'; -import { - TRANSACTION_CATEGORIES, - TRANSACTION_STATUSES, -} from '../../../../shared/constants/transaction'; +import { TRANSACTION_STATUSES } from '../../../../shared/constants/transaction'; import ConfirmTransactionReducer, * as actions from './confirm-transaction.duck'; const initialState = { txData: {}, tokenData: {}, - methodData: {}, - tokenProps: { - tokenDecimals: '', - tokenSymbol: '', - }, fiatTransactionAmount: '', fiatTransactionFee: '', fiatTransactionTotal: '', @@ -27,28 +19,17 @@ const initialState = { hexTransactionFee: '', hexTransactionTotal: '', nonce: '', - toSmartContract: false, - fetchingData: false, }; const UPDATE_TX_DATA = 'metamask/confirm-transaction/UPDATE_TX_DATA'; -const CLEAR_TX_DATA = 'metamask/confirm-transaction/CLEAR_TX_DATA'; const UPDATE_TOKEN_DATA = 'metamask/confirm-transaction/UPDATE_TOKEN_DATA'; -const CLEAR_TOKEN_DATA = 'metamask/confirm-transaction/CLEAR_TOKEN_DATA'; -const UPDATE_METHOD_DATA = 'metamask/confirm-transaction/UPDATE_METHOD_DATA'; -const CLEAR_METHOD_DATA = 'metamask/confirm-transaction/CLEAR_METHOD_DATA'; const UPDATE_TRANSACTION_AMOUNTS = 'metamask/confirm-transaction/UPDATE_TRANSACTION_AMOUNTS'; const UPDATE_TRANSACTION_FEES = 'metamask/confirm-transaction/UPDATE_TRANSACTION_FEES'; const UPDATE_TRANSACTION_TOTALS = 'metamask/confirm-transaction/UPDATE_TRANSACTION_TOTALS'; -const UPDATE_TOKEN_PROPS = 'metamask/confirm-transaction/UPDATE_TOKEN_PROPS'; const UPDATE_NONCE = 'metamask/confirm-transaction/UPDATE_NONCE'; -const UPDATE_TO_SMART_CONTRACT = - 'metamask/confirm-transaction/UPDATE_TO_SMART_CONTRACT'; -const FETCH_DATA_START = 'metamask/confirm-transaction/FETCH_DATA_START'; -const FETCH_DATA_END = 'metamask/confirm-transaction/FETCH_DATA_END'; const CLEAR_CONFIRM_TRANSACTION = 'metamask/confirm-transaction/CLEAR_CONFIRM_TRANSACTION'; @@ -61,13 +42,6 @@ describe('Confirm Transaction Duck', function () { tokenData: { name: 'abcToken', }, - methodData: { - name: TRANSACTION_CATEGORIES.TOKEN_METHOD_APPROVE, - }, - tokenProps: { - tokenDecimals: '3', - tokenSymbol: 'ABC', - }, fiatTransactionAmount: '469.26', fiatTransactionFee: '0.01', fiatTransactionTotal: '1.000021', @@ -78,8 +52,6 @@ describe('Confirm Transaction Duck', function () { hexTransactionFee: '0x1319718a5000', hexTransactionTotal: '', nonce: '0x0', - toSmartContract: false, - fetchingData: false, }; it('should initialize state', function () { @@ -117,18 +89,6 @@ describe('Confirm Transaction Duck', function () { ); }); - it('should clear txData when receiving a CLEAR_TX_DATA action', function () { - assert.deepStrictEqual( - ConfirmTransactionReducer(mockState, { - type: CLEAR_TX_DATA, - }), - { - ...mockState, - txData: {}, - }, - ); - }); - it('should set tokenData when receiving a UPDATE_TOKEN_DATA action', function () { assert.deepStrictEqual( ConfirmTransactionReducer(mockState, { @@ -147,48 +107,6 @@ describe('Confirm Transaction Duck', function () { ); }); - it('should clear tokenData when receiving a CLEAR_TOKEN_DATA action', function () { - assert.deepStrictEqual( - ConfirmTransactionReducer(mockState, { - type: CLEAR_TOKEN_DATA, - }), - { - ...mockState, - tokenData: {}, - }, - ); - }); - - it('should set methodData when receiving a UPDATE_METHOD_DATA action', function () { - assert.deepStrictEqual( - ConfirmTransactionReducer(mockState, { - type: UPDATE_METHOD_DATA, - payload: { - name: 'transferFrom', - }, - }), - { - ...mockState, - methodData: { - ...mockState.methodData, - name: 'transferFrom', - }, - }, - ); - }); - - it('should clear methodData when receiving a CLEAR_METHOD_DATA action', function () { - assert.deepStrictEqual( - ConfirmTransactionReducer(mockState, { - type: CLEAR_METHOD_DATA, - }), - { - ...mockState, - methodData: {}, - }, - ); - }); - it('should update transaction amounts when receiving an UPDATE_TRANSACTION_AMOUNTS action', function () { assert.deepStrictEqual( ConfirmTransactionReducer(mockState, { @@ -246,25 +164,6 @@ describe('Confirm Transaction Duck', function () { ); }); - it('should update tokenProps when receiving an UPDATE_TOKEN_PROPS action', function () { - assert.deepStrictEqual( - ConfirmTransactionReducer(mockState, { - type: UPDATE_TOKEN_PROPS, - payload: { - tokenSymbol: 'DEF', - tokenDecimals: '1', - }, - }), - { - ...mockState, - tokenProps: { - tokenSymbol: 'DEF', - tokenDecimals: '1', - }, - }, - ); - }); - it('should update nonce when receiving an UPDATE_NONCE action', function () { assert.deepStrictEqual( ConfirmTransactionReducer(mockState, { @@ -278,41 +177,6 @@ describe('Confirm Transaction Duck', function () { ); }); - it('should update nonce when receiving an UPDATE_TO_SMART_CONTRACT action', function () { - assert.deepStrictEqual( - ConfirmTransactionReducer(mockState, { - type: UPDATE_TO_SMART_CONTRACT, - payload: true, - }), - { - ...mockState, - toSmartContract: true, - }, - ); - }); - - it('should set fetchingData to true when receiving a FETCH_DATA_START action', function () { - assert.deepStrictEqual( - ConfirmTransactionReducer(mockState, { - type: FETCH_DATA_START, - }), - { - ...mockState, - fetchingData: true, - }, - ); - }); - - it('should set fetchingData to false when receiving a FETCH_DATA_END action', function () { - assert.deepStrictEqual( - ConfirmTransactionReducer( - { fetchingData: true }, - { type: FETCH_DATA_END }, - ), - { fetchingData: false }, - ); - }); - it('should clear confirmTransaction when receiving a FETCH_DATA_END action', function () { assert.deepStrictEqual( ConfirmTransactionReducer(mockState, { @@ -334,14 +198,6 @@ describe('Confirm Transaction Duck', function () { assert.deepStrictEqual(actions.updateTxData(txData), expectedAction); }); - it('should create an action to clear txData', function () { - const expectedAction = { - type: CLEAR_TX_DATA, - }; - - assert.deepStrictEqual(actions.clearTxData(), expectedAction); - }); - it('should create an action to update tokenData', function () { const tokenData = { test: 123 }; const expectedAction = { @@ -355,35 +211,6 @@ describe('Confirm Transaction Duck', function () { ); }); - it('should create an action to clear tokenData', function () { - const expectedAction = { - type: CLEAR_TOKEN_DATA, - }; - - assert.deepStrictEqual(actions.clearTokenData(), expectedAction); - }); - - it('should create an action to update methodData', function () { - const methodData = { test: 123 }; - const expectedAction = { - type: UPDATE_METHOD_DATA, - payload: methodData, - }; - - assert.deepStrictEqual( - actions.updateMethodData(methodData), - expectedAction, - ); - }); - - it('should create an action to clear methodData', function () { - const expectedAction = { - type: CLEAR_METHOD_DATA, - }; - - assert.deepStrictEqual(actions.clearMethodData(), expectedAction); - }); - it('should create an action to update transaction amounts', function () { const transactionAmounts = { test: 123 }; const expectedAction = { @@ -423,22 +250,6 @@ describe('Confirm Transaction Duck', function () { ); }); - it('should create an action to update tokenProps', function () { - const tokenProps = { - tokenDecimals: '1', - tokenSymbol: 'abc', - }; - const expectedAction = { - type: UPDATE_TOKEN_PROPS, - payload: tokenProps, - }; - - assert.deepStrictEqual( - actions.updateTokenProps(tokenProps), - expectedAction, - ); - }); - it('should create an action to update nonce', function () { const nonce = '0x1'; const expectedAction = { @@ -449,22 +260,6 @@ describe('Confirm Transaction Duck', function () { assert.deepStrictEqual(actions.updateNonce(nonce), expectedAction); }); - it('should create an action to set fetchingData to true', function () { - const expectedAction = { - type: FETCH_DATA_START, - }; - - assert.deepStrictEqual(actions.setFetchingData(true), expectedAction); - }); - - it('should create an action to set fetchingData to false', function () { - const expectedAction = { - type: FETCH_DATA_END, - }; - - assert.deepStrictEqual(actions.setFetchingData(false), expectedAction); - }); - it('should create an action to clear confirmTransaction', function () { const expectedAction = { type: CLEAR_CONFIRM_TRANSACTION, @@ -489,61 +284,6 @@ describe('Confirm Transaction Duck', function () { global.eth.getCode.resetHistory(); }); - it('updates txData and gas on an existing transaction in confirmTransaction', function () { - const mockState = { - metamask: { - conversionRate: 468.58, - currentCurrency: 'usd', - }, - confirmTransaction: { - ethTransactionAmount: '1', - ethTransactionFee: '0.000021', - ethTransactionTotal: '1.000021', - fetchingData: false, - fiatTransactionAmount: '469.26', - fiatTransactionFee: '0.01', - fiatTransactionTotal: '469.27', - hexGasTotal: '0x1319718a5000', - methodData: {}, - nonce: '', - tokenData: {}, - tokenProps: { - tokenDecimals: '', - tokenSymbol: '', - }, - txData: { - history: [], - id: 2603411941761054, - loadingDefaults: false, - metamaskNetworkId: '3', - origin: 'faucet.metamask.io', - status: TRANSACTION_STATUSES.UNAPPROVED, - time: 1530838113716, - }, - }, - }; - - const middlewares = [thunk]; - const mockStore = configureMockStore(middlewares); - const store = mockStore(mockState); - const expectedActions = [ - 'metamask/confirm-transaction/UPDATE_TX_DATA', - 'metamask/confirm-transaction/UPDATE_TRANSACTION_AMOUNTS', - 'metamask/confirm-transaction/UPDATE_TRANSACTION_FEES', - 'metamask/confirm-transaction/UPDATE_TRANSACTION_TOTALS', - ]; - - store.dispatch( - actions.updateGasAndCalculate({ gasLimit: '0x2', gasPrice: '0x25' }), - ); - - const storeActions = store.getActions(); - assert.strictEqual(storeActions.length, expectedActions.length); - storeActions.forEach((action, index) => - assert.strictEqual(action.type, expectedActions[index]), - ); - }); - it('updates txData and updates gas values in confirmTransaction', function () { const txData = { history: [], From 19fa2f59622b780113aa2878e23a6a17a66741b5 Mon Sep 17 00:00:00 2001 From: Brad Decker Date: Mon, 8 Feb 2021 17:22:30 -0600 Subject: [PATCH 09/11] cancel unapproved confirmations on network change (#10357) --- app/scripts/background.js | 39 +++++++++++++++---- app/scripts/controllers/app-state.js | 5 ++- .../controllers/incoming-transactions.js | 3 +- app/scripts/controllers/network/index.js | 2 +- app/scripts/controllers/network/network.js | 12 +++++- app/scripts/controllers/swaps.js | 3 +- app/scripts/controllers/transactions/index.js | 5 ++- .../transactions/tx-state-manager.js | 5 ++- app/scripts/lib/decrypt-message-manager.js | 11 +++++- .../lib/encryption-public-key-manager.js | 11 +++++- app/scripts/lib/message-manager.js | 11 +++++- app/scripts/lib/personal-message-manager.js | 11 +++++- app/scripts/lib/typed-message-manager.js | 11 +++++- app/scripts/metamask-controller.js | 32 +++++++++++---- .../controllers/incoming-transactions-test.js | 3 +- test/unit/app/controllers/metametrics-test.js | 5 ++- test/unit/app/controllers/swaps-test.js | 6 ++- .../transactions/tx-controller-test.js | 6 ++- 18 files changed, 145 insertions(+), 36 deletions(-) diff --git a/app/scripts/background.js b/app/scripts/background.js index 55a8f5a63..ca7c04951 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -32,7 +32,9 @@ import LocalStore from './lib/local-store'; import ReadOnlyNetworkStore from './lib/network-store'; import createStreamSink from './lib/createStreamSink'; import NotificationManager from './lib/notification-manager'; -import MetamaskController from './metamask-controller'; +import MetamaskController, { + METAMASK_CONTROLLER_EVENTS, +} from './metamask-controller'; import rawFirstTimeState from './first-time-state'; import getFirstPreferredLangCode from './lib/get-first-preferred-lang-code'; import getObjStructure from './lib/getObjStructure'; @@ -396,14 +398,35 @@ function setupController(initState, initLangCode) { // updateBadge(); - controller.txController.on('update:badge', updateBadge); - controller.messageManager.on('updateBadge', updateBadge); - controller.personalMessageManager.on('updateBadge', updateBadge); - controller.decryptMessageManager.on('updateBadge', updateBadge); - controller.encryptionPublicKeyManager.on('updateBadge', updateBadge); - controller.typedMessageManager.on('updateBadge', updateBadge); + controller.txController.on( + METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE, + updateBadge, + ); + controller.messageManager.on( + METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE, + updateBadge, + ); + controller.personalMessageManager.on( + METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE, + updateBadge, + ); + controller.decryptMessageManager.on( + METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE, + updateBadge, + ); + controller.encryptionPublicKeyManager.on( + METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE, + updateBadge, + ); + controller.typedMessageManager.on( + METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE, + updateBadge, + ); controller.approvalController.subscribe(updateBadge); - controller.appStateController.on('updateBadge', updateBadge); + controller.appStateController.on( + METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE, + updateBadge, + ); /** * Updates the Web Extension's "badge" number, on the little fox in the toolbar. diff --git a/app/scripts/controllers/app-state.js b/app/scripts/controllers/app-state.js index 0bf791821..73173bf68 100644 --- a/app/scripts/controllers/app-state.js +++ b/app/scripts/controllers/app-state.js @@ -1,5 +1,6 @@ import EventEmitter from 'events'; import { ObservableStore } from '@metamask/obs-store'; +import { METAMASK_CONTROLLER_EVENTS } from '../metamask-controller'; export default class AppStateController extends EventEmitter { /** @@ -74,7 +75,7 @@ export default class AppStateController extends EventEmitter { */ waitForUnlock(resolve, shouldShowUnlockRequest) { this.waitingForUnlock.push({ resolve }); - this.emit('updateBadge'); + this.emit(METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE); if (shouldShowUnlockRequest) { this._showUnlockRequest(); } @@ -88,7 +89,7 @@ export default class AppStateController extends EventEmitter { while (this.waitingForUnlock.length > 0) { this.waitingForUnlock.shift().resolve(); } - this.emit('updateBadge'); + this.emit(METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE); } } diff --git a/app/scripts/controllers/incoming-transactions.js b/app/scripts/controllers/incoming-transactions.js index 481810ec1..471a41872 100644 --- a/app/scripts/controllers/incoming-transactions.js +++ b/app/scripts/controllers/incoming-transactions.js @@ -23,6 +23,7 @@ import { ROPSTEN, ROPSTEN_CHAIN_ID, } from '../../../shared/constants/network'; +import { NETWORK_EVENTS } from './network'; const fetchWithTimeout = getFetchWithTimeout(30000); @@ -111,7 +112,7 @@ export default class IncomingTransactionsController { }), ); - this.networkController.on('networkDidChange', async () => { + this.networkController.on(NETWORK_EVENTS.NETWORK_DID_CHANGE, async () => { const address = this.preferencesController.getSelectedAddress(); await this._update({ address, diff --git a/app/scripts/controllers/network/index.js b/app/scripts/controllers/network/index.js index a0a43faa5..fa027c5ab 100644 --- a/app/scripts/controllers/network/index.js +++ b/app/scripts/controllers/network/index.js @@ -1 +1 @@ -export { default } from './network'; +export { default, NETWORK_EVENTS } from './network'; diff --git a/app/scripts/controllers/network/network.js b/app/scripts/controllers/network/network.js index 605b0063a..7315e060d 100644 --- a/app/scripts/controllers/network/network.js +++ b/app/scripts/controllers/network/network.js @@ -47,6 +47,13 @@ const defaultProviderConfig = { ...defaultProviderConfigOpts, }; +export const NETWORK_EVENTS = { + // Fired after the actively selected network is changed + NETWORK_DID_CHANGE: 'networkDidChange', + // Fired when the actively selected network *will* change + NETWORK_WILL_CHANGE: 'networkWillChange', +}; + export default class NetworkController extends EventEmitter { constructor(opts = {}) { super(); @@ -73,7 +80,7 @@ export default class NetworkController extends EventEmitter { this._providerProxy = null; this._blockTrackerProxy = null; - this.on('networkDidChange', this.lookupNetwork); + this.on(NETWORK_EVENTS.NETWORK_DID_CHANGE, this.lookupNetwork); } /** @@ -229,9 +236,10 @@ export default class NetworkController extends EventEmitter { // _switchNetwork(opts) { + this.emit(NETWORK_EVENTS.NETWORK_WILL_CHANGE); this.setNetworkState('loading'); this._configureProvider(opts); - this.emit('networkDidChange', opts.type); + this.emit(NETWORK_EVENTS.NETWORK_DID_CHANGE, opts.type); } _configureProvider({ type, rpcUrl, chainId }) { diff --git a/app/scripts/controllers/swaps.js b/app/scripts/controllers/swaps.js index 992af5578..d82ac305f 100644 --- a/app/scripts/controllers/swaps.js +++ b/app/scripts/controllers/swaps.js @@ -19,6 +19,7 @@ import { fetchSwapsFeatureLiveness as defaultFetchSwapsFeatureLiveness, fetchSwapsQuoteRefreshTime as defaultFetchSwapsQuoteRefreshTime, } from '../../../ui/app/pages/swaps/swaps.util'; +import { NETWORK_EVENTS } from './network'; const METASWAP_ADDRESS = '0x881d40237659c251811cec9c364ef91dc08d300c'; @@ -103,7 +104,7 @@ export default class SwapsController { this.ethersProvider = new ethers.providers.Web3Provider(provider); this._currentNetwork = networkController.store.getState().network; - networkController.on('networkDidChange', (network) => { + networkController.on(NETWORK_EVENTS.NETWORK_DID_CHANGE, (network) => { if (network !== 'loading' && network !== this._currentNetwork) { this._currentNetwork = network; this.ethersProvider = new ethers.providers.Web3Provider(provider); diff --git a/app/scripts/controllers/transactions/index.js b/app/scripts/controllers/transactions/index.js index 36864c509..093c3badb 100644 --- a/app/scripts/controllers/transactions/index.js +++ b/app/scripts/controllers/transactions/index.js @@ -23,6 +23,7 @@ import { TRANSACTION_STATUSES, TRANSACTION_TYPES, } from '../../../../shared/constants/transaction'; +import { METAMASK_CONTROLLER_EVENTS } from '../../metamask-controller'; import TransactionStateManager from './tx-state-manager'; import TxGasUtil from './tx-gas-utils'; import PendingTransactionTracker from './pending-tx-tracker'; @@ -113,7 +114,9 @@ export default class TransactionController extends EventEmitter { ), }); - this.txStateManager.store.subscribe(() => this.emit('update:badge')); + this.txStateManager.store.subscribe(() => + this.emit(METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE), + ); this._setupListeners(); // memstore is computed from a few different stores this._updateMemstore(); diff --git a/app/scripts/controllers/transactions/tx-state-manager.js b/app/scripts/controllers/transactions/tx-state-manager.js index 492ea4dde..ffa49e2bc 100644 --- a/app/scripts/controllers/transactions/tx-state-manager.js +++ b/app/scripts/controllers/transactions/tx-state-manager.js @@ -3,6 +3,7 @@ import { ObservableStore } from '@metamask/obs-store'; import log from 'loglevel'; import createId from '../../lib/random-id'; import { TRANSACTION_STATUSES } from '../../../../shared/constants/transaction'; +import { METAMASK_CONTROLLER_EVENTS } from '../../metamask-controller'; import { generateHistoryEntry, replayHistory, @@ -474,7 +475,7 @@ export default class TransactionStateManager extends EventEmitter { * @param {TransactionStatuses[keyof TransactionStatuses]} status - the status to set on the txMeta * @emits tx:status-update - passes txId and status * @emits ${txMeta.id}:finished - if it is a finished state. Passes the txMeta - * @emits update:badge + * @emits 'updateBadge' */ _setTxStatus(txId, status) { const txMeta = this.getTx(txId); @@ -497,7 +498,7 @@ export default class TransactionStateManager extends EventEmitter { ) { this.emit(`${txMeta.id}:finished`, txMeta); } - this.emit('update:badge'); + this.emit(METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE); } catch (error) { log.error(error); } diff --git a/app/scripts/lib/decrypt-message-manager.js b/app/scripts/lib/decrypt-message-manager.js index 39f2a0e42..32ae13626 100644 --- a/app/scripts/lib/decrypt-message-manager.js +++ b/app/scripts/lib/decrypt-message-manager.js @@ -4,6 +4,7 @@ import ethUtil from 'ethereumjs-util'; import { ethErrors } from 'eth-rpc-errors'; import log from 'loglevel'; import { MESSAGE_TYPE } from '../../../shared/constants/app'; +import { METAMASK_CONTROLLER_EVENTS } from '../metamask-controller'; import { addHexPrefix } from './util'; import createId from './random-id'; @@ -253,6 +254,14 @@ export default class DecryptMessageManager extends EventEmitter { this._setMsgStatus(msgId, 'errored'); } + /** + * Clears all unapproved messages from memory. + */ + clearUnapproved() { + this.messages = this.messages.filter((msg) => msg.status !== 'unapproved'); + this._saveMsgList(); + } + /** * Updates the status of a DecryptMessage in this.messages via a call to this._updateMsg * @@ -316,7 +325,7 @@ export default class DecryptMessageManager extends EventEmitter { unapprovedDecryptMsgs, unapprovedDecryptMsgCount, }); - this.emit('updateBadge'); + this.emit(METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE); } /** diff --git a/app/scripts/lib/encryption-public-key-manager.js b/app/scripts/lib/encryption-public-key-manager.js index 6fc213b19..e29723b5b 100644 --- a/app/scripts/lib/encryption-public-key-manager.js +++ b/app/scripts/lib/encryption-public-key-manager.js @@ -3,6 +3,7 @@ import { ObservableStore } from '@metamask/obs-store'; import { ethErrors } from 'eth-rpc-errors'; import log from 'loglevel'; import { MESSAGE_TYPE } from '../../../shared/constants/app'; +import { METAMASK_CONTROLLER_EVENTS } from '../metamask-controller'; import createId from './random-id'; /** @@ -242,6 +243,14 @@ export default class EncryptionPublicKeyManager extends EventEmitter { this._setMsgStatus(msgId, 'errored'); } + /** + * Clears all unapproved messages from memory. + */ + clearUnapproved() { + this.messages = this.messages.filter((msg) => msg.status !== 'unapproved'); + this._saveMsgList(); + } + /** * Updates the status of a EncryptionPublicKey in this.messages via a call to this._updateMsg * @@ -303,6 +312,6 @@ export default class EncryptionPublicKeyManager extends EventEmitter { unapprovedEncryptionPublicKeyMsgs, unapprovedEncryptionPublicKeyMsgCount, }); - this.emit('updateBadge'); + this.emit(METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE); } } diff --git a/app/scripts/lib/message-manager.js b/app/scripts/lib/message-manager.js index 796971208..7f4218f8b 100644 --- a/app/scripts/lib/message-manager.js +++ b/app/scripts/lib/message-manager.js @@ -3,6 +3,7 @@ import { ObservableStore } from '@metamask/obs-store'; import ethUtil from 'ethereumjs-util'; import { ethErrors } from 'eth-rpc-errors'; import { MESSAGE_TYPE } from '../../../shared/constants/app'; +import { METAMASK_CONTROLLER_EVENTS } from '../metamask-controller'; import createId from './random-id'; /** @@ -220,6 +221,14 @@ export default class MessageManager extends EventEmitter { this._setMsgStatus(msgId, 'rejected'); } + /** + * Clears all unapproved messages from memory. + */ + clearUnapproved() { + this.messages = this.messages.filter((msg) => msg.status !== 'unapproved'); + this._saveMsgList(); + } + /** * Updates the status of a Message in this.messages via a call to this._updateMsg * @@ -272,7 +281,7 @@ export default class MessageManager extends EventEmitter { const unapprovedMsgs = this.getUnapprovedMsgs(); const unapprovedMsgCount = Object.keys(unapprovedMsgs).length; this.memStore.updateState({ unapprovedMsgs, unapprovedMsgCount }); - this.emit('updateBadge'); + this.emit(METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE); } } diff --git a/app/scripts/lib/personal-message-manager.js b/app/scripts/lib/personal-message-manager.js index 66474c8c4..1fb59144b 100644 --- a/app/scripts/lib/personal-message-manager.js +++ b/app/scripts/lib/personal-message-manager.js @@ -4,6 +4,7 @@ import ethUtil from 'ethereumjs-util'; import { ethErrors } from 'eth-rpc-errors'; import log from 'loglevel'; import { MESSAGE_TYPE } from '../../../shared/constants/app'; +import { METAMASK_CONTROLLER_EVENTS } from '../metamask-controller'; import { addHexPrefix } from './util'; import createId from './random-id'; @@ -241,6 +242,14 @@ export default class PersonalMessageManager extends EventEmitter { this._setMsgStatus(msgId, 'rejected'); } + /** + * Clears all unapproved messages from memory. + */ + clearUnapproved() { + this.messages = this.messages.filter((msg) => msg.status !== 'unapproved'); + this._saveMsgList(); + } + /** * Updates the status of a PersonalMessage in this.messages via a call to this._updateMsg * @@ -301,7 +310,7 @@ export default class PersonalMessageManager extends EventEmitter { unapprovedPersonalMsgs, unapprovedPersonalMsgCount, }); - this.emit('updateBadge'); + this.emit(METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE); } /** diff --git a/app/scripts/lib/typed-message-manager.js b/app/scripts/lib/typed-message-manager.js index 630e6029c..d1ea6491b 100644 --- a/app/scripts/lib/typed-message-manager.js +++ b/app/scripts/lib/typed-message-manager.js @@ -7,6 +7,7 @@ import { isValidAddress } from 'ethereumjs-util'; import log from 'loglevel'; import jsonschema from 'jsonschema'; import { MESSAGE_TYPE } from '../../../shared/constants/app'; +import { METAMASK_CONTROLLER_EVENTS } from '../metamask-controller'; import createId from './random-id'; /** @@ -313,6 +314,14 @@ export default class TypedMessageManager extends EventEmitter { this._setMsgStatus(msgId, 'errored'); } + /** + * Clears all unapproved messages from memory. + */ + clearUnapproved() { + this.messages = this.messages.filter((msg) => msg.status !== 'unapproved'); + this._saveMsgList(); + } + // // PRIVATE METHODS // @@ -377,6 +386,6 @@ export default class TypedMessageManager extends EventEmitter { unapprovedTypedMessages, unapprovedTypedMessagesCount, }); - this.emit('updateBadge'); + this.emit(METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE); } } diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 2eff30355..93404fd39 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -35,7 +35,7 @@ import createTabIdMiddleware from './lib/createTabIdMiddleware'; import createOnboardingMiddleware from './lib/createOnboardingMiddleware'; import { setupMultiplex } from './lib/stream-utils'; import EnsController from './controllers/ens'; -import NetworkController from './controllers/network'; +import NetworkController, { NETWORK_EVENTS } from './controllers/network'; import PreferencesController from './controllers/preferences'; import AppStateController from './controllers/app-state'; import CachedBalancesController from './controllers/cached-balances'; @@ -61,6 +61,12 @@ import seedPhraseVerifier from './lib/seed-phrase-verifier'; import MetaMetricsController from './controllers/metametrics'; import { segment, segmentLegacy } from './lib/segment'; +export const METAMASK_CONTROLLER_EVENTS = { + // Fired after state changes that impact the extension badge (unapproved msg count) + // The process of updating the badge happens in app/scripts/background.js. + UPDATE_BADGE: 'updateBadge', +}; + export default class MetamaskController extends EventEmitter { /** * @constructor @@ -127,7 +133,7 @@ export default class MetamaskController extends EventEmitter { preferencesStore: this.preferencesController.store, onNetworkDidChange: this.networkController.on.bind( this.networkController, - 'networkDidChange', + NETWORK_EVENTS.NETWORK_DID_CHANGE, ), getNetworkIdentifier: this.networkController.getNetworkIdentifier.bind( this.networkController, @@ -214,11 +220,6 @@ export default class MetamaskController extends EventEmitter { preferencesController: this.preferencesController, }); - // ensure accountTracker updates balances after network change - this.networkController.on('networkDidChange', () => { - this.accountTracker._updateAccounts(); - }); - const additionalKeyrings = [TrezorKeyring, LedgerBridgeKeyring]; this.keyringController = new KeyringController({ keyringTypes: additionalKeyrings, @@ -323,7 +324,7 @@ export default class MetamaskController extends EventEmitter { } }); - this.networkController.on('networkDidChange', () => { + this.networkController.on(NETWORK_EVENTS.NETWORK_DID_CHANGE, () => { this.setCurrentCurrency( this.currencyRateController.state.currentCurrency, (error) => { @@ -357,6 +358,21 @@ export default class MetamaskController extends EventEmitter { tokenRatesStore: this.tokenRatesController.store, }); + // ensure accountTracker updates balances after network change + this.networkController.on(NETWORK_EVENTS.NETWORK_DID_CHANGE, () => { + this.accountTracker._updateAccounts(); + }); + + // clear unapproved transactions and messages when the network will change + this.networkController.on(NETWORK_EVENTS.NETWORK_WILL_CHANGE, () => { + this.txController.txStateManager.clearUnapprovedTxs(); + this.encryptionPublicKeyManager.clearUnapproved(); + this.personalMessageManager.clearUnapproved(); + this.typedMessageManager.clearUnapproved(); + this.decryptMessageManager.clearUnapproved(); + this.messageManager.clearUnapproved(); + }); + // ensure isClientOpenAndUnlocked is updated when memState updates this.on('update', (memState) => this._onStateUpdate(memState)); diff --git a/test/unit/app/controllers/incoming-transactions-test.js b/test/unit/app/controllers/incoming-transactions-test.js index 86e629609..d0f3d3e3b 100644 --- a/test/unit/app/controllers/incoming-transactions-test.js +++ b/test/unit/app/controllers/incoming-transactions-test.js @@ -19,6 +19,7 @@ import { TRANSACTION_CATEGORIES, TRANSACTION_STATUSES, } from '../../../../shared/constants/transaction'; +import { NETWORK_EVENTS } from '../../../../app/scripts/controllers/network'; const IncomingTransactionsController = proxyquire( '../../../../app/scripts/controllers/incoming-transactions', @@ -161,7 +162,7 @@ describe('IncomingTransactionsController', function () { assert(incomingTransactionsController.networkController.on.calledOnce); assert.equal( incomingTransactionsController.networkController.on.getCall(0).args[0], - 'networkDidChange', + NETWORK_EVENTS.NETWORK_DID_CHANGE, ); const networkControllerListenerCallback = incomingTransactionsController.networkController.on.getCall( 0, diff --git a/test/unit/app/controllers/metametrics-test.js b/test/unit/app/controllers/metametrics-test.js index 8f2de0c02..839b323c4 100644 --- a/test/unit/app/controllers/metametrics-test.js +++ b/test/unit/app/controllers/metametrics-test.js @@ -8,6 +8,7 @@ import { METAMETRICS_BACKGROUND_PAGE_OBJECT, } from '../../../../shared/constants/metametrics'; import waitUntilCalled from '../../../lib/wait-until-called'; +import { NETWORK_EVENTS } from '../../../../app/scripts/controllers/network'; const segment = createSegmentMock(2, 10000); const segmentLegacy = createSegmentMock(2, 10000); @@ -49,7 +50,7 @@ function getMockNetworkController( provider = { type: NETWORK }, ) { let networkStore = { chainId, provider }; - const on = sinon.stub().withArgs('networkDidChange'); + const on = sinon.stub().withArgs(NETWORK_EVENTS.NETWORK_DID_CHANGE); const updateState = (newState) => { networkStore = { ...networkStore, ...newState }; on.getCall(0).args[1](); @@ -99,7 +100,7 @@ function getMetaMetricsController({ ), onNetworkDidChange: networkController.on.bind( networkController, - 'networkDidChange', + NETWORK_EVENTS.NETWORK_DID_CHANGE, ), preferencesStore, version: '0.0.1', diff --git a/test/unit/app/controllers/swaps-test.js b/test/unit/app/controllers/swaps-test.js index 5bd1c8529..299f99229 100644 --- a/test/unit/app/controllers/swaps-test.js +++ b/test/unit/app/controllers/swaps-test.js @@ -14,6 +14,7 @@ import { createTestProviderTools } from '../../../stub/provider'; import SwapsController, { utils, } from '../../../../app/scripts/controllers/swaps'; +import { NETWORK_EVENTS } from '../../../../app/scripts/controllers/network'; const MOCK_FETCH_PARAMS = { slippage: 3, @@ -101,7 +102,10 @@ function getMockNetworkController() { }; }, }, - on: sinon.stub().withArgs('networkDidChange').callsArgAsync(1), + on: sinon + .stub() + .withArgs(NETWORK_EVENTS.NETWORK_DID_CHANGE) + .callsArgAsync(1), }; } diff --git a/test/unit/app/controllers/transactions/tx-controller-test.js b/test/unit/app/controllers/transactions/tx-controller-test.js index ca7bfede6..ed84b3bcc 100644 --- a/test/unit/app/controllers/transactions/tx-controller-test.js +++ b/test/unit/app/controllers/transactions/tx-controller-test.js @@ -15,6 +15,7 @@ import { TRANSACTION_STATUSES, TRANSACTION_TYPES, } from '../../../../../shared/constants/transaction'; +import { METAMASK_CONTROLLER_EVENTS } from '../../../../../app/scripts/metamask-controller'; const noop = () => true; const currentNetworkId = '42'; @@ -395,7 +396,10 @@ describe('Transaction Controller', function () { txParams: {}, }; - const eventNames = ['update:badge', '1:unapproved']; + const eventNames = [ + METAMASK_CONTROLLER_EVENTS.UPDATE_BADGE, + '1:unapproved', + ]; const listeners = []; eventNames.forEach((eventName) => { listeners.push( From a12654ec378a1dbc6c8a65326e4f347efa9753ff Mon Sep 17 00:00:00 2001 From: arisac Date: Tue, 9 Feb 2021 05:42:41 +0000 Subject: [PATCH 10/11] Update zh_CN translation (#9388) * Update zh_CN translation Co-authored-by: Mark Stacey --- app/_locales/zh_CN/messages.json | 1229 +++++++++++++++++++++++++----- 1 file changed, 1021 insertions(+), 208 deletions(-) diff --git a/app/_locales/zh_CN/messages.json b/app/_locales/zh_CN/messages.json index c584e0fc3..707c59cb1 100644 --- a/app/_locales/zh_CN/messages.json +++ b/app/_locales/zh_CN/messages.json @@ -3,13 +3,19 @@ "message": "关于" }, "aboutSettingsDescription": { - "message": "版本、技术支持中心和联系方式。" + "message": "版本、支持中心和联系方式。" }, "acceleratingATransaction": { - "message": "* 设定更高的 Gas 价格,加快交易的完成进度,提高网络快速处理机率,但无法保证每次均能够实现提速。" + "message": "* 设定更高燃料价格,可以加快交易完成进度,提高网络快速处理机率,但无法保证每次均能够实现提速。" + }, + "acceptTermsOfUse": { + "message": "我已阅读并同意 $1" + }, + "accessAndSpendNotice": { + "message": "$1 可以访问并使用此最大数额" }, "accessingYourCamera": { - "message": "正在获取相机使用权限..." + "message": "正在获取您的相机……" }, "account": { "message": "账户" @@ -26,11 +32,20 @@ "accountSelectionRequired": { "message": "您需要选择一个账户 !" }, + "active": { + "message": "当前" + }, + "activity": { + "message": "活动" + }, "activityLog": { "message": "活动日志" }, + "addAccount": { + "message": "添加一个账户" + }, "addAcquiredTokens": { - "message": "在MetaMask上添加已用的代币" + "message": "在 MetaMask 上添加获得的代币" }, "addAlias": { "message": "添加别名" @@ -39,7 +54,7 @@ "message": "添加网络" }, "addRecipient": { - "message": "添加接受人" + "message": "添加接收方" }, "addSuggestedTokens": { "message": "添加推荐代币" @@ -63,21 +78,73 @@ "message": "高级选项" }, "advancedSettingsDescription": { - "message": "访问开发者功能,下载状态日志,重置账户,安排测试网络和自定义 RPC 。" + "message": "访问开发者功能,下载状态日志,重置账户,设置测试网和自定义 RPC。" + }, + "affirmAgree": { + "message": "我同意" + }, + "aggregatorFeeCost": { + "message": "聚集器网络手续费" + }, + "alertDisableTooltip": { + "message": "这个可以在“设置 > 提醒”中进行更改" + }, + "alertSettingsUnconnectedAccount": { + "message": "选择了未连接的账户时浏览网站" + }, + "alertSettingsUnconnectedAccountDescription": { + "message": "当您在浏览已连接的 Web3 网站,但当前选择的账户没有连接时,该提醒会在弹出的窗口中显示。" + }, + "alertSettingsWeb3ShimUsage": { + "message": "当网站尝试使用已经删除的 window.web3 API" + }, + "alertSettingsWeb3ShimUsageDescription": { + "message": "当您在浏览的网站尝试使用已经删除的 window.web3 API 时,该提醒会在弹出的窗口中显示。" + }, + "alerts": { + "message": "提醒" + }, + "alertsSettingsDescription": { + "message": "启用或禁用每个提醒" + }, + "allowExternalExtensionTo": { + "message": "允许这个外部扩展到:" + }, + "allowOriginSpendToken": { + "message": "允许 $1 使用您的 $2?" + }, + "allowThisSiteTo": { + "message": "允许本网站:" + }, + "allowWithdrawAndSpend": { + "message": "允许 $1 提取和最多消费以下数额:" }, "amount": { - "message": "数量" + "message": "数额" + }, + "amountInEth": { + "message": "$1 ETH" + }, + "amountWithColon": { + "message": "数额:" }, "appDescription": { - "message": "以太坊浏览器插件", - "description": "The description of the application" + "message": "以太坊浏览器插件" }, "appName": { - "message": "MetaMask", - "description": "The name of the application" + "message": "MetaMask" + }, + "approvalAndAggregatorTxFeeCost": { + "message": "批准聚合商网络手续费" + }, + "approvalTxGasCost": { + "message": "批准交易燃料成本" }, "approve": { - "message": "批准" + "message": "批准消费限额" + }, + "approveSpendLimit": { + "message": "批准 $1 消费限额" }, "approved": { "message": "已批准" @@ -85,23 +152,29 @@ "asset": { "message": "资产" }, + "assets": { + "message": "资产" + }, "attemptToCancel": { "message": "想要取消吗?" }, "attemptToCancelDescription": { - "message": "确认提交该操作无法保证能够成功取消您的原始交易。如果取消成功,您将被收取上述交易费用。" + "message": "确认提交该操作无法保证能够成功取消您的原始交易。如取消成功,您将被收取上述交易费。" }, "attemptingConnect": { - "message": "正在尝试连接区块链。" + "message": "正在尝试连接到区块链。" }, "attributions": { "message": "来源" }, + "authorizedPermissions": { + "message": "您已授权以下权限" + }, "autoLockTimeLimit": { - "message": "自动注销计时器(分钟)" + "message": "自动锁定定时(分钟)" }, "autoLockTimeLimitDescription": { - "message": "请设置 MetaMask 自动注销前的空闲时间(以分钟为单位)" + "message": "请设置 MetaMask 自动锁定前的空闲时间(单位:分钟)" }, "average": { "message": "平均值" @@ -110,19 +183,19 @@ "message": "返回" }, "backToAll": { - "message": "恢复所有设置" + "message": "返回全部" }, "backupApprovalInfo": { "message": "如果不慎丢失个人设备,忘记密码,或者需要重新安装 MetaMask,亦或是需在另一台设备上打开钱包,请使用该保密码恢复个人钱包数据。" }, "backupApprovalNotice": { - "message": "请备份您的私密恢复代码,保证个人钱包和资金安全。" + "message": "请备份您的账户助记词,保证您的钱包和资金安全。" }, "backupNow": { "message": "立即备份" }, "balance": { - "message": "余额:" + "message": "余额 " }, "balanceOutdated": { "message": "余额可能已过期" @@ -131,21 +204,23 @@ "message": "基本" }, "blockExplorerUrl": { - "message": "屏蔽管理器" + "message": "区块浏览器" }, "blockExplorerView": { - "message": "通过 $1 查看账户", - "description": "$1 replaced by URL for custom block explorer" + "message": "通过 $1 查看账户" }, "blockiesIdenticon": { - "message": "使用区块Identicon" + "message": "使用 Blockies Identicon 图标头像" }, "browserNotSupported": { - "message": "您的浏览器不支持该功能…" + "message": "您的浏览器不支持该功能……" }, "builtInCalifornia": { "message": "MetaMask在加利福尼亚设计和制造。" }, + "buy": { + "message": "购买" + }, "buyWithWyre": { "message": "使用 Wyre 购买 ETH" }, @@ -155,11 +230,14 @@ "bytes": { "message": "字节" }, + "canToggleInSettings": { + "message": "您可以在 设置 -> 提醒 中重新启用该提醒通知。" + }, "cancel": { "message": "取消" }, "cancellationGasFee": { - "message": "取消 Gas 费" + "message": "取消交易燃料费用" }, "cancelled": { "message": "已取消" @@ -168,7 +246,7 @@ "message": "链 ID" }, "chromeRequiredForHardwareWallets": { - "message": "您需要通过 Google Chrome 浏览器使用 MetaMask ,连接个人硬件钱包。" + "message": "您需要在谷歌浏览器(Google Chrome)上使用 MetaMask 才能连接到您的硬件钱包。" }, "clickToRevealSeed": { "message": "点击此处显示密语" @@ -183,7 +261,7 @@ "message": "确认密码" }, "confirmSecretBackupPhrase": { - "message": "请确认您的私密备份密语" + "message": "请确认您的账户助记词" }, "confirmed": { "message": "确认" @@ -194,8 +272,53 @@ "connect": { "message": "连接" }, + "connectAccountOrCreate": { + "message": "连接账户或创建新账户" + }, "connectHardwareWallet": { - "message": "链接硬件钱包" + "message": "连接硬件钱包" + }, + "connectManually": { + "message": "手动连接到当前站点" + }, + "connectTo": { + "message": "连接到 $1" + }, + "connectToAll": { + "message": "连接到您的全部$1" + }, + "connectToAllAccounts": { + "message": "账户" + }, + "connectToMultiple": { + "message": "连接到 $1" + }, + "connectToMultipleNumberOfAccounts": { + "message": "$1 个账户" + }, + "connectWithMetaMask": { + "message": "使用 MetaMask 连接" + }, + "connectedAccountsDescriptionPlural": { + "message": "您有 $1 个账户连接到了该网站。" + }, + "connectedAccountsDescriptionSingular": { + "message": "您有 1 个账户连接到了该网站。" + }, + "connectedAccountsEmptyDescription": { + "message": "MetaMask 没有连接这个网站。要连接到 web3 网站,请在他们的网站上找到连接按钮。" + }, + "connectedSites": { + "message": "已连接的网站" + }, + "connectedSitesDescription": { + "message": "$1 已连接到这些网站。他们可以查看您的账户地址。" + }, + "connectedSitesEmptyDescription": { + "message": "$1 还没连接任何网站。" + }, + "connecting": { + "message": "连接中……" }, "connectingTo": { "message": "正在连接 $1" @@ -204,16 +327,25 @@ "message": "正在连接 Goerli 测试网络" }, "connectingToKovan": { - "message": "正在连接到Kovan测试网络" + "message": "正在连接到 Kovan 测试网络" }, "connectingToMainnet": { - "message": "正在连接到以太坊主网" + "message": "正在连接到以太坊 Ethereum 主网" }, "connectingToRinkeby": { - "message": "正在连接到Rinkeby测试网络" + "message": "正在连接到 Rinkeby 测试网络" }, "connectingToRopsten": { - "message": "正在连接到Ropsten测试网络" + "message": "正在连接到 Ropsten 测试网络" + }, + "contactUs": { + "message": "联系我们" + }, + "contacts": { + "message": "联系人" + }, + "contactsSettingsDescription": { + "message": "添加、编辑、删除和管理您的联系人。" }, "continueToWyre": { "message": "继续前往 Wyre" @@ -231,10 +363,10 @@ "message": "交易 ID 复制成功" }, "copyAddress": { - "message": "将地址复制到剪贴板" + "message": "复制地址到剪贴板" }, "copyPrivateKey": { - "message": "这是你的私钥(点击复制)" + "message": "这是您的私钥(点击复制)" }, "copyToClipboard": { "message": "复制到剪贴板" @@ -255,13 +387,19 @@ "message": "创建密码" }, "currencyConversion": { - "message": "货币兑换" + "message": "货币转换" + }, + "currentAccountNotConnected": { + "message": "您的当前账户没有连接" + }, + "currentExtension": { + "message": "当前扩展页" }, "currentLanguage": { "message": "当前语言" }, "customGas": { - "message": "自定义 Gas" + "message": "自定义燃料" }, "customGasSubTitle": { "message": "提升费用可能会缩短处理时间,但不保证绝对有效。" @@ -269,17 +407,41 @@ "customRPC": { "message": "自定义 RPC" }, + "customSpendLimit": { + "message": "自定义消费限额" + }, "customToken": { "message": "自定义代币" }, + "dataBackupFoundInfo": { + "message": "您的部分账户数据已在之前安装的 MetaMask 时备份。其中可能包括您的设置、联系人和代币。您现在想恢复这些数据吗?" + }, "decimal": { - "message": "精确小数点" + "message": "小数精度" }, "decimalsMustZerotoTen": { "message": "小数位最小为0并且不超过36位." }, + "decrypt": { + "message": "解密" + }, + "decryptCopy": { + "message": "复制加密信息" + }, + "decryptInlineError": { + "message": "无法解密此消息,错误:$1" + }, + "decryptMessageNotice": { + "message": "$1 希望阅读此信息来完成您的操作。" + }, + "decryptMetamask": { + "message": "解密信息" + }, + "decryptRequest": { + "message": "解密请求" + }, "defaultNetwork": { - "message": "默认以太坊交易网络为主网。" + "message": "默认以太坊(Ether)交易网络为主网。" }, "delete": { "message": "删除" @@ -288,10 +450,10 @@ "message": "删除账户" }, "deleteNetwork": { - "message": "是否删除网络?" + "message": "删除网络?" }, "deleteNetworkDescription": { - "message": "您是否确认要删除该网络?" + "message": "是否确认要删除该网络?" }, "depositEther": { "message": "存入 Ether" @@ -303,7 +465,25 @@ "message": "直接存入 Ether" }, "directDepositEtherExplainer": { - "message": "如果你已经有了一些 Ether,通过直接转入是你的新钱包获取 Ether 的最快捷方式。" + "message": "如果您已经有了一些 Ether,最快捷的方法就是直接向新钱包存入 Ether。" + }, + "disconnect": { + "message": "断开" + }, + "disconnectAllAccounts": { + "message": "断开所有账户" + }, + "disconnectAllAccountsConfirmationDescription": { + "message": "您确定要断开连接吗?您可能会失去网站功能。" + }, + "disconnectPrompt": { + "message": "断开 $1" + }, + "disconnectThisAccount": { + "message": "断开此账户的连接" + }, + "dismiss": { + "message": "关闭" }, "done": { "message": "完成" @@ -311,14 +491,17 @@ "dontHaveAHardwareWallet": { "message": "没有硬件钱包?" }, + "dontShowThisAgain": { + "message": "不再显示" + }, "downloadGoogleChrome": { "message": "下载 Google Chrome 浏览器" }, "downloadSecretBackup": { - "message": "下载私密备份密语,并使用外部加密硬盘或存储媒介妥善保管。" + "message": "下载账户助记词,并将其安全保存在外部加密硬盘或存储介质上。" }, "downloadStateLogs": { - "message": "下载日志" + "message": "下载状态日志" }, "dropped": { "message": "丢弃" @@ -329,36 +512,48 @@ "editContact": { "message": "编辑联系人" }, + "editPermission": { + "message": "编辑权限" + }, + "encryptionPublicKeyNotice": { + "message": "$1 希望得到您的加密公钥。同意后该网站将可以想您发送加密信息。" + }, + "encryptionPublicKeyRequest": { + "message": "申请加密公钥" + }, "endOfFlowMessage1": { - "message": "您已通过测试 - 请妥善保管你的种子密语。这是您的责任!" + "message": "您通过了测试—— 保管好您的账户助记词,这是您的责任!" }, "endOfFlowMessage10": { "message": "全部完成" }, "endOfFlowMessage2": { - "message": "安全保存小技巧" + "message": "安全保存技巧" }, "endOfFlowMessage3": { "message": "在多处保存备份数据。" }, "endOfFlowMessage4": { - "message": "绝不向任何分享该密语。" + "message": "不向任何任何人分享该账户助记词。" }, "endOfFlowMessage5": { - "message": "谨防网络钓鱼!MetaMask 绝不会主动要求您提供个人种子密语。" + "message": "谨防网络钓鱼!MetaMask 绝不会主动要求您提供个人账户助记词。" }, "endOfFlowMessage6": { - "message": "如果您需要再次备份个人种子密语,请通过设置 -> 安全选项完成该操作。" + "message": "如果您需要再次备份账户助记词,请通过设置 -> 安全选项完成该操作。" }, "endOfFlowMessage7": { "message": "如果您仍存有疑问或发现任何可疑的地方,请发送电子邮件至 support@metamask.io 进行咨询。" }, "endOfFlowMessage8": { - "message": "MetaMask 无法恢复您的种子密语。了解更多。" + "message": "MetaMask 无法恢复您的账户助记词。" }, "endOfFlowMessage9": { "message": "了解详情。" }, + "endpointReturnedDifferentChainId": { + "message": "RPC 端点使用链不同的链 ID: $1" + }, "ensNotFoundOnCurrentNetwork": { "message": "未在当前网络找到 ENS 名称。请尝试切换至主以太坊网络。" }, @@ -368,20 +563,53 @@ "enterAnAlias": { "message": "输入别名" }, + "enterMaxSpendLimit": { + "message": "输入最高消费额度" + }, "enterPassword": { - "message": "请输入密码" + "message": "输入密码" }, "enterPasswordContinue": { - "message": "请输入密码以继续" + "message": "输入密码以继续" + }, + "errorCode": { + "message": "代码:$1" + }, + "errorDetails": { + "message": "错误详情" + }, + "errorMessage": { + "message": "信息:$1" + }, + "errorName": { + "message": "代码:$1" + }, + "errorPageMessage": { + "message": "请重新加载页面重试,或通过 support@metamask.io 联系支持。" + }, + "errorPagePopupMessage": { + "message": "请关闭并重新打开弹窗再试一次,或通过 support@metamask.io 联系支持。" + }, + "errorPageTitle": { + "message": "MetaMask 遇到了一个错误" + }, + "errorStack": { + "message": "栈:" }, "estimatedProcessingTimes": { - "message": "预估处理时间" + "message": "预计处理时间" + }, + "eth_accounts": { + "message": "查看您允许的账户的地址(必填)" }, "ethereumPublicAddress": { - "message": "以太坊公共地址" + "message": "以太坊 Ethereum 公开地址" + }, + "etherscan": { + "message": "Etherscan(以太坊浏览器)" }, "etherscanView": { - "message": "在 Etherscan 上查看账户" + "message": "在 Etherscan(以太坊浏览器)上查看账户" }, "expandView": { "message": "展开视图" @@ -389,62 +617,95 @@ "exportPrivateKey": { "message": "导出私钥" }, + "externalExtension": { + "message": "外部扩展" + }, + "extraApprovalGas": { + "message": "+$1 批准燃料" + }, "failed": { "message": "失败" }, + "failedToFetchChainId": { + "message": "无法获取链 IC,您的 RPC URL 地址是正确的么?" + }, + "failureMessage": { + "message": "出了点问题,我们无法完成这个操作。" + }, "fast": { "message": "快" }, + "fastest": { + "message": "最快" + }, + "feeAssociatedRequest": { + "message": "此请求需要支付一定的费用。" + }, "fiat": { - "message": "FIAT", - "description": "Exchange type" + "message": "FIAT" }, "fileImportFail": { - "message": "文件导入失败? 点击这里!", - "description": "Helps user import their account from a JSON file" + "message": "文件导入失败? 点击这里!" + }, + "forbiddenIpfsGateway": { + "message": "禁用的 IPFS 网关:请指定一个 CID 网关" }, "forgetDevice": { - "message": "取消保存此设备" + "message": "忘记此设备" }, "from": { - "message": "来自" + "message": "从" + }, + "fromAddress": { + "message": "从:$1" + }, + "functionApprove": { + "message": "功能:同意" }, "functionType": { "message": "功能类型" }, "gasLimit": { - "message": "Gas 上限" + "message": "燃料限制" }, "gasLimitInfoTooltipContent": { - "message": "Gas 上限是您个人希望付出的 Gas 数量上限。" + "message": "燃料限制是指您愿意花费的最燃料量单位。" }, "gasLimitTooLow": { - "message": "Gas 上限至少要 21000" + "message": "燃料限制至少要 21000" + }, + "gasLimitTooLowWithDynamicFee": { + "message": "燃料限制至少要 $1" }, "gasPrice": { - "message": "Gas 价格 (gwei)" + "message": "燃料价格(GWEI)" }, "gasPriceExtremelyLow": { - "message": "Gas 价格极低" + "message": "燃料价格极低" }, "gasPriceInfoTooltipContent": { - "message": "Gas 价格将详细列明每个付费 Gas 单位的以太币金额。" + "message": "燃料价格规定了您愿意为每单位燃料支付的 Ether 数量。" }, "gasUsed": { - "message": "已使用 Gas 量" + "message": "燃料使用" + }, + "gdprMessage": { + "message": "这些数据是汇总的,因此,根据《GDPR 通用数据保护条例》(EU)2016/679,这些数据是匿名的。有关我们隐私惯例的更多信息,请参见我们的 $1。" + }, + "gdprMessagePrivacyPolicy": { + "message": "隐私政策" }, "general": { "message": "通用" }, "generalSettingsDescription": { - "message": "货币兑换、主要货币、语言和块状身份头像" + "message": "货币转换、主要价格单位、语言和 Blockies Identicon 图标头像" }, "getEther": { "message": "获取 Ether" }, "getEtherFromFaucet": { - "message": "从水管获取$1网络的 Ether", - "description": "Displays network name for Ether faucet" + "message": "从水管获取 $1 网络的 Ether" }, "getHelp": { "message": "获取帮助。" @@ -456,26 +717,25 @@ "message": "Goerli 测试网络" }, "happyToSeeYou": { - "message": "我们很高兴与您见面。" + "message": "我们很高兴见到您。" }, "hardware": { "message": "硬件" }, "hardwareWalletConnected": { - "message": "已连接硬件钱包" + "message": "已连接的硬件钱包" }, "hardwareWallets": { "message": "连接硬件钱包" }, "hardwareWalletsMsg": { - "message": "请选择希望用于 MetaMask 的硬件钱包" + "message": "选择希望用于 MetaMask 的硬件钱包" }, "havingTroubleConnecting": { "message": "连接出现问题?" }, "here": { - "message": "这里", - "description": "as in -click here- for more information (goes with troubleTokenBalances)" + "message": "这里" }, "hexData": { "message": "十六进制数据" @@ -486,86 +746,131 @@ "hideTokenPrompt": { "message": "隐藏代币?" }, + "hideTokenSymbol": { + "message": "隐藏 $1" + }, "history": { "message": "历史记录" }, "import": { - "message": "导入", - "description": "Button to import an account from a selected file" + "message": "导入" }, "importAccount": { "message": "导入账户" }, + "importAccountMsg": { + "message": "导入的账户将不会与最初创建的 MetaMask 账户助记词相关联。了解更多有关导入账户的信息 。" + }, "importAccountSeedPhrase": { - "message": "使用种子密语导入账户" + "message": "使用账户助记词导入账户" }, "importUsingSeed": { - "message": "使用帐号种子密语导入" + "message": "使用账户助记词导入" }, "importWallet": { "message": "导入钱包" }, "importYourExisting": { - "message": "请使用 12 字种子密语导入现有钱包" + "message": "使用 12 个单词的账户助记词导入您现有的钱包账户。" }, "imported": { - "message": "已导入", - "description": "status showing that an account has been fully loaded into the keyring" + "message": "已导入" }, "infoHelp": { "message": "信息 & 帮助" }, "initialTransactionConfirmed": { - "message": "您的首次交易已通过网络完成确认。请点击“确定”返回。" + "message": "您的初始交易已通过网络确认。请点击“确定”返回。" }, "insufficientBalance": { "message": "余额不足。" }, "insufficientFunds": { - "message": "余额不足." + "message": "余额不足。" }, "insufficientTokens": { - "message": "代币余额不足." + "message": "代币余额不足。" }, "invalidAddress": { "message": "无效地址" }, "invalidAddressRecipient": { - "message": "收款地址不合法" + "message": "接收方地址无效" }, "invalidAddressRecipientNotEthNetwork": { - "message": "非 ETH 网络,设置为小写" + "message": "非 ETH 网络,请使用小写" }, "invalidBlockExplorerURL": { - "message": "无效 Block Explorer URI" + "message": "无效的区块浏览器 URL" + }, + "invalidChainIdTooBig": { + "message": "无效的链 ID,该链 ID 数字过大。" + }, + "invalidCustomNetworkAlertContent1": { + "message": "需要重新输入自定义网络'$1'的链 ID。" + }, + "invalidCustomNetworkAlertContent2": { + "message": "为了保护您免受恶意或有问题的网络提供商的侵害,现在所有的自定义网络都需要提供链 ID。" + }, + "invalidCustomNetworkAlertContent3": { + "message": "进入设置 > 网络并输入链 ID。您可以通过 $1 查找常用的链 ID。" + }, + "invalidCustomNetworkAlertTitle": { + "message": "无效的自定义网络" + }, + "invalidHexNumber": { + "message": "无效的十六进制数。" + }, + "invalidHexNumberLeadingZeros": { + "message": "无效的十六进制数。去除任何开头的零。" + }, + "invalidIpfsGateway": { + "message": "无效的 IPFS 网关。该值必须是一个有效的 URL" + }, + "invalidNumber": { + "message": "无效的数字。输入一个数字或‘0x’开头的十六进制数。" + }, + "invalidNumberLeadingZeros": { + "message": "无效的数字。去除任何开头的零。" }, "invalidRPC": { - "message": "无效 RPC URI" + "message": "无效 RPC URL" }, "invalidSeedPhrase": { - "message": "无效种子密语" + "message": "无效的账户助记词" + }, + "ipfsGateway": { + "message": "IPFS 网关" + }, + "ipfsGatewayDescription": { + "message": "输入用于 ENS 内容解析的 IPFS CID 网关的 URL。" }, "jsonFile": { - "message": "JSON 文件", - "description": "format for importing an account" + "message": "JSON 文件" }, "knownAddressRecipient": { - "message": "已知联系人地址。" + "message": "已知接收方地址。" + }, + "knownTokenWarning": { + "message": "此操作将编辑已经在您的钱包中列出的代币,有肯能被用来欺骗您。只有确定要更改这些代币的内容时,才通过此操作。" }, "kovan": { "message": "Kovan 测试网络" }, + "lastConnected": { + "message": "最后连接" + }, "learnMore": { - "message": "查看更多." + "message": "查看更多" }, "ledgerAccountRestriction": { - "message": "请在新增账户前,确认添加上一个账户。" + "message": "在添加新的账户之前,需要使用您的最后一个账户。" }, "letsGoSetUp": { - "message": "是的。立即开始设置!" + "message": "第一次,立即开始设置!" }, "likeToAddTokens": { - "message": "你想添加这些代币吗?" + "message": "您想添加这些代币吗?" }, "links": { "message": "链接" @@ -574,57 +879,110 @@ "message": "加载更多" }, "loading": { - "message": "加载中..." + "message": "加载中……" }, "loadingTokens": { - "message": "加载代币中..." + "message": "加载代币中……" + }, + "localhost": { + "message": "Localhost 8545" }, "lock": { "message": "锁定" }, + "lockTimeTooGreat": { + "message": "锁定时间过长" + }, "mainnet": { - "message": "以太坊主网络" + "message": "以太坊 Ethereum 主网络" }, "max": { "message": "最大" }, "memo": { - "message": "备忘录" + "message": "备忘" }, "memorizePhrase": { - "message": "记住该密语。" + "message": "记住该账户助记词。" }, "message": { "message": "消息" }, + "metaMaskConnectStatusParagraphOne": { + "message": "现在您可在 MetaMask 中对账户连接进行更多的控制。" + }, + "metaMaskConnectStatusParagraphThree": { + "message": "点击管理连接的账户。" + }, + "metaMaskConnectStatusParagraphTwo": { + "message": "连接状态按钮显示所访问的网站是否与您当前选择的账户连接。" + }, "metamaskDescription": { - "message": "MetaMask is a secure identity vault for Ethereum." + "message": "将您与 Ethereum 和去中心化网络连接起来。" + }, + "metamaskSwapsOfflineDescription": { + "message": "MetaMask Swaps 正在进行维护。请稍后访问。" }, "metamaskVersion": { "message": "MetaMask 版本" }, + "metametricsCommitmentsAllowOptOut": { + "message": "始终允许您通过设置选择退出" + }, + "metametricsCommitmentsBoldNever": { + "message": "从不" + }, + "metametricsCommitmentsIntro": { + "message": "MetaMask……" + }, + "metametricsCommitmentsNeverCollectIP": { + "message": "$1收集您的完整IP地址" + }, + "metametricsCommitmentsNeverCollectKeysEtc": { + "message": "$1收集密钥、地址、交易记录、余额、哈希或任何个人信息" + }, + "metametricsCommitmentsNeverSellDataForProfit": { + "message": "$1为利益而出售您的数据,永远不会!" + }, + "metametricsCommitmentsSendAnonymizedEvents": { + "message": "发送匿名的点击和页面浏览事件信息" + }, + "metametricsHelpImproveMetaMask": { + "message": "帮助我们让 MetaMask 变得更好" + }, + "metametricsOptInDescription": { + "message": "MetaMask 希望收集使用数据,以更好地了解我们的用户如何与扩展进行互动。这些数据将被用于持续改进我们产品和 Ethereum 生态系统的可用性和用户体验。" + }, "mobileSyncText": { "message": "请输入密码确认个人身份!" }, "mustSelectOne": { - "message": "至少选择一种代币." + "message": "至少选择 1 种代币。" + }, + "myAccounts": { + "message": "我的账户" }, "myWalletAccounts": { "message": "我的钱包账户" }, "myWalletAccountsDescription": { - "message": "所有已创建的 MetaMask 账户将自动添加到该部分。" + "message": "所有创建的 MetaMask 账户将自动添加到此部分。" }, "needEtherInWallet": { - "message": "使用 MetaMask 与 DAPP 交互,需要你的钱包里有 Ether。" + "message": "使用 MetaMask 与分布式应用交互,需要您的钱包里需要有 Ether。" }, "needImportFile": { - "message": "必须选择导入一个文件。", - "description": "User is important an account and needs to add a file to continue" + "message": "必须选择一个文件来导入。" + }, + "negativeETH": { + "message": "不能发负值的 ETH。" }, "networkName": { "message": "网络名称" }, + "networkSettingsChainIdDescription": { + "message": "链 ID 用于签署交易。它必须与网络返回的链 ID 相匹配。您可以输入十进制或'0x'前缀的十六进制数字,但我们将以十进制显示。" + }, "networkSettingsDescription": { "message": "添加和编辑自定义 RPC 网络" }, @@ -638,14 +996,13 @@ "message": "新账户" }, "newAccountDetectedDialogMessage": { - "message": "检测到新地址!请点击此处添加至您的地址簿。" + "message": "检测到新地址!点击添加至地址簿。" }, "newAccountNumberName": { - "message": "账户 $1", - "description": "Default name of next account to be created on create account screen" + "message": "账户 $1" }, "newContact": { - "message": "新增联系人" + "message": "新联系人" }, "newContract": { "message": "新合约" @@ -657,37 +1014,58 @@ "message": "新密码(至少 8 个字符)" }, "newToMetaMask": { - "message": "新增至 MetaMask?" + "message": "第一次使用 MetaMask?" }, "newTotal": { - "message": "新增合计" + "message": "新总额" }, "newTransactionFee": { - "message": "新增交易费用" + "message": "新交易费用" }, "next": { "message": "下一步" }, + "nextNonceWarning": { + "message": "Nonce 高于建议的 nouce 值 $1" + }, + "noAccountsFound": { + "message": "没找到查询的账户" + }, "noAddressForName": { - "message": "此 ENS 名字还没有指定地址。" + "message": "这个名字还没有设置地址。" }, "noAlreadyHaveSeed": { - "message": "不,我已经有一个种子密语了。" + "message": "不,我已经有一个账户助记词了。" }, "noConversionRateAvailable": { - "message": "无可用兑换率" + "message": "无可用转换率" + }, + "noThanks": { + "message": "不,谢谢" }, "noTransactions": { "message": "没有交易" }, "noWebcamFound": { - "message": "找不到您的个人电脑网络摄像头,请重试。" + "message": "未找到您的电脑摄像头。请重试。" }, "noWebcamFoundTitle": { - "message": "未找到网络摄像头" + "message": "未找到摄像头" + }, + "nonceField": { + "message": "自定义交易 nonce" + }, + "nonceFieldDescription": { + "message": "开启此功能可以改变确认屏幕上的 nonce(交易号)。此为高级功能,请谨慎使用。" + }, + "nonceFieldHeading": { + "message": "自定义 Nonce" + }, + "notCurrentAccount": { + "message": "这是正确的账户吗?这与您钱包中当前选择的账户不同。" }, "notEnoughGas": { - "message": "Gas 不足" + "message": "燃料不足" }, "ofTextNofM": { "message": "/" @@ -695,14 +1073,29 @@ "off": { "message": "关" }, + "offlineForMaintenance": { + "message": "脱机维护" + }, "ok": { - "message": "确认" + "message": "确定" }, "on": { "message": "启用" }, + "onboardingReturnNotice": { + "message": "“$1”会关闭此标签,直接回到 $2" + }, + "onlyAddTrustedNetworks": { + "message": "恶意的 Ethereum 以太坊网络提供商可以伪造区块链状态,并记录您的网络活动。只添加您信任的自定义网络。" + }, + "onlyAvailableOnMainnet": { + "message": "仅在主网(mainnet)上提供" + }, + "onlyConnectTrust": { + "message": "只连接您信任的网站。" + }, "optionalBlockExplorerUrl": { - "message": "屏蔽管理器 URL(选填)" + "message": "区块浏览器 URL(选填)" }, "optionalCurrencySymbol": { "message": "符号(选填)" @@ -732,15 +1125,26 @@ "message": "密码不匹配" }, "pastePrivateKey": { - "message": "请粘贴你的私钥:", - "description": "For importing an account from a private key" + "message": "请粘贴您的私钥:" }, "pending": { "message": "待处理" }, + "permissionCheckedIconDescription": { + "message": "您已同意该权限" + }, + "permissionUncheckedIconDescription": { + "message": "您还未同意该权限" + }, + "permissions": { + "message": "权限" + }, "personalAddressDetected": { "message": "检测到个人地址。请输入代币合约地址。" }, + "plusXMore": { + "message": "+ $1" + }, "prev": { "message": "上一个" }, @@ -748,39 +1152,50 @@ "message": "主要货币" }, "primaryCurrencySettingDescription": { - "message": "请选择“本地”,优先显示当地货币链价值(如 ETH )。请选择“法定”,优先显示选定法定货币价值。" + "message": "请选择“本地”,优先显示当地货币链价值(如 ETH )。选择“货币”则优先以所选货币作为价值显示单位。" }, "privacyMsg": { "message": "隐私政策" }, "privateKey": { - "message": "私钥", - "description": "select this type of file to use to import an account" + "message": "私钥" }, "privateKeyWarning": { - "message": "注意:永远不要公开这个私钥。任何拥有你的私钥的人都可以窃取你帐户中的任何资产。" + "message": "注意:永远不要公开这个私钥。任何拥有您的私钥的人都可以窃取您帐户中的任何资产。" }, "privateNetwork": { "message": "私有网络" }, + "proposedApprovalLimit": { + "message": "拟议的审批上限" + }, "protectYourKeys": { "message": "妥善保管您的密钥!" }, "protectYourKeysMessage1": { - "message": "请注意个人种子密语安全。报告显示有多个网站企图伪造 MetaMask。MetaMask 绝不会要求您提供个人种子密语!" + "message": "请注意个人账户助记词的安全。报告显示有多个网站企图伪造 MetaMask。MetaMask 绝不会要求您提供个人账户助记词!" }, "protectYourKeysMessage2": { - "message": "请妥善保管您的密语。如果您发现任何可疑的地方,或无法确认网络安全性,请发送电子邮件至 support@metamask.io 进行咨询" + "message": "请妥善保管您的账户助记词。如果您发现任何可疑的地方,或无法确认网络安全性,请发送电子邮件至 support@metamask.io 进行咨询" + }, + "provide": { + "message": "提供" }, "queue": { "message": "队列" }, + "queued": { + "message": "队列中" + }, "readdToken": { - "message": "之后你还可以通过帐户选项菜单中的“添加代币”来添加此代币。" + "message": "之后您还可以通过帐户选项菜单中的“添加代币”来添加此代币。" }, "readyToConnect": { "message": "是否准备连接?" }, + "receive": { + "message": "接收" + }, "recents": { "message": "最近记录" }, @@ -794,10 +1209,10 @@ "message": "拒绝" }, "rejectAll": { - "message": "拒绝所有" + "message": "拒绝全部" }, "rejectTxsDescription": { - "message": "您将指拒绝 $1 笔交易。" + "message": "您将批量拒绝 $1 笔交易。" }, "rejectTxsN": { "message": "拒绝 $1 笔交易" @@ -809,16 +1224,16 @@ "message": "稍后提醒" }, "remove": { - "message": "移除" + "message": "删除" }, "removeAccount": { - "message": "移除帐号" + "message": "删除账户" }, "removeAccountDescription": { - "message": "该账户已从您的钱包中删除。请在继续后续操作前,确认您是否已拥有该导入账户的原始种子密语或个人密钥。您可以通过账户下拉菜单再次导入或创建账户。" + "message": "该账户已从您的钱包中删除。请在继续后续操作前,确认您是否已拥有该导入账户的原始账户助记词或账户密钥。您可以通过账户下拉菜单再次导入或创建账户。" }, "requestsAwaitingAcknowledgement": { - "message": "等待确认的请求" + "message": "待确认的请求" }, "required": { "message": "必填" @@ -830,31 +1245,40 @@ "message": "重设账户" }, "resetAccountDescription": { - "message": "重置账户后,将清除您的个人交易历史记录。" + "message": "重置账户将清除您的交易历史记录。这不会改变您账户中的余额,也不会要求您重新输入账户助记词。" }, "restore": { "message": "恢复" }, "restoreAccountWithSeed": { - "message": "使用种子密语恢复个人账户" + "message": "使用账户助记词恢复您的账户" }, "restoreFromSeed": { "message": "从助记词还原" }, + "restoreWalletPreferences": { + "message": "已找到于 $1 的数据备份。您想恢复您的钱包设置吗?" + }, + "retryTransaction": { + "message": "重试交易" + }, + "reusedTokenNameWarning": { + "message": "此处的一个代币使用了与您关注的另一个代币的相同符号,这可能会让人感到困惑或欺骗。" + }, "revealSeedWords": { - "message": "显示助记词" + "message": "显示账户助记词" }, "revealSeedWordsDescription": { - "message": "如果您更换浏览器或计算机,则需要使用此助记词访问您的帐户。请将它们保存在安全秘密的地方。" + "message": "如果您更换浏览器或计算机,则需要使用此账户助记词访问您的帐户。请将它们保存在安全秘密的地方。" }, "revealSeedWordsTitle": { - "message": "助记词" + "message": "账户助记词" }, "revealSeedWordsWarning": { - "message": "助记词可以用来窃取您的所有帐户." + "message": "该账户助记词可以用来窃取您的所有帐户" }, "revealSeedWordsWarningTitle": { - "message": "不要对任何人展示助记词!" + "message": "不要对任何人展示此账户助记词!" }, "rinkeby": { "message": "Rinkeby 测试网络" @@ -869,17 +1293,23 @@ "message": "保存" }, "saveAsCsvFile": { - "message": "另存为CSV文件" + "message": "保存为 CSV 文件" }, "scanInstructions": { - "message": "请将二维码置于镜头前" + "message": "将二维码放在相机前" }, "scanQrCode": { "message": "扫描二维码" }, + "scrollDown": { + "message": "向下滚动" + }, "search": { "message": "搜索" }, + "searchAccounts": { + "message": "搜索账户" + }, "searchResults": { "message": "搜索结果" }, @@ -887,43 +1317,52 @@ "message": "搜索代币" }, "secretBackupPhrase": { - "message": "私密备份密语" + "message": "账户助记词" }, "secretBackupPhraseDescription": { - "message": "您的个人私密备份密语可以帮助您轻松备份和恢复个人账户。" + "message": "您的账户助记词可以帮助您轻松备份和恢复个人账户。" }, "secretBackupPhraseWarning": { - "message": "警告:切勿向他人透露您的备份密语。任何人一旦持有该密语,即可取走您的以太币。" + "message": "警告:切勿向他人透露您的账户助记词。任何人一旦持有该账户助记词,即可控制您的 Ether。" }, "secretPhrase": { - "message": "输入12位助记词以恢复金库." + "message": "输入 12 个单词组成的账户助记词恢复您的账户。" }, "securityAndPrivacy": { "message": "安全与隐私" }, "securitySettingsDescription": { - "message": "隐私设置和钱包种子密语" + "message": "隐私设置和账户助记词" }, "seedPhrasePlaceholder": { "message": "用空格分隔每个单词" }, + "seedPhrasePlaceholderPaste": { + "message": "从剪贴板粘贴账户助记词" + }, "seedPhraseReq": { - "message": "助记词为12个单词" + "message": "账户助记词由 12、15、18、21 或 24 个单词组成" }, "selectAHigherGasFee": { - "message": "请选择价格稍高的 Gas 费,以加快交易处理速度。*" + "message": "选择更高的燃料费用,提高交易处理速度。*" }, - "selectAnAccount": { + "selectAccounts": { "message": "选择账户" }, + "selectAll": { + "message": "全部选择" + }, + "selectAnAccount": { + "message": "选择一个账户" + }, "selectAnAccountHelp": { - "message": "请通过 MetaMask 选择需要查看的账户" + "message": "选择在 MetaMask 中查看的账户" }, "selectCurrency": { "message": "选择货币" }, "selectEachPhrase": { - "message": "请选择每一个单词,以确保单词正确性。" + "message": "请选择每个单词,以确保其正确性。" }, "selectHdPath": { "message": "选择 HD 路径" @@ -937,20 +1376,26 @@ "selectType": { "message": "选择类型" }, + "selectingAllWillAllow": { + "message": "选择全部将允许本网站查看您当前的所有账户。确保您信任这个网站。" + }, "send": { "message": "发送" }, "sendAmount": { - "message": "发送金额" + "message": "发送数额" }, "sendETH": { "message": "发送 ETH" }, + "sendSpecifiedTokens": { + "message": "发送 $1" + }, "sendTokens": { "message": "发送代币" }, "sentEther": { - "message": "以太币已发送" + "message": "发送 Ether" }, "separateEachWord": { "message": "用空格分隔每个单词" @@ -959,10 +1404,10 @@ "message": "设置" }, "showAdvancedGasInline": { - "message": "高级 Gas 控制" + "message": "高级燃料控制" }, "showAdvancedGasInlineDescription": { - "message": "请选择该选项,直接在发送和确认页面显示 Gas 价格和限制管理。" + "message": "在发送和确认界面显示燃料价格和燃料限制设置选项。" }, "showFiatConversionInTestnets": { "message": "在 Testnets 上显示兑换率" @@ -976,9 +1421,21 @@ "showHexDataDescription": { "message": "请选择该选项,在发送页面显示十六进制数据字域" }, + "showIncomingTransactions": { + "message": "显示收到的交易" + }, + "showIncomingTransactionsDescription": { + "message": "选择该选项可使用 Etherscan(以太坊浏览器)(以太坊浏览器)在交易列表中显示收到的交易。" + }, + "showPermissions": { + "message": "显示权限" + }, "showPrivateKeys": { "message": "显示私钥" }, + "showSeedPhrase": { + "message": "显示账户助记词" + }, "sigRequest": { "message": "请求签名" }, @@ -986,11 +1443,14 @@ "message": "签名" }, "signNotice": { - "message": "签署此消息可能会产生危险的副作用。 \n只从你完全信任的网站上签名。 未来的版本将移除这种危险的方法。" + "message": "签署此消息可能会产生危险的副作用。 \n只从您完全信任的网站上签名。 未来的版本将移除这种危险的方法。" }, "signatureRequest": { "message": "请求签名" }, + "signatureRequest1": { + "message": "信息" + }, "signed": { "message": "已签名" }, @@ -998,7 +1458,7 @@ "message": "慢" }, "somethingWentWrong": { - "message": "哎呀!出问题了。" + "message": "糟糕!出问题了。" }, "speedUp": { "message": "加速" @@ -1009,35 +1469,65 @@ "speedUpTransaction": { "message": "加速该交易操作" }, + "spendLimitAmount": { + "message": "消费限额数量" + }, + "spendLimitInsufficient": { + "message": "消费限额不足" + }, + "spendLimitInvalid": { + "message": "消费限制无效,必须是正数。" + }, + "spendLimitPermission": { + "message": "消费限制权限" + }, + "spendLimitRequestedBy": { + "message": "消费限制申请来自 $1" + }, + "spendLimitTooLarge": { + "message": "消费限制过大" + }, "stateLogError": { "message": "检索状态日志时出错。" }, + "stateLogFileName": { + "message": "MetaMask 状态日志" + }, "stateLogs": { "message": "状态日志" }, "stateLogsDescription": { "message": "状态日志包含您的账户地址和已发送的交易。" }, + "statusConnected": { + "message": "已连接" + }, + "statusNotConnected": { + "message": "未连接" + }, "step1HardwareWallet": { "message": "1. 连接硬件钱包" }, "step1HardwareWalletMsg": { - "message": "直接将您的硬件钱包与个人电脑相连。" + "message": "将您的硬件钱包直接连接到电脑上。" }, "step2HardwareWallet": { "message": "2. 选择账户" }, "step2HardwareWalletMsg": { - "message": "请选择您想查看的账户。每次仅限选择一个。" + "message": "请选择您想查看的账户。每次只能选择一个账户。" }, "step3HardwareWallet": { - "message": "3. 开始体验 dApps 和更多功能!" + "message": "3. 开始使用 web3 站点和更多功能!" }, "step3HardwareWalletMsg": { - "message": "使用您的硬件钱包,操作与以太坊账户制作相同。登录 dApps,发送 ETH ,购买和保存 ERC20 代币和非同质化代币如 CryptoKitties。" + "message": "使用您的硬件钱包,操作与以太坊账户制作相同。登录 dApps,发送 ETH ,购买和保存 ERC20 代币和诸如 CryptoKitties 等不可替代代币。" }, "storePhrase": { - "message": "通过如 1Password 等密码管家保存该密语。" + "message": "通过如 1Password 等密码管理工具保存该账户助记词。" + }, + "submit": { + "message": "提交" }, "submitted": { "message": "已提交" @@ -1045,20 +1535,287 @@ "supportCenter": { "message": "访问我们的支持中心" }, + "swap": { + "message": "兑换 Swap" + }, + "swapAdvancedSlippageInfo": { + "message": "如果价格在您下单和确认之间发生变化,这就叫做“滑点”。如果滑点超过您的“最大滑点”设置,您的的兑换将自动取消。" + }, + "swapAggregator": { + "message": "聚合商" + }, + "swapAmountReceived": { + "message": "保证数额" + }, + "swapAmountReceivedInfo": { + "message": "这是您将收到的最低数额。根据滑点值, 您可能会收到更多。" + }, + "swapApproval": { + "message": "批准 $1 的兑换 " + }, + "swapApproveNeedMoreTokens": { + "message": "您还需 $1 $2 来完成这笔兑换" + }, + "swapBetterQuoteAvailable": { + "message": "有一个可用的更优报价" + }, + "swapBuildQuotePlaceHolderText": { + "message": "没有匹配的代币符合 $1" + }, + "swapCheckingQuote": { + "message": "正在检查 $1" + }, + "swapCustom": { + "message": "自定义" + }, + "swapDecentralizedExchange": { + "message": "去中心化交易所" + }, + "swapEditLimit": { + "message": "修改限制" + }, + "swapEnableDescription": { + "message": "这是必须的,并且允许 MetaMask 兑换您的 $1。" + }, + "swapEstimatedNetworkFee": { + "message": "预计网络手续费" + }, + "swapEstimatedNetworkFeeSummary": { + "message": "“$1”是我们预计的实际产生费用。具体数额视网络情况而定。" + }, + "swapEstimatedNetworkFees": { + "message": "预计网络手续费" + }, + "swapEstimatedNetworkFeesInfo": { + "message": "这是预估的用于完成您的兑换所使用的网络手续费。实际数额可能会根据网络条件而变化。" + }, + "swapFailedErrorDescription": { + "message": "您的资金是安全的,仍然可以在您的钱包中使用。" + }, + "swapFailedErrorTitle": { + "message": "兑换失败" + }, + "swapFetchingQuotesErrorDescription": { + "message": "呃……出错了。再试一次,如果错误仍存在,请联系客户支持。" + }, + "swapFetchingQuotesErrorTitle": { + "message": "获取报价出错" + }, + "swapFetchingTokens": { + "message": "获取代币中……" + }, + "swapFinalizing": { + "message": "确定中……" + }, + "swapGetQuotes": { + "message": "获取报价" + }, + "swapHighSlippageWarning": { + "message": "滑点数量非常大。确保您知道您的操作!" + }, + "swapIntroLearnMoreHeader": { + "message": "想了解更多信息?" + }, + "swapIntroLearnMoreLink": { + "message": "了解更多关于 MetaMask Swap(兑换)" + }, + "swapIntroLiquiditySourcesLabel": { + "message": "流动资金来源包括:" + }, + "swapIntroPopupSubTitle": { + "message": "现在您可以直接在 MetaMask 钱包中兑换代币。MetaMask Swaps(兑换)结合了多个去中心化交易所聚合商、专业做市商和个人 DEX,确保 MetaMask 用户始终以最低的网络费用获得最佳价格。" + }, + "swapIntroPopupTitle": { + "message": "代币兑换来了!" + }, + "swapLearnMoreContractsAuditReview": { + "message": "查看我们的官方合约审计" + }, + "swapLowSlippageError": { + "message": "交易可能失败,最大滑点过低。" + }, + "swapMaxNetworkFeeInfo": { + "message": "“$1”是您最多所话费的数量,当网络不稳定时,这可能是一个大的数额。" + }, + "swapMaxNetworkFees": { + "message": "最大网络手续费" + }, + "swapMaxSlippage": { + "message": "最大滑点" + }, + "swapMetaMaskFee": { + "message": "MetaMask 手续费" + }, + "swapMetaMaskFeeDescription": { + "message": "我们每次都能从顶级流动性资源中找到最好的价格。每次报价都会自动收取1%的手续费用,以支持 MetaMask 的持续发展,使其更加完善。" + }, + "swapNQuotes": { + "message": "$1 个报价" + }, + "swapNetworkFeeSummary": { + "message": "网络手续费包括处理您的兑换和在以太坊(Ethereum)网络上存储的成本。MetaMask 不从这笔费用中获利。" + }, + "swapNewQuoteIn": { + "message": "$1 后更新报价" + }, + "swapOnceTransactionHasProcess": { + "message": "一旦交易完成,您的 $1 将被添加到您的账户中。" + }, + "swapPriceDifference": { + "message": "您将兑换 $1 $2(~$3)为 $4 $5(~$6)。" + }, + "swapPriceDifferenceTitle": { + "message": "价格差异 ~$1%" + }, + "swapPriceDifferenceTooltip": { + "message": "市场价格的差异可能受到中介机构收取的费用、市场规模、交易规模或市场效率低下的影响。" + }, + "swapPriceDifferenceUnavailable": { + "message": "市场价格不可用。 请确认您对退回的数额感到满意后再继续。" + }, + "swapProcessing": { + "message": "处理中" + }, + "swapQuoteDetails": { + "message": "报价详情" + }, + "swapQuoteDetailsSlippageInfo": { + "message": "如果在您下订单和确认订单之间的价格发生了变化,这就叫做\"滑点\"。如果滑点超过您的\"最大滑点\"设置,您的兑换将自动取消。" + }, + "swapQuoteIncludesRate": { + "message": "报价包含 $1% MetaMask 手续费" + }, + "swapQuoteNofN": { + "message": "报价 $1 / $2" + }, + "swapQuoteSource": { + "message": "报价来源" + }, + "swapQuotesAreRefreshed": { + "message": "报价会经常刷新,以反映当前的市场状况。" + }, + "swapQuotesExpiredErrorDescription": { + "message": "请请求新的报价,以获得最新的价格。" + }, + "swapQuotesExpiredErrorTitle": { + "message": "报价超时" + }, + "swapQuotesNotAvailableErrorDescription": { + "message": "尝试调整滑点数量设置,并再试一次。" + }, + "swapQuotesNotAvailableErrorTitle": { + "message": "无可用报价" + }, + "swapRate": { + "message": "费率" + }, + "swapReceiving": { + "message": "接收" + }, + "swapReceivingInfoTooltip": { + "message": "这是一个预估数额。确切的数额取决于滑点。" + }, + "swapRequestForQuotation": { + "message": "请求报价" + }, + "swapSearchForAToken": { + "message": "搜索代币" + }, + "swapSelect": { + "message": "选择" + }, + "swapSelectAQuote": { + "message": "选择一个报价" + }, + "swapSelectAToken": { + "message": "选择一个代币" + }, + "swapSelectQuotePopoverDescription": { + "message": "以下是从多个流动资金来源收集到的所有报价。" + }, + "swapSlippageTooLow": { + "message": "滑点必须大于零" + }, + "swapSource": { + "message": "流动资金来源" + }, + "swapSourceInfo": { + "message": "我们搜索多个流动性来源(交易所、聚合商和专业做市商),以找到最好的利率和最低的网络手续费。" + }, + "swapStartSwapping": { + "message": "开始兑换" + }, + "swapSwapFrom": { + "message": "兑换自" + }, + "swapSwapSwitch": { + "message": "切换兑换代币方向" + }, + "swapSwapTo": { + "message": "兑换到" + }, + "swapThisWillAllowApprove": { + "message": "这样将允许 $1 用于兑换。" + }, + "swapTokenAvailable": { + "message": "您的 $1 已添加到您的账户。" + }, + "swapTokenToToken": { + "message": "兑换 $1 到 $2" + }, + "swapTransactionComplete": { + "message": "交易完成" + }, + "swapUnknown": { + "message": "未知的" + }, + "swapUsingBestQuote": { + "message": "使用最好的报价" + }, + "swapVerifyTokenExplanation": { + "message": "多个代币可以使用相同的名称和符号。检查 Etherscan(以太坊浏览器)以确认这是您正在寻找的代币。" + }, + "swapViewToken": { + "message": "查看 $1" + }, + "swapYourTokenBalance": { + "message": "$1 $2 可用" + }, + "swapZeroSlippage": { + "message": "0% 滑点" + }, + "swapsAdvancedOptions": { + "message": "高级选项" + }, + "swapsExcessiveSlippageWarning": { + "message": "滑点数额太高,会导致不良率。请将滑点设置降低到 15% 以下。" + }, + "swapsMaxSlippage": { + "message": "最大滑点" + }, + "swapsNotEnoughForTx": { + "message": "没有足够的 $1 来完成此交易" + }, + "swapsViewInActivity": { + "message": "在活动中查看" + }, "switchNetworks": { "message": "切换网络" }, + "switchToThisAccount": { + "message": "切换到该账户" + }, "symbol": { "message": "符号" }, "symbolBetweenZeroTwelve": { - "message": "符号不得超过11个字符。" + "message": "符号不得超过 11 个字符。" }, "syncWithMobile": { - "message": "使用移动设备进行同步" + "message": "使用移动设备同步" }, "syncWithMobileBeCareful": { - "message": "扫描编码时,请确保身边无其他人正在查看您的显示页面" + "message": "扫描这个代码时,请确保附近没有其他人在看您的屏幕。" }, "syncWithMobileComplete": { "message": "您的数据已同步成功。尽情体验 MetaMask 应用程序!" @@ -1070,134 +1827,178 @@ "message": "如果您是首次启用 MetaMask 移动应用程序,请通过个人手机完成如下操作。" }, "syncWithMobileScanThisCode": { - "message": "使用 MetaMask 应用程序扫描编码" + "message": "使用 MetaMask 应用程序扫描代码" }, "syncWithMobileTitle": { "message": "使用移动设备进行同步" }, + "syncWithThreeBox": { + "message": "使用 3Box 同步数据(实验功能)" + }, + "syncWithThreeBoxDescription": { + "message": "开启后可以用 3Box 备份您的设置。此功能目前是实验功能,使用时风险自负。" + }, + "syncWithThreeBoxDisabled": { + "message": "由于初始同步过程中出现错误,3Box 已被禁用。" + }, "terms": { "message": "使用条款" }, + "termsOfService": { + "message": "服务条款" + }, "testFaucet": { "message": "测试水管" }, "thisWillCreate": { - "message": "该操作将为您创建新钱包和种子密语" + "message": "将为您创建新的钱包账户和账户助记词" }, "tips": { - "message": "赏金" + "message": "小贴士" }, "to": { "message": "至" }, + "toAddress": { + "message": "至:$1" + }, + "toWithColon": { + "message": "至:" + }, "token": { "message": "代币" }, "tokenAlreadyAdded": { - "message": "代币已经被添加." + "message": "代币已添加。" }, "tokenContractAddress": { "message": "代币合约地址" }, + "tokenOptions": { + "message": "代币选项" + }, "tokenSymbol": { "message": "代币符号" }, "total": { - "message": "总量" + "message": "总额" }, "transaction": { "message": "交易" }, "transactionCancelAttempted": { - "message": "在 $2 尝试取消交易,其 Gas 费为 $1" + "message": "尝试取消交易 $2,燃料费用:$1。" }, "transactionCancelSuccess": { - "message": "成功在 $2 取消交易单" + "message": "取消交易成功 $2。" }, "transactionConfirmed": { - "message": "交易已通过 $2 确认。" + "message": "交易已确认 $2。" }, "transactionCreated": { - "message": "在 $2 生成的交易单,其交易额为 $1 。" + "message": "交易已创建 $2,交易数额:$1。" }, "transactionDropped": { - "message": "在 $2 终止的交易单。" + "message": "交易终止 $2。" }, "transactionError": { - "message": "交易出错. 合约代码执行异常." + "message": "交易出错。合约代码执行异常。" }, "transactionErrorNoContract": { - "message": "正在尝试调用非联系人地址功能。" + "message": "试图在一个非合约地址上调用一个函数。" }, "transactionErrored": { - "message": "交易报错。" + "message": "交易出现错误。" }, "transactionFee": { "message": "交易费" }, "transactionResubmitted": { - "message": "在 $2 重新提交的交易单,其 Gas 费用增加至 $1" + "message": "重新提交交易 $2,交易费升至:$1。" }, "transactionSubmitted": { - "message": "在 $2 提交的交易单,其 Gas 费用为 $1 。" + "message": "交易已提交 $2,交易费:$1。" }, "transactionUpdated": { - "message": "交易单已于 $2 更新。" + "message": "交易更新时间 $2。" }, "transfer": { "message": "转账" }, "transferBetweenAccounts": { - "message": "在个人账户间转账" + "message": "在我的账户间转账" }, "transferFrom": { - "message": "转出" + "message": "转自" + }, + "troubleConnectingToWallet": { + "message": "我们在连接您的 $1 遇到问题,尝试检查 $2 并重试。" }, "troubleTokenBalances": { - "message": "我们无法加载您的代币余额。你可以查看它们", - "description": "Followed by a link (here) to view token balances" + "message": "我们无法加载您的代币余额。您可以查看它们" + }, + "trustSiteApprovePermission": { + "message": "您信任这个网站吗?授权即表示您允许 $1 提取您的 $2,并为您自动进行交易。" }, "tryAgain": { "message": "重试" }, "typePassword": { - "message": "输入你的密码" + "message": "输入您的 MetaMask 密码" }, "unapproved": { "message": "未批准" }, "units": { - "message": "单位" + "message": "数量" }, "unknown": { "message": "未知" }, "unknownCameraError": { - "message": "尝试获取相机使用权限时报错。请重试…" + "message": "尝试获取相机使用权限时报错。请重试……" }, "unknownCameraErrorTitle": { - "message": "哎呀!出问题了…" + "message": "哎呀!出问题了……" }, "unknownNetwork": { - "message": "未知私有网络" + "message": "未知的私有网络" }, "unknownQrCode": { - "message": "错误:我们无法识别该二维码" + "message": "错误:无法识别该二维码" + }, + "unlimited": { + "message": "无限制" }, "unlock": { "message": "解锁" }, "unlockMessage": { - "message": "分散网络待命中" + "message": "即将进入去中心化网络" }, "updatedWithDate": { "message": "已更新 $1" }, + "urlErrorMsg": { + "message": "URL 需要相应的 HTTP/HTTPS 前缀。" + }, + "urlExistsErrorMsg": { + "message": "URL 已经存在于现有的网络列表中" + }, + "usePhishingDetection": { + "message": "使用网络钓鱼检测" + }, + "usePhishingDetectionDescription": { + "message": "显示针对 Ethereum 用户钓鱼域名的警告。" + }, "usedByClients": { "message": "可用于各种不同的客户端" }, "userName": { - "message": "用户名" + "message": "名称" + }, + "verifyThisTokenOn": { + "message": "在 $1 上验证此代币" }, "viewAccount": { "message": "查看账户" @@ -1209,39 +2010,51 @@ "message": "在 $1 查看" }, "viewOnEtherscan": { - "message": "在 Etherscan 上查看" + "message": "在 Etherscan(以太坊浏览器)上查看" }, "viewinExplorer": { - "message": "在管理器中查看" + "message": "在浏览器中查看" }, "visitWebSite": { "message": "访问我们的网站" }, + "walletConnectionGuide": { + "message": "我们的硬件钱包连接指南" + }, "walletSeed": { - "message": "钱包助记词" + "message": "账户助记词" + }, + "web3ShimUsageNotification": { + "message": "我们发现当前的网站尝试使用已经删除的 window.web3 API。如果这个网站网站已经无法正常使用,请点击 $1 获取更多信息。" }, "welcome": { - "message": "欢迎使用 MetaMask 测试版" + "message": "欢迎使用 MetaMask" }, "welcomeBack": { "message": "欢迎回来!" }, + "whatsThis": { + "message": "这是什么?" + }, "writePhrase": { - "message": "请将该密语记录在纸上,并保存在安全的地方。如果希望提升信息安全性,请将信息记录在多张纸上,并分别保存在 2 - 3 个不同的地方。" + "message": "请将该账户助记词记录在纸上,并保存在安全的地方。如果希望提升信息安全性,请将信息记录在多张纸上,并分别保存在 2 - 3 个不同的地方。" + }, + "xOfY": { + "message": "$1 / $2" }, "yesLetsTry": { - "message": "没错。不妨一试" + "message": "是的,尝试下" }, "youNeedToAllowCameraAccess": { - "message": "您需要开启相机访问权限,才能使用该功能。" + "message": "需要开启相机访问权限,才能使用该功能。" }, "youSign": { "message": "正在签名" }, "yourPrivateSeedPhrase": { - "message": "你的私有助记词" + "message": "您的账户助记词" }, "zeroGasPriceOnSpeedUpError": { - "message": "Gas 价格加速上涨" + "message": "加速时无燃料价格" } } From 91aaa8c5409ca24ae4a3761e3ccff9ff933e501c Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 9 Feb 2021 13:56:16 -0330 Subject: [PATCH 11/11] Fix locale lint errors (#10410) The updates to `zh_CN` merged in #9388 were a fair bit behind the `develop` branch, so they ended up introducing various lint failures despite passing on CI on the PR. The localized messages have been updated to include English descriptions, and one extraneous message has been removed. --- app/_locales/zh_CN/messages.json | 258 ++++++++++++++++++++----------- 1 file changed, 170 insertions(+), 88 deletions(-) diff --git a/app/_locales/zh_CN/messages.json b/app/_locales/zh_CN/messages.json index 707c59cb1..864aac504 100644 --- a/app/_locales/zh_CN/messages.json +++ b/app/_locales/zh_CN/messages.json @@ -9,10 +9,12 @@ "message": "* 设定更高燃料价格,可以加快交易完成进度,提高网络快速处理机率,但无法保证每次均能够实现提速。" }, "acceptTermsOfUse": { - "message": "我已阅读并同意 $1" + "message": "我已阅读并同意 $1", + "description": "$1 is the `terms` message" }, "accessAndSpendNotice": { - "message": "$1 可以访问并使用此最大数额" + "message": "$1 可以访问并使用此最大数额", + "description": "$1 is the url of the site requesting ability to spend" }, "accessingYourCamera": { "message": "正在获取您的相机……" @@ -111,28 +113,33 @@ "message": "允许这个外部扩展到:" }, "allowOriginSpendToken": { - "message": "允许 $1 使用您的 $2?" + "message": "允许 $1 使用您的 $2?", + "description": "$1 is the url of the site and $2 is the symbol of the token they are requesting to spend" }, "allowThisSiteTo": { "message": "允许本网站:" }, "allowWithdrawAndSpend": { - "message": "允许 $1 提取和最多消费以下数额:" + "message": "允许 $1 提取和最多消费以下数额:", + "description": "The url of the site that requested permission to 'withdraw and spend'" }, "amount": { "message": "数额" }, "amountInEth": { - "message": "$1 ETH" + "message": "$1 ETH", + "description": "Displays an eth amount to the user. $1 is a decimal number" }, "amountWithColon": { "message": "数额:" }, "appDescription": { - "message": "以太坊浏览器插件" + "message": "以太坊浏览器插件", + "description": "The description of the application" }, "appName": { - "message": "MetaMask" + "message": "MetaMask", + "description": "The name of the application" }, "approvalAndAggregatorTxFeeCost": { "message": "批准聚合商网络手续费" @@ -144,7 +151,8 @@ "message": "批准消费限额" }, "approveSpendLimit": { - "message": "批准 $1 消费限额" + "message": "批准 $1 消费限额", + "description": "The token symbol that is being approved" }, "approved": { "message": "已批准" @@ -207,7 +215,8 @@ "message": "区块浏览器" }, "blockExplorerView": { - "message": "通过 $1 查看账户" + "message": "通过 $1 查看账户", + "description": "$1 replaced by URL for custom block explorer" }, "blockiesIdenticon": { "message": "使用 Blockies Identicon 图标头像" @@ -282,25 +291,31 @@ "message": "手动连接到当前站点" }, "connectTo": { - "message": "连接到 $1" + "message": "连接到 $1", + "description": "$1 is the name/origin of a web3 site/application that the user can connect to metamask" }, "connectToAll": { - "message": "连接到您的全部$1" + "message": "连接到您的全部$1", + "description": "$1 will be replaced by the translation of connectToAllAccounts" }, "connectToAllAccounts": { - "message": "账户" + "message": "账户", + "description": "will replace $1 in connectToAll, completing the sentence 'connect to all of your accounts', will be text that shows list of accounts on hover" }, "connectToMultiple": { - "message": "连接到 $1" + "message": "连接到 $1", + "description": "$1 will be replaced by the translation of connectToMultipleNumberOfAccounts" }, "connectToMultipleNumberOfAccounts": { - "message": "$1 个账户" + "message": "$1 个账户", + "description": "$1 is the number of accounts to which the web3 site/application is asking to connect; this will substitute $1 in connectToMultiple" }, "connectWithMetaMask": { "message": "使用 MetaMask 连接" }, "connectedAccountsDescriptionPlural": { - "message": "您有 $1 个账户连接到了该网站。" + "message": "您有 $1 个账户连接到了该网站。", + "description": "$1 is the number of accounts" }, "connectedAccountsDescriptionSingular": { "message": "您有 1 个账户连接到了该网站。" @@ -312,10 +327,12 @@ "message": "已连接的网站" }, "connectedSitesDescription": { - "message": "$1 已连接到这些网站。他们可以查看您的账户地址。" + "message": "$1 已连接到这些网站。他们可以查看您的账户地址。", + "description": "$1 is the account name" }, "connectedSitesEmptyDescription": { - "message": "$1 还没连接任何网站。" + "message": "$1 还没连接任何网站。", + "description": "$1 is the account name" }, "connecting": { "message": "连接中……" @@ -429,10 +446,12 @@ "message": "复制加密信息" }, "decryptInlineError": { - "message": "无法解密此消息,错误:$1" + "message": "无法解密此消息,错误:$1", + "description": "$1 is error message" }, "decryptMessageNotice": { - "message": "$1 希望阅读此信息来完成您的操作。" + "message": "$1 希望阅读此信息来完成您的操作。", + "description": "$1 is the web3 site name" }, "decryptMetamask": { "message": "解密信息" @@ -516,7 +535,8 @@ "message": "编辑权限" }, "encryptionPublicKeyNotice": { - "message": "$1 希望得到您的加密公钥。同意后该网站将可以想您发送加密信息。" + "message": "$1 希望得到您的加密公钥。同意后该网站将可以想您发送加密信息。", + "description": "$1 is the web3 site name" }, "encryptionPublicKeyRequest": { "message": "申请加密公钥" @@ -552,7 +572,8 @@ "message": "了解详情。" }, "endpointReturnedDifferentChainId": { - "message": "RPC 端点使用链不同的链 ID: $1" + "message": "RPC 端点使用链不同的链 ID: $1", + "description": "$1 is the return value of eth_chainId from an RPC endpoint" }, "ensNotFoundOnCurrentNetwork": { "message": "未在当前网络找到 ENS 名称。请尝试切换至主以太坊网络。" @@ -573,34 +594,43 @@ "message": "输入密码以继续" }, "errorCode": { - "message": "代码:$1" + "message": "代码:$1", + "description": "Displayed error code for debugging purposes. $1 is the error code" }, "errorDetails": { - "message": "错误详情" + "message": "错误详情", + "description": "Title for collapsible section that displays error details for debugging purposes" }, "errorMessage": { - "message": "信息:$1" + "message": "信息:$1", + "description": "Displayed error message for debugging purposes. $1 is the error message" }, "errorName": { - "message": "代码:$1" + "message": "代码:$1", + "description": "Displayed error name for debugging purposes. $1 is the error name" }, "errorPageMessage": { - "message": "请重新加载页面重试,或通过 support@metamask.io 联系支持。" + "message": "请重新加载页面重试,或通过 support@metamask.io 联系支持。", + "description": "Message displayed on generic error page in the fullscreen or notification UI" }, "errorPagePopupMessage": { - "message": "请关闭并重新打开弹窗再试一次,或通过 support@metamask.io 联系支持。" + "message": "请关闭并重新打开弹窗再试一次,或通过 support@metamask.io 联系支持。", + "description": "Message displayed on generic error page in the popup UI" }, "errorPageTitle": { - "message": "MetaMask 遇到了一个错误" + "message": "MetaMask 遇到了一个错误", + "description": "Title of generic error page" }, "errorStack": { - "message": "栈:" + "message": "栈:", + "description": "Title for error stack, which is displayed for debugging purposes" }, "estimatedProcessingTimes": { "message": "预计处理时间" }, "eth_accounts": { - "message": "查看您允许的账户的地址(必填)" + "message": "查看您允许的账户的地址(必填)", + "description": "The description for the `eth_accounts` permission" }, "ethereumPublicAddress": { "message": "以太坊 Ethereum 公开地址" @@ -621,7 +651,8 @@ "message": "外部扩展" }, "extraApprovalGas": { - "message": "+$1 批准燃料" + "message": "+$1 批准燃料", + "description": "Expresses an additional gas amount the user will have to pay, on top of some other displayed amount. $1 is a decimal amount of gas" }, "failed": { "message": "失败" @@ -642,10 +673,12 @@ "message": "此请求需要支付一定的费用。" }, "fiat": { - "message": "FIAT" + "message": "FIAT", + "description": "Exchange type" }, "fileImportFail": { - "message": "文件导入失败? 点击这里!" + "message": "文件导入失败? 点击这里!", + "description": "Helps user import their account from a JSON file" }, "forbiddenIpfsGateway": { "message": "禁用的 IPFS 网关:请指定一个 CID 网关" @@ -657,7 +690,8 @@ "message": "从" }, "fromAddress": { - "message": "从:$1" + "message": "从:$1", + "description": "$1 is the address to include in the From label. It is typically shortened first using shortenAddress" }, "functionApprove": { "message": "功能:同意" @@ -675,7 +709,8 @@ "message": "燃料限制至少要 21000" }, "gasLimitTooLowWithDynamicFee": { - "message": "燃料限制至少要 $1" + "message": "燃料限制至少要 $1", + "description": "$1 is the custom gas limit, in decimal." }, "gasPrice": { "message": "燃料价格(GWEI)" @@ -690,10 +725,12 @@ "message": "燃料使用" }, "gdprMessage": { - "message": "这些数据是汇总的,因此,根据《GDPR 通用数据保护条例》(EU)2016/679,这些数据是匿名的。有关我们隐私惯例的更多信息,请参见我们的 $1。" + "message": "这些数据是汇总的,因此,根据《GDPR 通用数据保护条例》(EU)2016/679,这些数据是匿名的。有关我们隐私惯例的更多信息,请参见我们的 $1。", + "description": "$1 refers to the gdprMessagePrivacyPolicy message, the translation of which is meant to be used exclusively in the context of gdprMessage" }, "gdprMessagePrivacyPolicy": { - "message": "隐私政策" + "message": "隐私政策", + "description": "this translation is intended to be exclusively used as the replacement for the $1 in the gdprMessage translation" }, "general": { "message": "通用" @@ -705,7 +742,8 @@ "message": "获取 Ether" }, "getEtherFromFaucet": { - "message": "从水管获取 $1 网络的 Ether" + "message": "从水管获取 $1 网络的 Ether", + "description": "Displays network name for Ether faucet" }, "getHelp": { "message": "获取帮助。" @@ -735,7 +773,8 @@ "message": "连接出现问题?" }, "here": { - "message": "这里" + "message": "这里", + "description": "as in -click here- for more information (goes with troubleTokenBalances)" }, "hexData": { "message": "十六进制数据" @@ -747,13 +786,15 @@ "message": "隐藏代币?" }, "hideTokenSymbol": { - "message": "隐藏 $1" + "message": "隐藏 $1", + "description": "$1 is the symbol for a token (e.g. 'DAI')" }, "history": { "message": "历史记录" }, "import": { - "message": "导入" + "message": "导入", + "description": "Button to import an account from a selected file" }, "importAccount": { "message": "导入账户" @@ -774,7 +815,8 @@ "message": "使用 12 个单词的账户助记词导入您现有的钱包账户。" }, "imported": { - "message": "已导入" + "message": "已导入", + "description": "status showing that an account has been fully loaded into the keyring" }, "infoHelp": { "message": "信息 & 帮助" @@ -807,13 +849,15 @@ "message": "无效的链 ID,该链 ID 数字过大。" }, "invalidCustomNetworkAlertContent1": { - "message": "需要重新输入自定义网络'$1'的链 ID。" + "message": "需要重新输入自定义网络'$1'的链 ID。", + "description": "$1 is the name/identifier of the network." }, "invalidCustomNetworkAlertContent2": { "message": "为了保护您免受恶意或有问题的网络提供商的侵害,现在所有的自定义网络都需要提供链 ID。" }, "invalidCustomNetworkAlertContent3": { - "message": "进入设置 > 网络并输入链 ID。您可以通过 $1 查找常用的链 ID。" + "message": "进入设置 > 网络并输入链 ID。您可以通过 $1 查找常用的链 ID。", + "description": "$1 is a link to https://chainid.network" }, "invalidCustomNetworkAlertTitle": { "message": "无效的自定义网络" @@ -846,7 +890,8 @@ "message": "输入用于 ENS 内容解析的 IPFS CID 网关的 URL。" }, "jsonFile": { - "message": "JSON 文件" + "message": "JSON 文件", + "description": "format for importing an account" }, "knownAddressRecipient": { "message": "已知接收方地址。" @@ -930,19 +975,23 @@ "message": "始终允许您通过设置选择退出" }, "metametricsCommitmentsBoldNever": { - "message": "从不" + "message": "从不", + "description": "This string is localized separately from some of the commitments so that we can bold it" }, "metametricsCommitmentsIntro": { "message": "MetaMask……" }, "metametricsCommitmentsNeverCollectIP": { - "message": "$1收集您的完整IP地址" + "message": "$1收集您的完整IP地址", + "description": "The $1 is the bolded word 'Never', from 'metametricsCommitmentsBoldNever'" }, "metametricsCommitmentsNeverCollectKeysEtc": { - "message": "$1收集密钥、地址、交易记录、余额、哈希或任何个人信息" + "message": "$1收集密钥、地址、交易记录、余额、哈希或任何个人信息", + "description": "The $1 is the bolded word 'Never', from 'metametricsCommitmentsBoldNever'" }, "metametricsCommitmentsNeverSellDataForProfit": { - "message": "$1为利益而出售您的数据,永远不会!" + "message": "$1为利益而出售您的数据,永远不会!", + "description": "The $1 is the bolded word 'Never', from 'metametricsCommitmentsBoldNever'" }, "metametricsCommitmentsSendAnonymizedEvents": { "message": "发送匿名的点击和页面浏览事件信息" @@ -972,7 +1021,8 @@ "message": "使用 MetaMask 与分布式应用交互,需要您的钱包里需要有 Ether。" }, "needImportFile": { - "message": "必须选择一个文件来导入。" + "message": "必须选择一个文件来导入。", + "description": "User is important an account and needs to add a file to continue" }, "negativeETH": { "message": "不能发负值的 ETH。" @@ -999,7 +1049,8 @@ "message": "检测到新地址!点击添加至地址簿。" }, "newAccountNumberName": { - "message": "账户 $1" + "message": "账户 $1", + "description": "Default name of next account to be created on create account screen" }, "newContact": { "message": "新联系人" @@ -1026,7 +1077,8 @@ "message": "下一步" }, "nextNonceWarning": { - "message": "Nonce 高于建议的 nouce 值 $1" + "message": "Nonce 高于建议的 nouce 值 $1", + "description": "The next nonce according to MetaMask's internal logic" }, "noAccountsFound": { "message": "没找到查询的账户" @@ -1083,7 +1135,8 @@ "message": "启用" }, "onboardingReturnNotice": { - "message": "“$1”会关闭此标签,直接回到 $2" + "message": "“$1”会关闭此标签,直接回到 $2", + "description": "Return the user to the site that initiated onboarding" }, "onlyAddTrustedNetworks": { "message": "恶意的 Ethereum 以太坊网络提供商可以伪造区块链状态,并记录您的网络活动。只添加您信任的自定义网络。" @@ -1125,7 +1178,8 @@ "message": "密码不匹配" }, "pastePrivateKey": { - "message": "请粘贴您的私钥:" + "message": "请粘贴您的私钥:", + "description": "For importing an account from a private key" }, "pending": { "message": "待处理" @@ -1143,7 +1197,8 @@ "message": "检测到个人地址。请输入代币合约地址。" }, "plusXMore": { - "message": "+ $1" + "message": "+ $1", + "description": "$1 is a number of additional but unshown items in a list- this message will be shown in place of those items" }, "prev": { "message": "上一个" @@ -1158,7 +1213,8 @@ "message": "隐私政策" }, "privateKey": { - "message": "私钥" + "message": "私钥", + "description": "select this type of file to use to import an account" }, "privateKeyWarning": { "message": "注意:永远不要公开这个私钥。任何拥有您的私钥的人都可以窃取您帐户中的任何资产。" @@ -1257,7 +1313,8 @@ "message": "从助记词还原" }, "restoreWalletPreferences": { - "message": "已找到于 $1 的数据备份。您想恢复您的钱包设置吗?" + "message": "已找到于 $1 的数据备份。您想恢复您的钱包设置吗?", + "description": "$1 is the date at which the data was backed up" }, "retryTransaction": { "message": "重试交易" @@ -1389,7 +1446,8 @@ "message": "发送 ETH" }, "sendSpecifiedTokens": { - "message": "发送 $1" + "message": "发送 $1", + "description": "Symbol of the specified token" }, "sendTokens": { "message": "发送代币" @@ -1482,7 +1540,8 @@ "message": "消费限制权限" }, "spendLimitRequestedBy": { - "message": "消费限制申请来自 $1" + "message": "消费限制申请来自 $1", + "description": "Origin of the site requesting the spend limit" }, "spendLimitTooLarge": { "message": "消费限制过大" @@ -1551,19 +1610,23 @@ "message": "这是您将收到的最低数额。根据滑点值, 您可能会收到更多。" }, "swapApproval": { - "message": "批准 $1 的兑换 " + "message": "批准 $1 的兑换 ", + "description": "Used in the transaction display list to describe a transaction that is an approve call on a token that is to be swapped.. $1 is the symbol of a token that has been approved." }, "swapApproveNeedMoreTokens": { - "message": "您还需 $1 $2 来完成这笔兑换" + "message": "您还需 $1 $2 来完成这笔兑换", + "description": "Tells the user how many more of a given token they need for a specific swap. $1 is an amount of tokens and $2 is the token symbol." }, "swapBetterQuoteAvailable": { "message": "有一个可用的更优报价" }, "swapBuildQuotePlaceHolderText": { - "message": "没有匹配的代币符合 $1" + "message": "没有匹配的代币符合 $1", + "description": "Tells the user that a given search string does not match any tokens in our token lists. $1 can be any string of text" }, "swapCheckingQuote": { - "message": "正在检查 $1" + "message": "正在检查 $1", + "description": "Shown to the user during quote loading. $1 is the name of an aggregator. The message indicates that metamask is currently checking if that aggregator has a trade/quote for their requested swap." }, "swapCustom": { "message": "自定义" @@ -1575,13 +1638,15 @@ "message": "修改限制" }, "swapEnableDescription": { - "message": "这是必须的,并且允许 MetaMask 兑换您的 $1。" + "message": "这是必须的,并且允许 MetaMask 兑换您的 $1。", + "description": "Gives the user info about the required approval transaction for swaps. $1 will be the symbol of a token being approved for swaps." }, "swapEstimatedNetworkFee": { "message": "预计网络手续费" }, "swapEstimatedNetworkFeeSummary": { - "message": "“$1”是我们预计的实际产生费用。具体数额视网络情况而定。" + "message": "“$1”是我们预计的实际产生费用。具体数额视网络情况而定。", + "description": "$1 will be the translation of swapEstimatedNetworkFee, with the font bolded" }, "swapEstimatedNetworkFees": { "message": "预计网络手续费" @@ -1607,9 +1672,6 @@ "swapFinalizing": { "message": "确定中……" }, - "swapGetQuotes": { - "message": "获取报价" - }, "swapHighSlippageWarning": { "message": "滑点数量非常大。确保您知道您的操作!" }, @@ -1635,7 +1697,8 @@ "message": "交易可能失败,最大滑点过低。" }, "swapMaxNetworkFeeInfo": { - "message": "“$1”是您最多所话费的数量,当网络不稳定时,这可能是一个大的数额。" + "message": "“$1”是您最多所话费的数量,当网络不稳定时,这可能是一个大的数额。", + "description": "$1 will be the translation of swapMaxNetworkFees, with the font bolded" }, "swapMaxNetworkFees": { "message": "最大网络手续费" @@ -1647,25 +1710,31 @@ "message": "MetaMask 手续费" }, "swapMetaMaskFeeDescription": { - "message": "我们每次都能从顶级流动性资源中找到最好的价格。每次报价都会自动收取1%的手续费用,以支持 MetaMask 的持续发展,使其更加完善。" + "message": "我们每次都能从顶级流动性资源中找到最好的价格。每次报价都会自动收取1%的手续费用,以支持 MetaMask 的持续发展,使其更加完善。", + "description": "Provides information about the fee that metamask takes for swaps. $1 is a decimal number." }, "swapNQuotes": { - "message": "$1 个报价" + "message": "$1 个报价", + "description": "$1 is the number of quotes that the user can select from when opening the list of quotes on the 'view quote' screen" }, "swapNetworkFeeSummary": { "message": "网络手续费包括处理您的兑换和在以太坊(Ethereum)网络上存储的成本。MetaMask 不从这笔费用中获利。" }, "swapNewQuoteIn": { - "message": "$1 后更新报价" + "message": "$1 后更新报价", + "description": "Tells the user the amount of time until the currently displayed quotes are update. $1 is a time that is counting down from 1:00 to 0:00" }, "swapOnceTransactionHasProcess": { - "message": "一旦交易完成,您的 $1 将被添加到您的账户中。" + "message": "一旦交易完成,您的 $1 将被添加到您的账户中。", + "description": "This message communicates the token that is being transferred. It is shown on the awaiting swap screen. The $1 will be a token symbol." }, "swapPriceDifference": { - "message": "您将兑换 $1 $2(~$3)为 $4 $5(~$6)。" + "message": "您将兑换 $1 $2(~$3)为 $4 $5(~$6)。", + "description": "This message represents the price slippage for the swap. $1 and $4 are a number (ex: 2.89), $2 and $5 are symbols (ex: ETH), and $3 and $6 are fiat currency amounts." }, "swapPriceDifferenceTitle": { - "message": "价格差异 ~$1%" + "message": "价格差异 ~$1%", + "description": "$1 is a number (ex: 1.23) that represents the price difference." }, "swapPriceDifferenceTooltip": { "message": "市场价格的差异可能受到中介机构收取的费用、市场规模、交易规模或市场效率低下的影响。" @@ -1683,10 +1752,12 @@ "message": "如果在您下订单和确认订单之间的价格发生了变化,这就叫做\"滑点\"。如果滑点超过您的\"最大滑点\"设置,您的兑换将自动取消。" }, "swapQuoteIncludesRate": { - "message": "报价包含 $1% MetaMask 手续费" + "message": "报价包含 $1% MetaMask 手续费", + "description": "Provides information about the fee that metamask takes for swaps. $1 is a decimal number." }, "swapQuoteNofN": { - "message": "报价 $1 / $2" + "message": "报价 $1 / $2", + "description": "A count of loaded quotes shown to the user while they are waiting for quotes to be fetched. $1 is the number of quotes already loaded, and $2 is the total number of quotes to load." }, "swapQuoteSource": { "message": "报价来源" @@ -1758,10 +1829,12 @@ "message": "这样将允许 $1 用于兑换。" }, "swapTokenAvailable": { - "message": "您的 $1 已添加到您的账户。" + "message": "您的 $1 已添加到您的账户。", + "description": "This message is shown after a swap is successful and communicates the exact amount of tokens the user has received for a swap. The $1 is a decimal number of tokens followed by the token symbol." }, "swapTokenToToken": { - "message": "兑换 $1 到 $2" + "message": "兑换 $1 到 $2", + "description": "Used in the transaction display list to describe a swap. $1 and $2 are the symbols of tokens in involved in a swap." }, "swapTransactionComplete": { "message": "交易完成" @@ -1779,7 +1852,8 @@ "message": "查看 $1" }, "swapYourTokenBalance": { - "message": "$1 $2 可用" + "message": "$1 $2 可用", + "description": "Tells the user how much of a token they have in their balance. $1 is a decimal number amount of tokens, and $2 is a token symbol" }, "swapZeroSlippage": { "message": "0% 滑点" @@ -1794,7 +1868,8 @@ "message": "最大滑点" }, "swapsNotEnoughForTx": { - "message": "没有足够的 $1 来完成此交易" + "message": "没有足够的 $1 来完成此交易", + "description": "Tells the user that they don't have enough of a token for a proposed swap. $1 is a token symbol" }, "swapsViewInActivity": { "message": "在活动中查看" @@ -1860,7 +1935,8 @@ "message": "至" }, "toAddress": { - "message": "至:$1" + "message": "至:$1", + "description": "$1 is the address to include in the To label. It is typically shortened first using shortenAddress" }, "toWithColon": { "message": "至:" @@ -1932,13 +2008,16 @@ "message": "转自" }, "troubleConnectingToWallet": { - "message": "我们在连接您的 $1 遇到问题,尝试检查 $2 并重试。" + "message": "我们在连接您的 $1 遇到问题,尝试检查 $2 并重试。", + "description": "$1 is the wallet device name; $2 is a link to wallet connection guide" }, "troubleTokenBalances": { - "message": "我们无法加载您的代币余额。您可以查看它们" + "message": "我们无法加载您的代币余额。您可以查看它们", + "description": "Followed by a link (here) to view token balances" }, "trustSiteApprovePermission": { - "message": "您信任这个网站吗?授权即表示您允许 $1 提取您的 $2,并为您自动进行交易。" + "message": "您信任这个网站吗?授权即表示您允许 $1 提取您的 $2,并为您自动进行交易。", + "description": "$1 is the url requesting permission and $2 is the symbol of the currency that the request is for" }, "tryAgain": { "message": "重试" @@ -1998,7 +2077,8 @@ "message": "名称" }, "verifyThisTokenOn": { - "message": "在 $1 上验证此代币" + "message": "在 $1 上验证此代币", + "description": "Points the user to etherscan as a place they can verify information about a token. $1 is replaced with the translation for \"etherscan\"" }, "viewAccount": { "message": "查看账户" @@ -2025,7 +2105,8 @@ "message": "账户助记词" }, "web3ShimUsageNotification": { - "message": "我们发现当前的网站尝试使用已经删除的 window.web3 API。如果这个网站网站已经无法正常使用,请点击 $1 获取更多信息。" + "message": "我们发现当前的网站尝试使用已经删除的 window.web3 API。如果这个网站网站已经无法正常使用,请点击 $1 获取更多信息。", + "description": "$1 is a clickable link." }, "welcome": { "message": "欢迎使用 MetaMask" @@ -2040,7 +2121,8 @@ "message": "请将该账户助记词记录在纸上,并保存在安全的地方。如果希望提升信息安全性,请将信息记录在多张纸上,并分别保存在 2 - 3 个不同的地方。" }, "xOfY": { - "message": "$1 / $2" + "message": "$1 / $2", + "description": "$1 and $2 are intended to be two numbers, where $2 is a total, and $1 is a count towards that total" }, "yesLetsTry": { "message": "是的,尝试下"