mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
commit
15722b4e6c
@ -7,6 +7,7 @@
|
||||
- Add a welcome screen to new-ui onboarding flow
|
||||
- Make new-ui create password screen responsive
|
||||
- Hide network dropdown before account is initialized
|
||||
- Add ability for internationalization.
|
||||
|
||||
## 4.2.0 Tue Mar 06 2018
|
||||
|
||||
|
@ -66,6 +66,7 @@ To write tests that will be run in the browser using QUnit, add your test files
|
||||
- [How to add custom build to Chrome](./docs/add-to-chrome.md)
|
||||
- [How to add custom build to Firefox](./docs/add-to-firefox.md)
|
||||
- [How to develop a live-reloading UI](./docs/ui-dev-mode.md)
|
||||
- [How to add a new translation to MetaMask](./docs/translating-guide.md)
|
||||
- [Publishing Guide](./docs/publishing.md)
|
||||
- [How to develop an in-browser mocked UI](./docs/ui-mock-mode.md)
|
||||
- [How to live reload on local dependency changes](./docs/developing-on-deps.md)
|
||||
|
@ -1,10 +1,609 @@
|
||||
{
|
||||
"accept": {
|
||||
"message": "Accept"
|
||||
},
|
||||
"account": {
|
||||
"message": "Account"
|
||||
},
|
||||
"accountDetails": {
|
||||
"message": "Account Details"
|
||||
},
|
||||
"accountName": {
|
||||
"message": "Account Name"
|
||||
},
|
||||
"address": {
|
||||
"message": "Address"
|
||||
},
|
||||
"addToken": {
|
||||
"message": "Add Token"
|
||||
},
|
||||
"amount": {
|
||||
"message": "Amount"
|
||||
},
|
||||
"amountPlusGas": {
|
||||
"message": "Amount + Gas"
|
||||
},
|
||||
"appDescription": {
|
||||
"message": "Ethereum Browser Extension",
|
||||
"description": "The description of the application"
|
||||
},
|
||||
"appName": {
|
||||
"message": "MetaMask",
|
||||
"description": "The name of the application"
|
||||
},
|
||||
"appDescription": {
|
||||
"message": "Ethereum Identity Management",
|
||||
"description": "The description of the application"
|
||||
"attemptingConnect": {
|
||||
"message": "Attempting to connect to blockchain."
|
||||
},
|
||||
"available": {
|
||||
"message": "Available"
|
||||
},
|
||||
"back": {
|
||||
"message": "Back"
|
||||
},
|
||||
"balance": {
|
||||
"message": "Balance:"
|
||||
},
|
||||
"balanceIsInsufficientGas": {
|
||||
"message": "Insufficient balance for current gas total"
|
||||
},
|
||||
"beta": {
|
||||
"message": "BETA"
|
||||
},
|
||||
"betweenMinAndMax": {
|
||||
"message": "must be greater than or equal to $1 and less than or equal to $2.",
|
||||
"description": "helper for inputting hex as decimal input"
|
||||
},
|
||||
"borrowDharma": {
|
||||
"message": "Borrow With Dharma (Beta)"
|
||||
},
|
||||
"buy": {
|
||||
"message": "Buy"
|
||||
},
|
||||
"buyCoinbase": {
|
||||
"message": "Buy on Coinbase"
|
||||
},
|
||||
"buyCoinbaseExplainer": {
|
||||
"message": "Coinbase is the world’s most popular way to buy and sell bitcoin, ethereum, and litecoin."
|
||||
},
|
||||
"cancel": {
|
||||
"message": "Cancel"
|
||||
},
|
||||
"clickCopy": {
|
||||
"message": "Click to Copy"
|
||||
},
|
||||
"confirm": {
|
||||
"message": "Confirm"
|
||||
},
|
||||
"confirmContract": {
|
||||
"message": "Confirm Contract"
|
||||
},
|
||||
"confirmPassword": {
|
||||
"message": "Confirm Password"
|
||||
},
|
||||
"confirmTransaction": {
|
||||
"message": "Confirm Transaction"
|
||||
},
|
||||
"continueToCoinbase": {
|
||||
"message": "Continue to Coinbase"
|
||||
},
|
||||
"contractDeployment": {
|
||||
"message": "Contract Deployment"
|
||||
},
|
||||
"conversionProgress": {
|
||||
"message": "Conversion in progress"
|
||||
},
|
||||
"copiedButton": {
|
||||
"message": "Copied"
|
||||
},
|
||||
"copiedClipboard": {
|
||||
"message": "Copied to Clipboard"
|
||||
},
|
||||
"copiedExclamation": {
|
||||
"message": "Copied!"
|
||||
},
|
||||
"copy": {
|
||||
"message": "Copy"
|
||||
},
|
||||
"copyToClipboard": {
|
||||
"message": "Copy to clipboard"
|
||||
},
|
||||
"copyButton": {
|
||||
"message": " Copy "
|
||||
},
|
||||
"copyPrivateKey": {
|
||||
"message": "This is your private key (click to copy)"
|
||||
},
|
||||
"create": {
|
||||
"message": "Create"
|
||||
},
|
||||
"createAccount": {
|
||||
"message": "Create Account"
|
||||
},
|
||||
"createDen": {
|
||||
"message": "Create"
|
||||
},
|
||||
"crypto": {
|
||||
"message": "Crypto",
|
||||
"description": "Exchange type (cryptocurrencies)"
|
||||
},
|
||||
"customGas": {
|
||||
"message": "Customize Gas"
|
||||
},
|
||||
"customize": {
|
||||
"message": "Customize"
|
||||
},
|
||||
"customRPC": {
|
||||
"message": "Custom RPC"
|
||||
},
|
||||
"defaultNetwork": {
|
||||
"message": "The default network for Ether transactions is Main Net."
|
||||
},
|
||||
"denExplainer": {
|
||||
"message": "Your DEN is your password-encrypted storage within MetaMask."
|
||||
},
|
||||
"deposit": {
|
||||
"message": "Deposit"
|
||||
},
|
||||
"depositBTC": {
|
||||
"message": "Deposit your BTC to the address below:"
|
||||
},
|
||||
"depositCoin": {
|
||||
"message": "Deposit your $1 to the address below",
|
||||
"description": "Tells the user what coin they have selected to deposit with shapeshift"
|
||||
},
|
||||
"depositEth": {
|
||||
"message": "Deposit Eth"
|
||||
},
|
||||
"depositEther": {
|
||||
"message": "Deposit Ether"
|
||||
},
|
||||
"depositFiat": {
|
||||
"message": "Deposit with Fiat"
|
||||
},
|
||||
"depositFromAccount": {
|
||||
"message": "Deposit from another account"
|
||||
},
|
||||
"depositShapeShift": {
|
||||
"message": "Deposit with ShapeShift"
|
||||
},
|
||||
"depositShapeShiftExplainer": {
|
||||
"message": "If you own other cryptocurrencies, you can trade and deposit Ether directly into your MetaMask wallet. No Account Needed."
|
||||
},
|
||||
"details": {
|
||||
"message": "Details"
|
||||
},
|
||||
"directDeposit": {
|
||||
"message": "Direct Deposit"
|
||||
},
|
||||
"directDepositEther": {
|
||||
"message": "Directly Deposit Ether"
|
||||
},
|
||||
"directDepositEtherExplainer": {
|
||||
"message": "If you already have some Ether, the quickest way to get Ether in your new wallet by direct deposit."
|
||||
},
|
||||
"done": {
|
||||
"message": "Done"
|
||||
},
|
||||
"edit": {
|
||||
"message": "Edit"
|
||||
},
|
||||
"editAccountName": {
|
||||
"message": "Edit Account Name"
|
||||
},
|
||||
"encryptNewDen": {
|
||||
"message": "Encrypt your new DEN"
|
||||
},
|
||||
"enterPassword": {
|
||||
"message": "Enter password"
|
||||
},
|
||||
"etherscanView": {
|
||||
"message": "View account on Etherscan"
|
||||
},
|
||||
"exchangeRate": {
|
||||
"message": "Exchange Rate"
|
||||
},
|
||||
"exportPrivateKey": {
|
||||
"message": "Export Private Key"
|
||||
},
|
||||
"exportPrivateKeyWarning": {
|
||||
"message": "Export private keys at your own risk."
|
||||
},
|
||||
"failed": {
|
||||
"message": "Failed"
|
||||
},
|
||||
"fiat": {
|
||||
"message": "FIAT",
|
||||
"description": "Exchange type"
|
||||
},
|
||||
"fileImportFail": {
|
||||
"message": "File import not working? Click here!",
|
||||
"description": "Helps user import their account from a JSON file"
|
||||
},
|
||||
"from": {
|
||||
"message": "From"
|
||||
},
|
||||
"fromShapeShift": {
|
||||
"message": "From ShapeShift"
|
||||
},
|
||||
"gas": {
|
||||
"message": "Gas",
|
||||
"description": "Short indication of gas cost"
|
||||
},
|
||||
"gasFee": {
|
||||
"message": "Gas Fee"
|
||||
},
|
||||
"gasLimit": {
|
||||
"message": "Gas Limit"
|
||||
},
|
||||
"gasLimitCalculation": {
|
||||
"message": "We calculate the suggested gas limit based on network success rates."
|
||||
},
|
||||
"gasLimitRequired": {
|
||||
"message": "Gas Limit Required"
|
||||
},
|
||||
"gasLimitTooLow": {
|
||||
"message": "Gas limit must be at least 21000"
|
||||
},
|
||||
"gasPrice": {
|
||||
"message": "Gas Price (GWEI)"
|
||||
},
|
||||
"gasPriceCalculation": {
|
||||
"message": "We calculate the suggested gas prices based on network success rates."
|
||||
},
|
||||
"gasPriceRequired": {
|
||||
"message": "Gas Price Required"
|
||||
},
|
||||
"getEther": {
|
||||
"message": "Get Ether"
|
||||
},
|
||||
"getEtherFromFaucet": {
|
||||
"message": "Get Ether from a faucet for the $1",
|
||||
"description": "Displays network name for Ether faucet"
|
||||
},
|
||||
"greaterThanMin": {
|
||||
"message": "must be greater than or equal to $1.",
|
||||
"description": "helper for inputting hex as decimal input"
|
||||
},
|
||||
"here": {
|
||||
"message": "here",
|
||||
"description": "as in -click here- for more information (goes with troubleTokenBalances)"
|
||||
},
|
||||
"hide": {
|
||||
"message": "Hide"
|
||||
},
|
||||
"hideToken": {
|
||||
"message": "Hide Token"
|
||||
},
|
||||
"hideTokenPrompt": {
|
||||
"message": "Hide Token?"
|
||||
},
|
||||
"howToDeposit": {
|
||||
"message": "How would you like to deposit Ether?"
|
||||
},
|
||||
"import": {
|
||||
"message": "Import",
|
||||
"description": "Button to import an account from a selected file"
|
||||
},
|
||||
"importAccount": {
|
||||
"message": "Import Account"
|
||||
},
|
||||
"importAnAccount": {
|
||||
"message": "Import an account"
|
||||
},
|
||||
"importDen": {
|
||||
"message": "Import Existing DEN"
|
||||
},
|
||||
"imported": {
|
||||
"message": "Imported",
|
||||
"description": "status showing that an account has been fully loaded into the keyring"
|
||||
},
|
||||
"infoHelp": {
|
||||
"message": "Info & Help"
|
||||
},
|
||||
"invalidAddress": {
|
||||
"message": "Invalid address"
|
||||
},
|
||||
"invalidGasParams": {
|
||||
"message": "Invalid Gas Parameters"
|
||||
},
|
||||
"invalidInput": {
|
||||
"message": "Invalid input."
|
||||
},
|
||||
"invalidRequest": {
|
||||
"message": "Invalid Request"
|
||||
},
|
||||
"jsonFile": {
|
||||
"message": "JSON File",
|
||||
"description": "format for importing an account"
|
||||
},
|
||||
"kovan": {
|
||||
"message": "Kovan Test Network"
|
||||
},
|
||||
"lessThanMax": {
|
||||
"message": "must be less than or equal to $1.",
|
||||
"description": "helper for inputting hex as decimal input"
|
||||
},
|
||||
"limit": {
|
||||
"message": "Limit"
|
||||
},
|
||||
"loading": {
|
||||
"message": "Loading..."
|
||||
},
|
||||
"loadingTokens": {
|
||||
"message": "Loading Tokens..."
|
||||
},
|
||||
"localhost": {
|
||||
"message": "Localhost 8545"
|
||||
},
|
||||
"logout": {
|
||||
"message": "Log out"
|
||||
},
|
||||
"loose": {
|
||||
"message": "Loose"
|
||||
},
|
||||
"mainnet": {
|
||||
"message": "Main Ethereum Network"
|
||||
},
|
||||
"message": {
|
||||
"message": "Message"
|
||||
},
|
||||
"min": {
|
||||
"message": "Minimum"
|
||||
},
|
||||
"myAccounts": {
|
||||
"message": "My Accounts"
|
||||
},
|
||||
"needEtherInWallet": {
|
||||
"message": "To interact with decentralized applications using MetaMask, you’ll need Ether in your wallet."
|
||||
},
|
||||
"needImportFile": {
|
||||
"message": "You must select a file to import.",
|
||||
"description": "User is important an account and needs to add a file to continue"
|
||||
},
|
||||
"needImportPassword": {
|
||||
"message": "You must enter a password for the selected file.",
|
||||
"description": "Password and file needed to import an account"
|
||||
},
|
||||
"networks": {
|
||||
"message": "Networks"
|
||||
},
|
||||
"newAccount": {
|
||||
"message": "New Account"
|
||||
},
|
||||
"newAccountNumberName": {
|
||||
"message": "Account $1",
|
||||
"description": "Default name of next account to be created on create account screen"
|
||||
},
|
||||
"newContract": {
|
||||
"message": "New Contract"
|
||||
},
|
||||
"newPassword": {
|
||||
"message": "New Password (min 8 chars)"
|
||||
},
|
||||
"newRecipient": {
|
||||
"message": "New Recipient"
|
||||
},
|
||||
"next": {
|
||||
"message": "Next"
|
||||
},
|
||||
"noAddressForName": {
|
||||
"message": "No address has been set for this name."
|
||||
},
|
||||
"noDeposits": {
|
||||
"message": "No deposits received"
|
||||
},
|
||||
"noTransactionHistory": {
|
||||
"message": "No transaction history."
|
||||
},
|
||||
"noTransactions": {
|
||||
"message": "No Transactions"
|
||||
},
|
||||
"notStarted": {
|
||||
"message": "Not Started"
|
||||
},
|
||||
"oldUI": {
|
||||
"message": "Old UI"
|
||||
},
|
||||
"oldUIMessage": {
|
||||
"message": "You have returned to the old UI. You can switch back to the New UI through the option in the top right dropdown menu."
|
||||
},
|
||||
"or": {
|
||||
"message": "or",
|
||||
"description": "choice between creating or importing a new account"
|
||||
},
|
||||
"passwordMismatch": {
|
||||
"message": "passwords don't match",
|
||||
"description": "in password creation process, the two new password fields did not match"
|
||||
},
|
||||
"passwordShort": {
|
||||
"message": "password not long enough",
|
||||
"description": "in password creation process, the password is not long enough to be secure"
|
||||
},
|
||||
"pastePrivateKey": {
|
||||
"message": "Paste your private key string here:",
|
||||
"description": "For importing an account from a private key"
|
||||
},
|
||||
"pasteSeed": {
|
||||
"message": "Paste your seed phrase here!"
|
||||
},
|
||||
"pleaseReviewTransaction": {
|
||||
"message": "Please review your transaction."
|
||||
},
|
||||
"privateKey": {
|
||||
"message": "Private Key",
|
||||
"description": "select this type of file to use to import an account"
|
||||
},
|
||||
"privateKeyWarning": {
|
||||
"message": "Warning: Never disclose this key. Anyone with your private keys can take steal any assets held in your account."
|
||||
},
|
||||
"privateNetwork": {
|
||||
"message": "Private Network"
|
||||
},
|
||||
"qrCode": {
|
||||
"message": "Show QR Code"
|
||||
},
|
||||
"readdToken": {
|
||||
"message": "You can add this token back in the future by going go to “Add token” in your accounts options menu."
|
||||
},
|
||||
"readMore": {
|
||||
"message": "Read more here."
|
||||
},
|
||||
"receive": {
|
||||
"message": "Receive"
|
||||
},
|
||||
"recipientAddress": {
|
||||
"message": "Recipient Address"
|
||||
},
|
||||
"refundAddress": {
|
||||
"message": "Your Refund Address"
|
||||
},
|
||||
"rejected": {
|
||||
"message": "Rejected"
|
||||
},
|
||||
"required": {
|
||||
"message": "Required"
|
||||
},
|
||||
"retryWithMoreGas": {
|
||||
"message": "Retry with a higher gas price here"
|
||||
},
|
||||
"revert": {
|
||||
"message": "Revert"
|
||||
},
|
||||
"rinkeby": {
|
||||
"message": "Rinkeby Test Network"
|
||||
},
|
||||
"ropsten": {
|
||||
"message": "Ropsten Test Network"
|
||||
},
|
||||
"sampleAccountName": {
|
||||
"message": "E.g. My new account",
|
||||
"description": "Help user understand concept of adding a human-readable name to their account"
|
||||
},
|
||||
"save": {
|
||||
"message": "Save"
|
||||
},
|
||||
"saveAsFile": {
|
||||
"message": "Save as File",
|
||||
"description": "Account export process"
|
||||
},
|
||||
"selectService": {
|
||||
"message": "Select Service"
|
||||
},
|
||||
"send": {
|
||||
"message": "Send"
|
||||
},
|
||||
"sendTokens": {
|
||||
"message": "Send Tokens"
|
||||
},
|
||||
"sendTokensAnywhere": {
|
||||
"message": "Send Tokens to anyone with an Ethereum account"
|
||||
},
|
||||
"settings": {
|
||||
"message": "Settings"
|
||||
},
|
||||
"shapeshiftBuy": {
|
||||
"message": "Buy with Shapeshift"
|
||||
},
|
||||
"showPrivateKeys": {
|
||||
"message": "Show Private Keys"
|
||||
},
|
||||
"showQRCode": {
|
||||
"message": "Show QR Code"
|
||||
},
|
||||
"sign": {
|
||||
"message": "Sign"
|
||||
},
|
||||
"signMessage": {
|
||||
"message": "Sign Message"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Signing this message can have \ndangerous side effects. Only sign messages from \nsites you fully trust with your entire account.\n This dangerous method will be removed in a future version. "
|
||||
},
|
||||
"sigRequest": {
|
||||
"message": "Signature Request"
|
||||
},
|
||||
"sigRequested": {
|
||||
"message": "Signature Requested"
|
||||
},
|
||||
"status": {
|
||||
"message": "Status"
|
||||
},
|
||||
"submit": {
|
||||
"message": "Submit"
|
||||
},
|
||||
"takesTooLong": {
|
||||
"message": "Taking too long?"
|
||||
},
|
||||
"testFaucet": {
|
||||
"message": "Test Faucet"
|
||||
},
|
||||
"to": {
|
||||
"message": "To"
|
||||
},
|
||||
"toETHviaShapeShift": {
|
||||
"message": "$1 to ETH via ShapeShift",
|
||||
"description": "system will fill in deposit type in start of message"
|
||||
},
|
||||
"tokenBalance": {
|
||||
"message": "Your Token Balance is:"
|
||||
},
|
||||
"total": {
|
||||
"message": "Total"
|
||||
},
|
||||
"transactionMemo": {
|
||||
"message": "Transaction memo (optional)"
|
||||
},
|
||||
"transactionNumber": {
|
||||
"message": "Transaction Number"
|
||||
},
|
||||
"transfers": {
|
||||
"message": "Transfers"
|
||||
},
|
||||
"troubleTokenBalances": {
|
||||
"message": "We had trouble loading your token balances. You can view them ",
|
||||
"description": "Followed by a link (here) to view token balances"
|
||||
},
|
||||
"typePassword": {
|
||||
"message": "Type Your Password"
|
||||
},
|
||||
"uiWelcome": {
|
||||
"message": "Welcome to the New UI (Beta)"
|
||||
},
|
||||
"uiWelcomeMessage": {
|
||||
"message": "You are now using the new Metamask UI. Take a look around, try out new features like sending tokens, and let us know if you have any issues."
|
||||
},
|
||||
"unavailable": {
|
||||
"message": "Unavailable"
|
||||
},
|
||||
"unknown": {
|
||||
"message": "Unknown"
|
||||
},
|
||||
"unknownNetwork": {
|
||||
"message": "Unknown Private Network"
|
||||
},
|
||||
"unknownNetworkId": {
|
||||
"message": "Unknown network ID"
|
||||
},
|
||||
"usaOnly": {
|
||||
"message": "USA only",
|
||||
"description": "Using this exchange is limited to people inside the USA"
|
||||
},
|
||||
"usedByClients": {
|
||||
"message": "Used by a variety of different clients"
|
||||
},
|
||||
"viewAccount": {
|
||||
"message": "View Account"
|
||||
},
|
||||
"warning": {
|
||||
"message": "Warning"
|
||||
},
|
||||
"whatsThis": {
|
||||
"message": "What's this?"
|
||||
},
|
||||
"yourSigRequested": {
|
||||
"message": "Your signature is being requested"
|
||||
},
|
||||
"youSign": {
|
||||
"message": "You are signing"
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
{
|
||||
"name": "MetaMask",
|
||||
"short_name": "Metamask",
|
||||
"name": "__MSG_appName__",
|
||||
"short_name": "__MSG_appName__",
|
||||
"version": "4.2.0",
|
||||
"manifest_version": 2,
|
||||
"author": "https://metamask.io",
|
||||
"description": "Ethereum Browser Extension",
|
||||
"description": "__MSG_appDescription__",
|
||||
"commands": {
|
||||
"_execute_browser_action": {
|
||||
"suggested_key": {
|
||||
|
18
docs/translating-guide.md
Normal file
18
docs/translating-guide.md
Normal file
@ -0,0 +1,18 @@
|
||||
# MetaMask Translation Guide
|
||||
|
||||
The MetaMask browser extension supports new translations added in the form of new locales files added in `app/_locales`.
|
||||
|
||||
- [The MDN Guide to Internationalizing Extensions](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Internationalization)
|
||||
|
||||
## Adding a new Language
|
||||
|
||||
Each supported language is represented by a folder in `app/_locales` whose name is that language's subtag ([look up a language subtag using this tool](https://r12a.github.io/app-subtags/)).
|
||||
|
||||
Inside that folder there should be a `messages.json` file that follows the specified format. An easy way to start your translation is to first duplicate `app/_locales/en/messages.json` (the english translation), and then update the `message` key for each in-app message.
|
||||
|
||||
That's it! When MetaMask is loaded on a computer with that language set as the system language, they will see your translation instead of the default one.
|
||||
|
||||
## Testing
|
||||
|
||||
To verify that your translation works, you will need to [build a local copy](https://github.com/MetaMask/metamask-extension#building-locally) of MetaMask.
|
||||
|
@ -2,6 +2,7 @@ const inherits = require('util').inherits
|
||||
const Component = require('react').Component
|
||||
const h = require('react-hyperscript')
|
||||
const connect = require('react-redux').connect
|
||||
const t = require('../../../i18n')
|
||||
import Select from 'react-select'
|
||||
|
||||
// Subviews
|
||||
@ -9,8 +10,8 @@ const JsonImportView = require('./json.js')
|
||||
const PrivateKeyImportView = require('./private-key.js')
|
||||
|
||||
const menuItems = [
|
||||
'Private Key',
|
||||
'JSON File',
|
||||
t('privateKey'),
|
||||
t('jsonFile'),
|
||||
]
|
||||
|
||||
module.exports = connect(mapStateToProps)(AccountImportSubview)
|
||||
@ -85,9 +86,9 @@ AccountImportSubview.prototype.renderImportView = function () {
|
||||
const current = type || menuItems[0]
|
||||
|
||||
switch (current) {
|
||||
case 'Private Key':
|
||||
case t('privateKey'):
|
||||
return h(PrivateKeyImportView)
|
||||
case 'JSON File':
|
||||
case t('jsonFile'):
|
||||
return h(JsonImportView)
|
||||
default:
|
||||
return h(JsonImportView)
|
||||
|
@ -4,6 +4,7 @@ const h = require('react-hyperscript')
|
||||
const connect = require('react-redux').connect
|
||||
const actions = require('../../actions')
|
||||
const FileInput = require('react-simple-file-input').default
|
||||
const t = require('../../../i18n')
|
||||
|
||||
const HELP_LINK = 'https://support.metamask.io/kb/article/7-importing-accounts'
|
||||
|
||||
@ -23,11 +24,11 @@ class JsonImportSubview extends Component {
|
||||
return (
|
||||
h('div.new-account-import-form__json', [
|
||||
|
||||
h('p', 'Used by a variety of different clients'),
|
||||
h('p', t('usedByClients')),
|
||||
h('a.warning', {
|
||||
href: HELP_LINK,
|
||||
target: '_blank',
|
||||
}, 'File import not working? Click here!'),
|
||||
}, t('fileImportFail')),
|
||||
|
||||
h(FileInput, {
|
||||
readAs: 'text',
|
||||
@ -42,7 +43,7 @@ class JsonImportSubview extends Component {
|
||||
|
||||
h('input.new-account-import-form__input-password', {
|
||||
type: 'password',
|
||||
placeholder: 'Enter password',
|
||||
placeholder: t('enterPassword'),
|
||||
id: 'json-password-box',
|
||||
onKeyPress: this.createKeyringOnEnter.bind(this),
|
||||
}),
|
||||
@ -52,13 +53,13 @@ class JsonImportSubview extends Component {
|
||||
h('button.new-account-create-form__button-cancel', {
|
||||
onClick: () => this.props.goHome(),
|
||||
}, [
|
||||
'CANCEL',
|
||||
t('cancel'),
|
||||
]),
|
||||
|
||||
h('button.new-account-create-form__button-create', {
|
||||
onClick: () => this.createNewKeychain(),
|
||||
}, [
|
||||
'IMPORT',
|
||||
t('import'),
|
||||
]),
|
||||
|
||||
]),
|
||||
@ -90,7 +91,7 @@ class JsonImportSubview extends Component {
|
||||
const { fileContents } = state
|
||||
|
||||
if (!fileContents) {
|
||||
const message = 'You must select a file to import.'
|
||||
const message = t('needImportFile')
|
||||
return this.props.displayWarning(message)
|
||||
}
|
||||
|
||||
@ -98,10 +99,10 @@ class JsonImportSubview extends Component {
|
||||
const password = passwordInput.value
|
||||
|
||||
if (!password) {
|
||||
const message = 'You must enter a password for the selected file.'
|
||||
const message = t('needImportPassword')
|
||||
return this.props.displayWarning(message)
|
||||
}
|
||||
|
||||
|
||||
this.props.importNewJsonAccount([ fileContents, password ])
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ const Component = require('react').Component
|
||||
const h = require('react-hyperscript')
|
||||
const connect = require('react-redux').connect
|
||||
const actions = require('../../actions')
|
||||
const t = require('../../../i18n')
|
||||
|
||||
module.exports = connect(mapStateToProps, mapDispatchToProps)(PrivateKeyImportView)
|
||||
|
||||
@ -33,9 +34,9 @@ PrivateKeyImportView.prototype.render = function () {
|
||||
return (
|
||||
h('div.new-account-import-form__private-key', [
|
||||
|
||||
h('div.new-account-import-form__private-key-password-container', [
|
||||
h('span.new-account-create-form__instruction', t('pastePrivateKey')),
|
||||
|
||||
h('span.new-account-import-form__instruction', 'Paste your private key string here:'),
|
||||
h('div.new-account-import-form__private-key-password-container', [
|
||||
|
||||
h('input.new-account-import-form__input-password', {
|
||||
type: 'password',
|
||||
@ -47,16 +48,16 @@ PrivateKeyImportView.prototype.render = function () {
|
||||
|
||||
h('div.new-account-import-form__buttons', {}, [
|
||||
|
||||
h('button.new-account-create-form__button-cancel', {
|
||||
h('button.new-account-create-form__button-cancel.allcaps', {
|
||||
onClick: () => goHome(),
|
||||
}, [
|
||||
'CANCEL',
|
||||
t('cancel'),
|
||||
]),
|
||||
|
||||
h('button.new-account-create-form__button-create', {
|
||||
h('button.new-account-create-form__button-create.allcaps', {
|
||||
onClick: () => this.createNewKeychain(),
|
||||
}, [
|
||||
'IMPORT',
|
||||
t('import'),
|
||||
]),
|
||||
|
||||
]),
|
||||
|
@ -2,6 +2,7 @@ const inherits = require('util').inherits
|
||||
const Component = require('react').Component
|
||||
const h = require('react-hyperscript')
|
||||
const connect = require('react-redux').connect
|
||||
const t = require('../../../i18n')
|
||||
|
||||
module.exports = connect(mapStateToProps)(SeedImportSubview)
|
||||
|
||||
@ -20,11 +21,10 @@ SeedImportSubview.prototype.render = function () {
|
||||
style: {
|
||||
},
|
||||
}, [
|
||||
`Paste your seed phrase here!`,
|
||||
t('pasteSeed'),
|
||||
h('textarea'),
|
||||
h('br'),
|
||||
h('button', 'Submit'),
|
||||
h('button', t('submit')),
|
||||
])
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,7 @@ const PropTypes = require('prop-types')
|
||||
const h = require('react-hyperscript')
|
||||
const { connect } = require('react-redux')
|
||||
const actions = require('../../actions')
|
||||
const t = require('../../../i18n')
|
||||
|
||||
class NewAccountCreateForm extends Component {
|
||||
constructor (props) {
|
||||
@ -13,7 +14,7 @@ class NewAccountCreateForm extends Component {
|
||||
|
||||
this.state = {
|
||||
newAccountName: '',
|
||||
defaultAccountName: `Account ${newAccountNumber}`,
|
||||
defaultAccountName: t('newAccountNumberName', newAccountNumber),
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,7 +25,7 @@ class NewAccountCreateForm extends Component {
|
||||
return h('div.new-account-create-form', [
|
||||
|
||||
h('div.new-account-create-form__input-label', {}, [
|
||||
'Account Name',
|
||||
t('accountName'),
|
||||
]),
|
||||
|
||||
h('div.new-account-create-form__input-wrapper', {}, [
|
||||
@ -37,16 +38,16 @@ class NewAccountCreateForm extends Component {
|
||||
|
||||
h('div.new-account-create-form__buttons', {}, [
|
||||
|
||||
h('button.new-account-create-form__button-cancel', {
|
||||
h('button.new-account-create-form__button-cancel.allcaps', {
|
||||
onClick: () => this.props.goHome(),
|
||||
}, [
|
||||
'CANCEL',
|
||||
t('cancel'),
|
||||
]),
|
||||
|
||||
h('button.new-account-create-form__button-create', {
|
||||
h('button.new-account-create-form__button-create.allcaps', {
|
||||
onClick: () => this.props.createAccount(newAccountName || defaultAccountName),
|
||||
}, [
|
||||
'CREATE',
|
||||
t('create'),
|
||||
]),
|
||||
|
||||
]),
|
||||
|
@ -3,6 +3,7 @@ const h = require('react-hyperscript')
|
||||
const inherits = require('util').inherits
|
||||
const connect = require('react-redux').connect
|
||||
const actions = require('../../actions')
|
||||
const t = require('../../../i18n')
|
||||
const { getCurrentViewContext } = require('../../selectors')
|
||||
const classnames = require('classnames')
|
||||
|
||||
@ -42,10 +43,10 @@ AccountDetailsModal.prototype.render = function () {
|
||||
const { displayedForm, displayForm } = this.props
|
||||
|
||||
return h('div.new-account', {}, [
|
||||
|
||||
|
||||
h('div.new-account__header', [
|
||||
|
||||
h('div.new-account__title', 'New Account'),
|
||||
h('div.new-account__title', t('newAccount')),
|
||||
|
||||
h('div.new-account__tabs', [
|
||||
|
||||
@ -55,7 +56,7 @@ AccountDetailsModal.prototype.render = function () {
|
||||
'new-account__tabs__unselected cursor-pointer': displayedForm !== 'CREATE',
|
||||
}),
|
||||
onClick: () => displayForm('CREATE'),
|
||||
}, 'Create'),
|
||||
}, t('createDen')),
|
||||
|
||||
h('div.new-account__tabs__tab', {
|
||||
className: classnames('new-account__tabs__tab', {
|
||||
@ -63,7 +64,7 @@ AccountDetailsModal.prototype.render = function () {
|
||||
'new-account__tabs__unselected cursor-pointer': displayedForm !== 'IMPORT',
|
||||
}),
|
||||
onClick: () => displayForm('IMPORT'),
|
||||
}, 'Import'),
|
||||
}, t('import')),
|
||||
|
||||
]),
|
||||
|
||||
|
@ -4,6 +4,7 @@ const connect = require('react-redux').connect
|
||||
const h = require('react-hyperscript')
|
||||
const actions = require('./actions')
|
||||
const classnames = require('classnames')
|
||||
const t = require('../i18n')
|
||||
|
||||
// mascara
|
||||
const MascaraFirstTime = require('../../mascara/src/app/first-time').default
|
||||
@ -293,8 +294,8 @@ App.prototype.renderAppBar = function () {
|
||||
|
||||
// metamask name
|
||||
h('.flex-row', [
|
||||
h('h1', 'MetaMask'),
|
||||
h('div.beta-label', 'BETA'),
|
||||
h('h1', t('appName')),
|
||||
h('div.beta-label', t('beta')),
|
||||
]),
|
||||
]),
|
||||
|
||||
|
@ -9,6 +9,7 @@ const DropdownMenuItem = require('./dropdown').DropdownMenuItem
|
||||
const Identicon = require('./identicon')
|
||||
const ethUtil = require('ethereumjs-util')
|
||||
const copyToClipboard = require('copy-to-clipboard')
|
||||
const t = require('../../i18n')
|
||||
|
||||
class AccountDropdowns extends Component {
|
||||
constructor (props) {
|
||||
@ -79,7 +80,7 @@ class AccountDropdowns extends Component {
|
||||
try { // Sometimes keyrings aren't loaded yet:
|
||||
const type = keyring.type
|
||||
const isLoose = type !== 'HD Key Tree'
|
||||
return isLoose ? h('.keyring-label', 'LOOSE') : null
|
||||
return isLoose ? h('.keyring-label.allcaps', t('loose')) : null
|
||||
} catch (e) { return }
|
||||
}
|
||||
|
||||
@ -129,7 +130,7 @@ class AccountDropdowns extends Component {
|
||||
diameter: 32,
|
||||
},
|
||||
),
|
||||
h('span', { style: { marginLeft: '20px', fontSize: '24px' } }, 'Create Account'),
|
||||
h('span', { style: { marginLeft: '20px', fontSize: '24px' } }, t('createAccount')),
|
||||
],
|
||||
),
|
||||
h(
|
||||
@ -154,7 +155,7 @@ class AccountDropdowns extends Component {
|
||||
fontSize: '24px',
|
||||
marginBottom: '5px',
|
||||
},
|
||||
}, 'Import Account'),
|
||||
}, t('importAccount')),
|
||||
]
|
||||
),
|
||||
]
|
||||
@ -192,7 +193,7 @@ class AccountDropdowns extends Component {
|
||||
global.platform.openWindow({ url })
|
||||
},
|
||||
},
|
||||
'View account on Etherscan',
|
||||
t('etherscanView'),
|
||||
),
|
||||
h(
|
||||
DropdownMenuItem,
|
||||
@ -204,7 +205,7 @@ class AccountDropdowns extends Component {
|
||||
actions.showQrView(selected, identity ? identity.name : '')
|
||||
},
|
||||
},
|
||||
'Show QR Code',
|
||||
t('showQRCode'),
|
||||
),
|
||||
h(
|
||||
DropdownMenuItem,
|
||||
@ -216,7 +217,7 @@ class AccountDropdowns extends Component {
|
||||
copyToClipboard(checkSumAddress)
|
||||
},
|
||||
},
|
||||
'Copy Address to clipboard',
|
||||
t('copyAddress'),
|
||||
),
|
||||
h(
|
||||
DropdownMenuItem,
|
||||
@ -226,7 +227,7 @@ class AccountDropdowns extends Component {
|
||||
actions.requestAccountExport()
|
||||
},
|
||||
},
|
||||
'Export Private Key',
|
||||
t('exportPrivateKey'),
|
||||
),
|
||||
]
|
||||
)
|
||||
|
@ -6,6 +6,7 @@ const copyToClipboard = require('copy-to-clipboard')
|
||||
const actions = require('../actions')
|
||||
const ethUtil = require('ethereumjs-util')
|
||||
const connect = require('react-redux').connect
|
||||
const t = require('../../i18n')
|
||||
|
||||
module.exports = connect(mapStateToProps)(ExportAccountView)
|
||||
|
||||
@ -35,7 +36,7 @@ ExportAccountView.prototype.render = function () {
|
||||
if (notExporting) return h('div')
|
||||
|
||||
if (exportRequested) {
|
||||
const warning = `Export private keys at your own risk.`
|
||||
const warning = t('exportPrivateKeyWarning')
|
||||
return (
|
||||
h('div', {
|
||||
style: {
|
||||
@ -53,7 +54,7 @@ ExportAccountView.prototype.render = function () {
|
||||
h('p.error', warning),
|
||||
h('input#exportAccount.sizing-input', {
|
||||
type: 'password',
|
||||
placeholder: 'confirm password',
|
||||
placeholder: t('confirmPassword').toLowerCase(),
|
||||
onKeyPress: this.onExportKeyPress.bind(this),
|
||||
style: {
|
||||
position: 'relative',
|
||||
@ -74,10 +75,10 @@ ExportAccountView.prototype.render = function () {
|
||||
style: {
|
||||
marginRight: '10px',
|
||||
},
|
||||
}, 'Submit'),
|
||||
}, t('submit')),
|
||||
h('button', {
|
||||
onClick: () => this.props.dispatch(actions.backToAccountDetail(this.props.address)),
|
||||
}, 'Cancel'),
|
||||
}, t('cancel')),
|
||||
]),
|
||||
(this.props.warning) && (
|
||||
h('span.error', {
|
||||
@ -98,7 +99,7 @@ ExportAccountView.prototype.render = function () {
|
||||
margin: '0 20px',
|
||||
},
|
||||
}, [
|
||||
h('label', 'Your private key (click to copy):'),
|
||||
h('label', t('copyPrivateKey') + ':'),
|
||||
h('p.error.cursor-pointer', {
|
||||
style: {
|
||||
textOverflow: 'ellipsis',
|
||||
@ -112,13 +113,13 @@ ExportAccountView.prototype.render = function () {
|
||||
}, plainKey),
|
||||
h('button', {
|
||||
onClick: () => this.props.dispatch(actions.backToAccountDetail(this.props.address)),
|
||||
}, 'Done'),
|
||||
}, t('done')),
|
||||
h('button', {
|
||||
style: {
|
||||
marginLeft: '10px',
|
||||
},
|
||||
onClick: () => exportAsFile(`MetaMask ${nickname} Private Key`, plainKey),
|
||||
}, 'Save as File'),
|
||||
}, t('saveAsFile')),
|
||||
])
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ const actions = require('../../actions')
|
||||
const { Menu, Item, Divider, CloseArea } = require('../dropdowns/components/menu')
|
||||
const Identicon = require('../identicon')
|
||||
const { formatBalance } = require('../../util')
|
||||
const t = require('../../../i18n')
|
||||
|
||||
module.exports = connect(mapStateToProps, mapDispatchToProps)(AccountMenu)
|
||||
|
||||
@ -70,10 +71,10 @@ AccountMenu.prototype.render = function () {
|
||||
h(Item, {
|
||||
className: 'account-menu__header',
|
||||
}, [
|
||||
'My Accounts',
|
||||
t('myAccounts'),
|
||||
h('button.account-menu__logout-button', {
|
||||
onClick: lockMetamask,
|
||||
}, 'Log out'),
|
||||
}, t('logout')),
|
||||
]),
|
||||
h(Divider),
|
||||
h('div.account-menu__accounts', this.renderAccounts()),
|
||||
@ -81,23 +82,23 @@ AccountMenu.prototype.render = function () {
|
||||
h(Item, {
|
||||
onClick: () => showNewAccountPage('CREATE'),
|
||||
icon: h('img.account-menu__item-icon', { src: 'images/plus-btn-white.svg' }),
|
||||
text: 'Create Account',
|
||||
text: t('createAccount'),
|
||||
}),
|
||||
h(Item, {
|
||||
onClick: () => showNewAccountPage('IMPORT'),
|
||||
icon: h('img.account-menu__item-icon', { src: 'images/import-account.svg' }),
|
||||
text: 'Import Account',
|
||||
text: t('importAccount'),
|
||||
}),
|
||||
h(Divider),
|
||||
h(Item, {
|
||||
onClick: showInfoPage,
|
||||
icon: h('img.account-menu__item-icon', { src: 'images/mm-info-icon.svg' }),
|
||||
text: 'Info & Help',
|
||||
icon: h('img', { src: 'images/mm-info-icon.svg' }),
|
||||
text: t('infoHelp'),
|
||||
}),
|
||||
h(Item, {
|
||||
onClick: showConfigPage,
|
||||
icon: h('img.account-menu__item-icon', { src: 'images/settings.svg' }),
|
||||
text: 'Settings',
|
||||
text: t('settings'),
|
||||
}),
|
||||
])
|
||||
}
|
||||
@ -155,6 +156,6 @@ AccountMenu.prototype.indicateIfLoose = function (keyring) {
|
||||
try { // Sometimes keyrings aren't loaded yet:
|
||||
const type = keyring.type
|
||||
const isLoose = type !== 'HD Key Tree'
|
||||
return isLoose ? h('.keyring-label', 'IMPORTED') : null
|
||||
return isLoose ? h('.keyring-label.allcaps', t('imported')) : null
|
||||
} catch (e) { return }
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ const inherits = require('util').inherits
|
||||
const ethUtil = require('ethereumjs-util')
|
||||
const BN = ethUtil.BN
|
||||
const extend = require('xtend')
|
||||
const t = require('../../i18n')
|
||||
|
||||
module.exports = BnAsDecimalInput
|
||||
|
||||
@ -136,13 +137,13 @@ BnAsDecimalInput.prototype.constructWarning = function () {
|
||||
let message = name ? name + ' ' : ''
|
||||
|
||||
if (min && max) {
|
||||
message += `must be greater than or equal to ${newMin} ${suffix} and less than or equal to ${newMax} ${suffix}.`
|
||||
message += t('betweenMinAndMax', [`${newMin} ${suffix}`, `${newMax} ${suffix}`])
|
||||
} else if (min) {
|
||||
message += `must be greater than or equal to ${newMin} ${suffix}.`
|
||||
message += t('greaterThanMin', [`${newMin} ${suffix}`])
|
||||
} else if (max) {
|
||||
message += `must be less than or equal to ${newMax} ${suffix}.`
|
||||
message += t('lessThanMax', [`${newMax} ${suffix}`])
|
||||
} else {
|
||||
message += 'Invalid input.'
|
||||
message += t('invalidInput')
|
||||
}
|
||||
|
||||
return message
|
||||
|
@ -9,6 +9,7 @@ const Loading = require('./loading')
|
||||
const AccountPanel = require('./account-panel')
|
||||
const RadioList = require('./custom-radio-list')
|
||||
const networkNames = require('../../../app/scripts/config.js').networkNames
|
||||
const t = require('../../i18n')
|
||||
|
||||
module.exports = connect(mapStateToProps)(BuyButtonSubview)
|
||||
|
||||
@ -76,7 +77,7 @@ BuyButtonSubview.prototype.headerSubview = function () {
|
||||
paddingTop: '4px',
|
||||
paddingBottom: '4px',
|
||||
},
|
||||
}, 'Deposit Eth'),
|
||||
}, t('depositEth')),
|
||||
]),
|
||||
|
||||
// loading indication
|
||||
@ -118,7 +119,7 @@ BuyButtonSubview.prototype.headerSubview = function () {
|
||||
paddingTop: '4px',
|
||||
paddingBottom: '4px',
|
||||
},
|
||||
}, 'Select Service'),
|
||||
}, t('selectService')),
|
||||
]),
|
||||
|
||||
])
|
||||
@ -143,7 +144,7 @@ BuyButtonSubview.prototype.primarySubview = function () {
|
||||
case '4':
|
||||
case '42':
|
||||
const networkName = networkNames[network]
|
||||
const label = `${networkName} Test Faucet`
|
||||
const label = `${networkName} ${t('testFaucet')}`
|
||||
return (
|
||||
h('div.flex-column', {
|
||||
style: {
|
||||
@ -164,14 +165,14 @@ BuyButtonSubview.prototype.primarySubview = function () {
|
||||
style: {
|
||||
marginTop: '15px',
|
||||
},
|
||||
}, 'Borrow With Dharma (Beta)')
|
||||
}, t('borrowDharma'))
|
||||
) : null,
|
||||
])
|
||||
)
|
||||
|
||||
default:
|
||||
return (
|
||||
h('h2.error', 'Unknown network ID')
|
||||
h('h2.error', t('unknownNetworkId'))
|
||||
)
|
||||
|
||||
}
|
||||
@ -203,8 +204,8 @@ BuyButtonSubview.prototype.mainnetSubview = function () {
|
||||
'ShapeShift',
|
||||
],
|
||||
subtext: {
|
||||
'Coinbase': 'Crypto/FIAT (USA only)',
|
||||
'ShapeShift': 'Crypto',
|
||||
'Coinbase': `${t('crypto')}/${t('fiat')} (${t('usaOnly')})`,
|
||||
'ShapeShift': t('crypto'),
|
||||
},
|
||||
onClick: this.radioHandler.bind(this),
|
||||
}),
|
||||
|
@ -3,6 +3,7 @@ const h = require('react-hyperscript')
|
||||
const inherits = require('util').inherits
|
||||
const connect = require('react-redux').connect
|
||||
const actions = require('../actions')
|
||||
const t = require('../../i18n')
|
||||
|
||||
module.exports = connect(mapStateToProps)(CoinbaseForm)
|
||||
|
||||
@ -37,11 +38,11 @@ CoinbaseForm.prototype.render = function () {
|
||||
}, [
|
||||
h('button.btn-green', {
|
||||
onClick: this.toCoinbase.bind(this),
|
||||
}, 'Continue to Coinbase'),
|
||||
}, t('continueToCoinbase')),
|
||||
|
||||
h('button.btn-red', {
|
||||
onClick: () => props.dispatch(actions.goHome()),
|
||||
}, 'Cancel'),
|
||||
}, t('cancel')),
|
||||
]),
|
||||
])
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ const Component = require('react').Component
|
||||
const h = require('react-hyperscript')
|
||||
const inherits = require('util').inherits
|
||||
const copyToClipboard = require('copy-to-clipboard')
|
||||
const t = require('../../i18n')
|
||||
|
||||
const Tooltip = require('./tooltip')
|
||||
|
||||
@ -22,7 +23,7 @@ CopyButton.prototype.render = function () {
|
||||
const value = props.value
|
||||
const copied = state.copied
|
||||
|
||||
const message = copied ? 'Copied' : props.title || ' Copy '
|
||||
const message = copied ? t('copiedButton') : props.title || t('copyButton')
|
||||
|
||||
return h('.copy-button', {
|
||||
style: {
|
||||
|
@ -4,6 +4,7 @@ const inherits = require('util').inherits
|
||||
|
||||
const Tooltip = require('./tooltip')
|
||||
const copyToClipboard = require('copy-to-clipboard')
|
||||
const t = require('../../i18n')
|
||||
|
||||
module.exports = Copyable
|
||||
|
||||
@ -22,7 +23,7 @@ Copyable.prototype.render = function () {
|
||||
const { copied } = state
|
||||
|
||||
return h(Tooltip, {
|
||||
title: copied ? 'Copied!' : 'Copy',
|
||||
title: copied ? t('copiedExclamation') : t('copy'),
|
||||
position: 'bottom',
|
||||
}, h('span', {
|
||||
style: {
|
||||
|
@ -3,6 +3,7 @@ const h = require('react-hyperscript')
|
||||
const inherits = require('util').inherits
|
||||
const connect = require('react-redux').connect
|
||||
const actions = require('../../actions')
|
||||
const t = require('../../../i18n')
|
||||
const GasModalCard = require('./gas-modal-card')
|
||||
|
||||
const ethUtil = require('ethereumjs-util')
|
||||
@ -146,7 +147,7 @@ CustomizeGasModal.prototype.validate = function ({ gasTotal, gasLimit }) {
|
||||
})
|
||||
|
||||
if (!balanceIsSufficient) {
|
||||
error = 'Insufficient balance for current gas total'
|
||||
error = t('balanceIsInsufficientGas')
|
||||
}
|
||||
|
||||
const gasLimitTooLow = gasLimit && conversionGreaterThan(
|
||||
@ -162,7 +163,7 @@ CustomizeGasModal.prototype.validate = function ({ gasTotal, gasLimit }) {
|
||||
)
|
||||
|
||||
if (gasLimitTooLow) {
|
||||
error = 'Gas limit must be at least 21000'
|
||||
error = t('gasLimitTooLow')
|
||||
}
|
||||
|
||||
this.setState({ error })
|
||||
@ -239,7 +240,7 @@ CustomizeGasModal.prototype.render = function () {
|
||||
}, [
|
||||
h('div.send-v2__customize-gas__header', {}, [
|
||||
|
||||
h('div.send-v2__customize-gas__title', 'Customize Gas'),
|
||||
h('div.send-v2__customize-gas__title', t('customGas')),
|
||||
|
||||
h('div.send-v2__customize-gas__close', {
|
||||
onClick: hideModal,
|
||||
@ -255,8 +256,8 @@ CustomizeGasModal.prototype.render = function () {
|
||||
// max: 1000,
|
||||
step: multiplyCurrencies(MIN_GAS_PRICE_GWEI, 10),
|
||||
onChange: value => this.convertAndSetGasPrice(value),
|
||||
title: 'Gas Price (GWEI)',
|
||||
copy: 'We calculate the suggested gas prices based on network success rates.',
|
||||
title: t('gasPrice'),
|
||||
copy: t('gasPriceCalculation'),
|
||||
}),
|
||||
|
||||
h(GasModalCard, {
|
||||
@ -265,8 +266,8 @@ CustomizeGasModal.prototype.render = function () {
|
||||
// max: 100000,
|
||||
step: 1,
|
||||
onChange: value => this.convertAndSetGasLimit(value),
|
||||
title: 'Gas Limit',
|
||||
copy: 'We calculate the suggested gas limit based on network success rates.',
|
||||
title: t('gasLimit'),
|
||||
copy: t('gasLimitCalculation'),
|
||||
}),
|
||||
|
||||
]),
|
||||
@ -279,16 +280,16 @@ CustomizeGasModal.prototype.render = function () {
|
||||
|
||||
h('div.send-v2__customize-gas__revert', {
|
||||
onClick: () => this.revert(),
|
||||
}, ['Revert']),
|
||||
}, [t('revert')]),
|
||||
|
||||
h('div.send-v2__customize-gas__buttons', [
|
||||
h('div.send-v2__customize-gas__cancel', {
|
||||
h('div.send-v2__customize-gas__cancel.allcaps', {
|
||||
onClick: this.props.hideModal,
|
||||
}, ['CANCEL']),
|
||||
}, [t('cancel')]),
|
||||
|
||||
h(`div.send-v2__customize-gas__save${error ? '__error' : ''}`, {
|
||||
h(`div.send-v2__customize-gas__save${error ? '__error' : ''}.allcaps`, {
|
||||
onClick: () => !error && this.save(gasPrice, gasLimit, gasTotal),
|
||||
}, ['SAVE']),
|
||||
}, [t('save')]),
|
||||
]),
|
||||
|
||||
]),
|
||||
|
@ -10,6 +10,7 @@ const Identicon = require('../../identicon')
|
||||
const ethUtil = require('ethereumjs-util')
|
||||
const copyToClipboard = require('copy-to-clipboard')
|
||||
const { formatBalance } = require('../../../util')
|
||||
const t = require('../../../../i18n')
|
||||
|
||||
class AccountDropdowns extends Component {
|
||||
constructor (props) {
|
||||
@ -121,7 +122,7 @@ class AccountDropdowns extends Component {
|
||||
flex: '3 3 auto',
|
||||
},
|
||||
}, [
|
||||
h('span.account-dropdown-edit-button', {
|
||||
h('span.account-dropdown-edit-button.allcaps', {
|
||||
style: {
|
||||
fontSize: '16px',
|
||||
},
|
||||
@ -129,7 +130,7 @@ class AccountDropdowns extends Component {
|
||||
actions.showEditAccountModal(identity)
|
||||
},
|
||||
}, [
|
||||
'Edit',
|
||||
t('edit'),
|
||||
]),
|
||||
]),
|
||||
|
||||
@ -143,7 +144,7 @@ class AccountDropdowns extends Component {
|
||||
try { // Sometimes keyrings aren't loaded yet:
|
||||
const type = keyring.type
|
||||
const isLoose = type !== 'HD Key Tree'
|
||||
return isLoose ? h('.keyring-label', 'IMPORTED') : null
|
||||
return isLoose ? h('.keyring-label.allcaps', t('loose')) : null
|
||||
} catch (e) { return }
|
||||
}
|
||||
|
||||
@ -201,7 +202,7 @@ class AccountDropdowns extends Component {
|
||||
fontSize: '16px',
|
||||
lineHeight: '23px',
|
||||
},
|
||||
}, 'Create Account'),
|
||||
}, t('createAccount')),
|
||||
],
|
||||
),
|
||||
h(
|
||||
@ -235,7 +236,7 @@ class AccountDropdowns extends Component {
|
||||
fontSize: '16px',
|
||||
lineHeight: '23px',
|
||||
},
|
||||
}, 'Import Account'),
|
||||
}, t('importAccount')),
|
||||
]
|
||||
),
|
||||
]
|
||||
@ -286,7 +287,7 @@ class AccountDropdowns extends Component {
|
||||
menuItemStyles,
|
||||
),
|
||||
},
|
||||
'Account Details',
|
||||
t('accountDetails'),
|
||||
),
|
||||
h(
|
||||
DropdownMenuItem,
|
||||
@ -302,7 +303,7 @@ class AccountDropdowns extends Component {
|
||||
menuItemStyles,
|
||||
),
|
||||
},
|
||||
'View account on Etherscan',
|
||||
t('etherscanView'),
|
||||
),
|
||||
h(
|
||||
DropdownMenuItem,
|
||||
@ -318,7 +319,7 @@ class AccountDropdowns extends Component {
|
||||
menuItemStyles,
|
||||
),
|
||||
},
|
||||
'Copy Address to clipboard',
|
||||
t('copyAddress'),
|
||||
),
|
||||
h(
|
||||
DropdownMenuItem,
|
||||
@ -330,7 +331,7 @@ class AccountDropdowns extends Component {
|
||||
menuItemStyles,
|
||||
),
|
||||
},
|
||||
'Export Private Key',
|
||||
t('exportPrivateKey'),
|
||||
),
|
||||
h(
|
||||
DropdownMenuItem,
|
||||
@ -345,7 +346,7 @@ class AccountDropdowns extends Component {
|
||||
menuItemStyles,
|
||||
),
|
||||
},
|
||||
'Add Token',
|
||||
t('addToken'),
|
||||
),
|
||||
|
||||
]
|
||||
@ -463,4 +464,3 @@ function mapStateToProps (state) {
|
||||
}
|
||||
|
||||
module.exports = connect(mapStateToProps, mapDispatchToProps)(AccountDropdowns)
|
||||
|
||||
|
@ -6,6 +6,7 @@ const actions = require('../../actions')
|
||||
const Dropdown = require('./components/dropdown').Dropdown
|
||||
const DropdownMenuItem = require('./components/dropdown').DropdownMenuItem
|
||||
const NetworkDropdownIcon = require('./components/network-dropdown-icon')
|
||||
const t = require('../../../i18n')
|
||||
const R = require('ramda')
|
||||
|
||||
// classes from nodes of the toggle element.
|
||||
@ -93,13 +94,13 @@ NetworkDropdown.prototype.render = function () {
|
||||
}, [
|
||||
|
||||
h('div.network-dropdown-header', {}, [
|
||||
h('div.network-dropdown-title', {}, 'Networks'),
|
||||
h('div.network-dropdown-title', {}, t('networks')),
|
||||
|
||||
h('div.network-dropdown-divider'),
|
||||
|
||||
h('div.network-dropdown-content',
|
||||
{},
|
||||
'The default network for Ether transactions is Main Net.'
|
||||
t('defaultNetwork')
|
||||
),
|
||||
]),
|
||||
|
||||
@ -121,7 +122,7 @@ NetworkDropdown.prototype.render = function () {
|
||||
style: {
|
||||
color: providerType === 'mainnet' ? '#ffffff' : '#9b9b9b',
|
||||
},
|
||||
}, 'Main Ethereum Network'),
|
||||
}, t('mainnet')),
|
||||
]
|
||||
),
|
||||
|
||||
@ -143,7 +144,7 @@ NetworkDropdown.prototype.render = function () {
|
||||
style: {
|
||||
color: providerType === 'ropsten' ? '#ffffff' : '#9b9b9b',
|
||||
},
|
||||
}, 'Ropsten Test Network'),
|
||||
}, t('ropsten')),
|
||||
]
|
||||
),
|
||||
|
||||
@ -165,7 +166,7 @@ NetworkDropdown.prototype.render = function () {
|
||||
style: {
|
||||
color: providerType === 'kovan' ? '#ffffff' : '#9b9b9b',
|
||||
},
|
||||
}, 'Kovan Test Network'),
|
||||
}, t('kovan')),
|
||||
]
|
||||
),
|
||||
|
||||
@ -187,7 +188,7 @@ NetworkDropdown.prototype.render = function () {
|
||||
style: {
|
||||
color: providerType === 'rinkeby' ? '#ffffff' : '#9b9b9b',
|
||||
},
|
||||
}, 'Rinkeby Test Network'),
|
||||
}, t('rinkeby')),
|
||||
]
|
||||
),
|
||||
|
||||
@ -209,7 +210,7 @@ NetworkDropdown.prototype.render = function () {
|
||||
style: {
|
||||
color: activeNetwork === 'http://localhost:8545' ? '#ffffff' : '#9b9b9b',
|
||||
},
|
||||
}, 'Localhost 8545'),
|
||||
}, t('localhost')),
|
||||
]
|
||||
),
|
||||
|
||||
@ -233,7 +234,7 @@ NetworkDropdown.prototype.render = function () {
|
||||
style: {
|
||||
color: activeNetwork === 'custom' ? '#ffffff' : '#9b9b9b',
|
||||
},
|
||||
}, 'Custom RPC'),
|
||||
}, t('customRPC')),
|
||||
]
|
||||
),
|
||||
|
||||
@ -248,15 +249,15 @@ NetworkDropdown.prototype.getNetworkName = function () {
|
||||
let name
|
||||
|
||||
if (providerName === 'mainnet') {
|
||||
name = 'Main Ethereum Network'
|
||||
name = t('mainnet')
|
||||
} else if (providerName === 'ropsten') {
|
||||
name = 'Ropsten Test Network'
|
||||
name = t('ropsten')
|
||||
} else if (providerName === 'kovan') {
|
||||
name = 'Kovan Test Network'
|
||||
name = t('kovan')
|
||||
} else if (providerName === 'rinkeby') {
|
||||
name = 'Rinkeby Test Network'
|
||||
name = t('rinkeby')
|
||||
} else {
|
||||
name = 'Unknown Private Network'
|
||||
name = t('unknownNetwork')
|
||||
}
|
||||
|
||||
return name
|
||||
|
@ -3,6 +3,7 @@ const h = require('react-hyperscript')
|
||||
const inherits = require('util').inherits
|
||||
const connect = require('react-redux').connect
|
||||
const actions = require('../../actions')
|
||||
const t = require('../../../i18n')
|
||||
|
||||
module.exports = connect(null, mapDispatchToProps)(TokenMenuDropdown)
|
||||
|
||||
@ -43,7 +44,7 @@ TokenMenuDropdown.prototype.render = function () {
|
||||
showHideTokenConfirmationModal(this.props.token)
|
||||
this.props.onClose()
|
||||
},
|
||||
}, 'Hide Token'),
|
||||
}, t('hideToken')),
|
||||
|
||||
]),
|
||||
]),
|
||||
|
@ -8,6 +8,7 @@ const ENS = require('ethjs-ens')
|
||||
const networkMap = require('ethjs-ens/lib/network-map.json')
|
||||
const ensRE = /.+\..+$/
|
||||
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
|
||||
const t = require('../../i18n')
|
||||
|
||||
|
||||
module.exports = EnsInput
|
||||
@ -89,13 +90,13 @@ EnsInput.prototype.lookupEnsName = function () {
|
||||
log.info(`ENS attempting to resolve name: ${recipient}`)
|
||||
this.ens.lookup(recipient.trim())
|
||||
.then((address) => {
|
||||
if (address === ZERO_ADDRESS) throw new Error('No address has been set for this name.')
|
||||
if (address === ZERO_ADDRESS) throw new Error(t('noAddressForName'))
|
||||
if (address !== ensResolution) {
|
||||
this.setState({
|
||||
loadingEns: false,
|
||||
ensResolution: address,
|
||||
nickname: recipient.trim(),
|
||||
hoverText: address + '\nClick to Copy',
|
||||
hoverText: address + '\n' + t('clickCopy'),
|
||||
ensFailure: false,
|
||||
})
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ const inherits = require('util').inherits
|
||||
const ethUtil = require('ethereumjs-util')
|
||||
const BN = ethUtil.BN
|
||||
const extend = require('xtend')
|
||||
const t = require('../../i18n')
|
||||
|
||||
module.exports = HexAsDecimalInput
|
||||
|
||||
@ -126,13 +127,13 @@ HexAsDecimalInput.prototype.constructWarning = function () {
|
||||
let message = name ? name + ' ' : ''
|
||||
|
||||
if (min && max) {
|
||||
message += `must be greater than or equal to ${min} and less than or equal to ${max}.`
|
||||
message += t('betweenMinAndMax', [min, max])
|
||||
} else if (min) {
|
||||
message += `must be greater than or equal to ${min}.`
|
||||
message += t('greaterThanMin', [min])
|
||||
} else if (max) {
|
||||
message += `must be less than or equal to ${max}.`
|
||||
message += t('lessThanMax', [max])
|
||||
} else {
|
||||
message += 'Invalid input.'
|
||||
message += t('invalidInput')
|
||||
}
|
||||
|
||||
return message
|
||||
|
@ -8,6 +8,7 @@ const { getSelectedIdentity } = require('../../selectors')
|
||||
const genAccountLink = require('../../../lib/account-link.js')
|
||||
const QrView = require('../qr-code')
|
||||
const EditableLabel = require('../editable-label')
|
||||
const t = require('../../../i18n')
|
||||
|
||||
function mapStateToProps (state) {
|
||||
return {
|
||||
@ -64,12 +65,12 @@ AccountDetailsModal.prototype.render = function () {
|
||||
|
||||
h('button.btn-clear.account-modal__button', {
|
||||
onClick: () => global.platform.openWindow({ url: genAccountLink(address, network) }),
|
||||
}, 'View account on Etherscan'),
|
||||
}, t('etherscanView')),
|
||||
|
||||
// Holding on redesign for Export Private Key functionality
|
||||
h('button.btn-clear.account-modal__button', {
|
||||
onClick: () => showExportPrivateKeyModal(),
|
||||
}, 'Export private key'),
|
||||
}, t('exportPrivateKey')),
|
||||
|
||||
])
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ const connect = require('react-redux').connect
|
||||
const actions = require('../../actions')
|
||||
const { getSelectedIdentity } = require('../../selectors')
|
||||
const Identicon = require('../identicon')
|
||||
const t = require('../../../i18n')
|
||||
|
||||
function mapStateToProps (state) {
|
||||
return {
|
||||
@ -59,7 +60,7 @@ AccountModalContainer.prototype.render = function () {
|
||||
|
||||
h('i.fa.fa-angle-left.fa-lg'),
|
||||
|
||||
h('span.account-modal-back__text', ' Back'),
|
||||
h('span.account-modal-back__text', ' ' + t('back')),
|
||||
|
||||
]),
|
||||
|
||||
|
@ -4,6 +4,7 @@ const inherits = require('util').inherits
|
||||
const connect = require('react-redux').connect
|
||||
const actions = require('../../actions')
|
||||
const networkNames = require('../../../../app/scripts/config.js').networkNames
|
||||
const t = require('../../../i18n')
|
||||
|
||||
function mapStateToProps (state) {
|
||||
return {
|
||||
@ -56,15 +57,15 @@ BuyOptions.prototype.render = function () {
|
||||
}, [
|
||||
h('div.buy-modal-content-title', {
|
||||
style: {},
|
||||
}, 'Transfers'),
|
||||
h('div', {}, 'How would you like to deposit Ether?'),
|
||||
}, t('transfers')),
|
||||
h('div', {}, t('howToDeposit')),
|
||||
]),
|
||||
|
||||
h('div.buy-modal-content-options.flex-column.flex-center', {}, [
|
||||
|
||||
isTestNetwork
|
||||
? this.renderModalContentOption(networkName, 'Test Faucet', () => toFaucet(network))
|
||||
: this.renderModalContentOption('Coinbase', 'Deposit with Fiat', () => toCoinbase(address)),
|
||||
? this.renderModalContentOption(networkName, t('testFaucet'), () => toFaucet(network))
|
||||
: this.renderModalContentOption('Coinbase', t('depositFiat'), () => toCoinbase(address)),
|
||||
|
||||
// h('div.buy-modal-content-option', {}, [
|
||||
// h('div.buy-modal-content-option-title', {}, 'Shapeshift'),
|
||||
@ -72,8 +73,8 @@ BuyOptions.prototype.render = function () {
|
||||
// ]),,
|
||||
|
||||
this.renderModalContentOption(
|
||||
'Direct Deposit',
|
||||
'Deposit from another account',
|
||||
t('directDeposit'),
|
||||
t('depositFromAccount'),
|
||||
() => this.goToAccountDetailsModal()
|
||||
),
|
||||
|
||||
@ -84,7 +85,7 @@ BuyOptions.prototype.render = function () {
|
||||
background: 'white',
|
||||
},
|
||||
onClick: () => { this.props.hideModal() },
|
||||
}, h('div.buy-modal-content-footer#buy-modal-content-footer-text', {}, 'Cancel')),
|
||||
}, h('div.buy-modal-content-footer#buy-modal-content-footer-text', {}, t('cancel'))),
|
||||
]),
|
||||
])
|
||||
}
|
||||
|
@ -5,18 +5,18 @@ const connect = require('react-redux').connect
|
||||
const actions = require('../../actions')
|
||||
const networkNames = require('../../../../app/scripts/config.js').networkNames
|
||||
const ShapeshiftForm = require('../shapeshift-form')
|
||||
const t = require('../../../i18n')
|
||||
|
||||
const DIRECT_DEPOSIT_ROW_TITLE = 'Directly Deposit Ether'
|
||||
const DIRECT_DEPOSIT_ROW_TEXT = `If you already have some Ether, the quickest way to get Ether in
|
||||
your new wallet by direct deposit.`
|
||||
const COINBASE_ROW_TITLE = 'Buy on Coinbase'
|
||||
const COINBASE_ROW_TEXT = `Coinbase is the world’s most popular way to buy and sell bitcoin,
|
||||
ethereum, and litecoin.`
|
||||
const SHAPESHIFT_ROW_TITLE = 'Deposit with ShapeShift'
|
||||
const SHAPESHIFT_ROW_TEXT = `If you own other cryptocurrencies, you can trade and deposit Ether
|
||||
directly into your MetaMask wallet. No Account Needed.`
|
||||
const FAUCET_ROW_TITLE = 'Test Faucet'
|
||||
const faucetRowText = networkName => `Get Ether from a faucet for the ${networkName}`
|
||||
const DIRECT_DEPOSIT_ROW_TITLE = t('directDepositEther')
|
||||
const DIRECT_DEPOSIT_ROW_TEXT = t('directDepositEtherExplainer')
|
||||
const COINBASE_ROW_TITLE = t('buyCoinbase')
|
||||
const COINBASE_ROW_TEXT = t('buyCoinbaseExplainer')
|
||||
const SHAPESHIFT_ROW_TITLE = t('depositShapeShift')
|
||||
const SHAPESHIFT_ROW_TEXT = t('depositShapeShiftExplainer')
|
||||
const FAUCET_ROW_TITLE = t('testFaucet')
|
||||
const facuetRowText = (networkName) => {
|
||||
return t('getEtherFromFaucet', [networkName])
|
||||
}
|
||||
|
||||
function mapStateToProps (state) {
|
||||
return {
|
||||
@ -113,10 +113,10 @@ DepositEtherModal.prototype.render = function () {
|
||||
|
||||
h('div.page-container__header', [
|
||||
|
||||
h('div.page-container__title', 'Deposit Ether'),
|
||||
h('div.page-container__title', [t('depositEther')]),
|
||||
|
||||
h('div.page-container__subtitle', [
|
||||
'To interact with decentralized applications using MetaMask, you’ll need Ether in your wallet.',
|
||||
t('needEtherInWallet'),
|
||||
]),
|
||||
|
||||
h('div.page-container__header-close', {
|
||||
@ -128,29 +128,25 @@ DepositEtherModal.prototype.render = function () {
|
||||
}),
|
||||
|
||||
]),
|
||||
|
||||
|
||||
h('.page-container__content', {}, [
|
||||
|
||||
|
||||
h('div.deposit-ether-modal__buy-rows', [
|
||||
|
||||
this.renderRow({
|
||||
logo: h('div.deposit-ether-modal__logo', {
|
||||
style: {
|
||||
backgroundImage: 'url(\'../../../images/eth_logo.svg\')',
|
||||
},
|
||||
}),
|
||||
logo: h('img.deposit-ether-modal__buy-row__eth-logo', { src: '../../../images/eth_logo.svg' }),
|
||||
title: DIRECT_DEPOSIT_ROW_TITLE,
|
||||
text: DIRECT_DEPOSIT_ROW_TEXT,
|
||||
buttonLabel: 'View Account Details',
|
||||
buttonLabel: t('viewAccount'),
|
||||
onButtonClick: () => this.goToAccountDetailsModal(),
|
||||
hide: buyingWithShapeshift,
|
||||
}),
|
||||
|
||||
this.renderRow({
|
||||
logo: h('i.fa.fa-tint.fa-3x.deposit-ether-modal__logo'),
|
||||
logo: h('i.fa.fa-tint.fa-2x'),
|
||||
title: FAUCET_ROW_TITLE,
|
||||
text: faucetRowText(networkName),
|
||||
buttonLabel: 'Continue to Test Faucet',
|
||||
text: facuetRowText(networkName),
|
||||
buttonLabel: t('getEther'),
|
||||
onButtonClick: () => toFaucet(network),
|
||||
hide: !isTestNetwork || buyingWithShapeshift,
|
||||
}),
|
||||
@ -164,11 +160,11 @@ DepositEtherModal.prototype.render = function () {
|
||||
}),
|
||||
title: COINBASE_ROW_TITLE,
|
||||
text: COINBASE_ROW_TEXT,
|
||||
buttonLabel: 'Continue to Coinbase',
|
||||
buttonLabel: t('continueToCoinbase'),
|
||||
onButtonClick: () => toCoinbase(address),
|
||||
hide: isTestNetwork || buyingWithShapeshift,
|
||||
}),
|
||||
|
||||
|
||||
this.renderRow({
|
||||
logo: h('div.deposit-ether-modal__logo', {
|
||||
style: {
|
||||
@ -177,7 +173,7 @@ DepositEtherModal.prototype.render = function () {
|
||||
}),
|
||||
title: SHAPESHIFT_ROW_TITLE,
|
||||
text: SHAPESHIFT_ROW_TEXT,
|
||||
buttonLabel: 'Continue to Shapeshift',
|
||||
buttonLabel: t('shapeshiftBuy'),
|
||||
onButtonClick: () => this.setState({ buyingWithShapeshift: true }),
|
||||
hide: isTestNetwork,
|
||||
hideButton: buyingWithShapeshift,
|
||||
|
@ -4,6 +4,7 @@ const inherits = require('util').inherits
|
||||
const connect = require('react-redux').connect
|
||||
const actions = require('../../actions')
|
||||
const { getSelectedAccount } = require('../../selectors')
|
||||
const t = require('../../../i18n')
|
||||
|
||||
function mapStateToProps (state) {
|
||||
return {
|
||||
@ -50,7 +51,7 @@ EditAccountNameModal.prototype.render = function () {
|
||||
]),
|
||||
|
||||
h('div.edit-account-name-modal-title', {
|
||||
}, ['Edit Account Name']),
|
||||
}, [t('editAccountName')]),
|
||||
|
||||
h('input.edit-account-name-modal-input', {
|
||||
placeholder: identity.name,
|
||||
@ -60,7 +61,7 @@ EditAccountNameModal.prototype.render = function () {
|
||||
value: this.state.inputText,
|
||||
}, []),
|
||||
|
||||
h('button.btn-clear.edit-account-name-modal-save-button', {
|
||||
h('button.btn-clear.edit-account-name-modal-save-button.allcaps', {
|
||||
onClick: () => {
|
||||
if (this.state.inputText.length !== 0) {
|
||||
saveAccountLabel(identity.address, this.state.inputText)
|
||||
@ -69,7 +70,7 @@ EditAccountNameModal.prototype.render = function () {
|
||||
},
|
||||
disabled: this.state.inputText.length === 0,
|
||||
}, [
|
||||
'SAVE',
|
||||
t('save'),
|
||||
]),
|
||||
|
||||
]),
|
||||
|
@ -7,6 +7,7 @@ const actions = require('../../actions')
|
||||
const AccountModalContainer = require('./account-modal-container')
|
||||
const { getSelectedIdentity } = require('../../selectors')
|
||||
const ReadOnlyInput = require('../readonly-input')
|
||||
const t = require('../../../i18n')
|
||||
const copyToClipboard = require('copy-to-clipboard')
|
||||
|
||||
function mapStateToProps (state) {
|
||||
@ -48,8 +49,8 @@ ExportPrivateKeyModal.prototype.exportAccountAndGetPrivateKey = function (passwo
|
||||
|
||||
ExportPrivateKeyModal.prototype.renderPasswordLabel = function (privateKey) {
|
||||
return h('span.private-key-password-label', privateKey
|
||||
? 'This is your private key (click to copy)'
|
||||
: 'Type Your Password'
|
||||
? t('copyPrivateKey')
|
||||
: t('typePassword')
|
||||
)
|
||||
}
|
||||
|
||||
@ -86,8 +87,8 @@ ExportPrivateKeyModal.prototype.renderButtons = function (privateKey, password,
|
||||
),
|
||||
|
||||
(privateKey
|
||||
? this.renderButton('btn-clear export-private-key__button', () => hideModal(), 'Done')
|
||||
: this.renderButton('btn-clear export-private-key__button', () => this.exportAccountAndGetPrivateKey(this.state.password, address), 'Confirm')
|
||||
? this.renderButton('btn-clear export-private-key__button', () => hideModal(), t('done'))
|
||||
: this.renderButton('btn-clear export-private-key__button', () => this.exportAccountAndGetPrivateKey(this.state.password, address), t('confirm'))
|
||||
),
|
||||
|
||||
])
|
||||
@ -120,7 +121,7 @@ ExportPrivateKeyModal.prototype.render = function () {
|
||||
|
||||
h('div.account-modal-divider'),
|
||||
|
||||
h('span.modal-body-title', 'Show Private Keys'),
|
||||
h('span.modal-body-title', t('showPrivateKeys')),
|
||||
|
||||
h('div.private-key-password', {}, [
|
||||
this.renderPasswordLabel(privateKey),
|
||||
@ -130,10 +131,7 @@ ExportPrivateKeyModal.prototype.render = function () {
|
||||
!warning ? null : h('span.private-key-password-error', warning),
|
||||
]),
|
||||
|
||||
h('div.private-key-password-warning', `Warning: Never disclose this key.
|
||||
Anyone with your private keys can take steal any assets held in your
|
||||
account.`
|
||||
),
|
||||
h('div.private-key-password-warning', t('privateKeyWarning')),
|
||||
|
||||
this.renderButtons(privateKey, this.state.password, address, hideModal),
|
||||
|
||||
|
@ -4,6 +4,7 @@ const inherits = require('util').inherits
|
||||
const connect = require('react-redux').connect
|
||||
const actions = require('../../actions')
|
||||
const Identicon = require('../identicon')
|
||||
const t = require('../../../i18n')
|
||||
|
||||
function mapStateToProps (state) {
|
||||
return {
|
||||
@ -41,7 +42,7 @@ HideTokenConfirmationModal.prototype.render = function () {
|
||||
h('div.hide-token-confirmation__container', {
|
||||
}, [
|
||||
h('div.hide-token-confirmation__title', {}, [
|
||||
'Hide Token?',
|
||||
t('hideTokenPrompt'),
|
||||
]),
|
||||
|
||||
h(Identicon, {
|
||||
@ -54,19 +55,19 @@ HideTokenConfirmationModal.prototype.render = function () {
|
||||
h('div.hide-token-confirmation__symbol', {}, symbol),
|
||||
|
||||
h('div.hide-token-confirmation__copy', {}, [
|
||||
'You can add this token back in the future by going go to “Add token” in your accounts options menu.',
|
||||
t('readdToken'),
|
||||
]),
|
||||
|
||||
h('div.hide-token-confirmation__buttons', {}, [
|
||||
h('button.btn-cancel.hide-token-confirmation__button', {
|
||||
h('button.btn-cancel.hide-token-confirmation__button.allcaps', {
|
||||
onClick: () => hideModal(),
|
||||
}, [
|
||||
'CANCEL',
|
||||
t('cancel'),
|
||||
]),
|
||||
h('button.btn-clear.hide-token-confirmation__button', {
|
||||
h('button.btn-clear.hide-token-confirmation__button.allcaps', {
|
||||
onClick: () => hideToken(address),
|
||||
}, [
|
||||
'HIDE',
|
||||
t('hide'),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
|
@ -6,6 +6,7 @@ const FadeModal = require('boron').FadeModal
|
||||
const actions = require('../../actions')
|
||||
const isMobileView = require('../../../lib/is-mobile-view')
|
||||
const isPopupOrNotification = require('../../../../app/scripts/lib/is-popup-or-notification')
|
||||
const t = require('../../../i18n')
|
||||
|
||||
// Modal Components
|
||||
const BuyOptions = require('./buy-options-modal')
|
||||
@ -173,9 +174,8 @@ const MODALS = {
|
||||
BETA_UI_NOTIFICATION_MODAL: {
|
||||
contents: [
|
||||
h(NotifcationModal, {
|
||||
header: 'Welcome to the New UI (Beta)',
|
||||
message: `You are now using the new Metamask UI. Take a look around, try out new features like sending tokens,
|
||||
and let us know if you have any issues.`,
|
||||
header: t('uiWelcome'),
|
||||
message: t('uiWelcomeMessage'),
|
||||
}),
|
||||
],
|
||||
mobileModalStyle: {
|
||||
@ -191,9 +191,8 @@ const MODALS = {
|
||||
OLD_UI_NOTIFICATION_MODAL: {
|
||||
contents: [
|
||||
h(NotifcationModal, {
|
||||
header: 'Old UI',
|
||||
message: `You have returned to the old UI. You can switch back to the New UI through the option in the top
|
||||
right dropdown menu.`,
|
||||
header: t('oldUI'),
|
||||
message: t('oldUIMessage'),
|
||||
}),
|
||||
],
|
||||
mobileModalStyle: {
|
||||
|
@ -3,6 +3,7 @@ const PropTypes = require('prop-types')
|
||||
const h = require('react-hyperscript')
|
||||
const { connect } = require('react-redux')
|
||||
const actions = require('../../actions')
|
||||
const t = require('../../../i18n')
|
||||
|
||||
class NewAccountModal extends Component {
|
||||
constructor (props) {
|
||||
@ -11,7 +12,7 @@ class NewAccountModal extends Component {
|
||||
const newAccountNumber = numberOfExistingAccounts + 1
|
||||
|
||||
this.state = {
|
||||
newAccountName: `Account ${newAccountNumber}`,
|
||||
newAccountName: `${t('account')} ${newAccountNumber}`,
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,7 +23,7 @@ class NewAccountModal extends Component {
|
||||
h('div.new-account-modal-wrapper', {
|
||||
}, [
|
||||
h('div.new-account-modal-header', {}, [
|
||||
'New Account',
|
||||
t('newAccount'),
|
||||
]),
|
||||
|
||||
h('div.modal-close-x', {
|
||||
@ -30,19 +31,19 @@ class NewAccountModal extends Component {
|
||||
}),
|
||||
|
||||
h('div.new-account-modal-content', {}, [
|
||||
'Account Name',
|
||||
t('accountName'),
|
||||
]),
|
||||
|
||||
h('div.new-account-input-wrapper', {}, [
|
||||
h('input.new-account-input', {
|
||||
value: this.state.newAccountName,
|
||||
placeholder: 'E.g. My new account',
|
||||
placeholder: t('sampleAccountName'),
|
||||
onChange: event => this.setState({ newAccountName: event.target.value }),
|
||||
}, []),
|
||||
]),
|
||||
|
||||
h('div.new-account-modal-content.after-input', {}, [
|
||||
'or',
|
||||
t('or'),
|
||||
]),
|
||||
|
||||
h('div.new-account-modal-content.after-input.pointer', {
|
||||
@ -50,13 +51,13 @@ class NewAccountModal extends Component {
|
||||
this.props.hideModal()
|
||||
this.props.showImportPage()
|
||||
},
|
||||
}, 'Import an account'),
|
||||
}, t('importAnAccount')),
|
||||
|
||||
h('div.new-account-modal-content.button', {}, [
|
||||
h('div.new-account-modal-content.button.allcaps', {}, [
|
||||
h('button.btn-clear', {
|
||||
onClick: () => this.props.createAccount(newAccountName),
|
||||
}, [
|
||||
'SAVE',
|
||||
t('save'),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
|
@ -3,6 +3,7 @@ const h = require('react-hyperscript')
|
||||
const classnames = require('classnames')
|
||||
const inherits = require('util').inherits
|
||||
const NetworkDropdownIcon = require('./dropdowns/components/network-dropdown-icon')
|
||||
const t = require('../../i18n')
|
||||
|
||||
module.exports = Network
|
||||
|
||||
@ -33,7 +34,7 @@ Network.prototype.render = function () {
|
||||
onClick: (event) => this.props.onClick(event),
|
||||
}, [
|
||||
h('img', {
|
||||
title: 'Attempting to connect to blockchain.',
|
||||
title: t('attemptingConnect'),
|
||||
style: {
|
||||
width: '27px',
|
||||
},
|
||||
@ -41,22 +42,22 @@ Network.prototype.render = function () {
|
||||
}),
|
||||
])
|
||||
} else if (providerName === 'mainnet') {
|
||||
hoverText = 'Main Ethereum Network'
|
||||
hoverText = t('mainnet')
|
||||
iconName = 'ethereum-network'
|
||||
} else if (providerName === 'ropsten') {
|
||||
hoverText = 'Ropsten Test Network'
|
||||
hoverText = t('ropsten')
|
||||
iconName = 'ropsten-test-network'
|
||||
} else if (parseInt(networkNumber) === 3) {
|
||||
hoverText = 'Ropsten Test Network'
|
||||
hoverText = t('ropsten')
|
||||
iconName = 'ropsten-test-network'
|
||||
} else if (providerName === 'kovan') {
|
||||
hoverText = 'Kovan Test Network'
|
||||
hoverText = t('kovan')
|
||||
iconName = 'kovan-test-network'
|
||||
} else if (providerName === 'rinkeby') {
|
||||
hoverText = 'Rinkeby Test Network'
|
||||
hoverText = t('rinkeby')
|
||||
iconName = 'rinkeby-test-network'
|
||||
} else {
|
||||
hoverText = 'Unknown Private Network'
|
||||
hoverText = t('unknownNetwork')
|
||||
iconName = 'unknown-private-network'
|
||||
}
|
||||
|
||||
@ -84,7 +85,7 @@ Network.prototype.render = function () {
|
||||
backgroundColor: '#038789', // $blue-lagoon
|
||||
nonSelectBackgroundColor: '#15afb2',
|
||||
}),
|
||||
h('.network-name', 'Main Network'),
|
||||
h('.network-name', t('mainnet')),
|
||||
h('i.fa.fa-chevron-down.fa-lg.network-caret'),
|
||||
])
|
||||
case 'ropsten-test-network':
|
||||
@ -93,7 +94,7 @@ Network.prototype.render = function () {
|
||||
backgroundColor: '#e91550', // $crimson
|
||||
nonSelectBackgroundColor: '#ec2c50',
|
||||
}),
|
||||
h('.network-name', 'Ropsten Test Net'),
|
||||
h('.network-name', t('ropsten')),
|
||||
h('i.fa.fa-chevron-down.fa-lg.network-caret'),
|
||||
])
|
||||
case 'kovan-test-network':
|
||||
@ -102,7 +103,7 @@ Network.prototype.render = function () {
|
||||
backgroundColor: '#690496', // $purple
|
||||
nonSelectBackgroundColor: '#b039f3',
|
||||
}),
|
||||
h('.network-name', 'Kovan Test Net'),
|
||||
h('.network-name', t('kovan')),
|
||||
h('i.fa.fa-chevron-down.fa-lg.network-caret'),
|
||||
])
|
||||
case 'rinkeby-test-network':
|
||||
@ -111,7 +112,7 @@ Network.prototype.render = function () {
|
||||
backgroundColor: '#ebb33f', // $tulip-tree
|
||||
nonSelectBackgroundColor: '#ecb23e',
|
||||
}),
|
||||
h('.network-name', 'Rinkeby Test Net'),
|
||||
h('.network-name', t('rinkeby')),
|
||||
h('i.fa.fa-chevron-down.fa-lg.network-caret'),
|
||||
])
|
||||
default:
|
||||
@ -123,7 +124,7 @@ Network.prototype.render = function () {
|
||||
},
|
||||
}),
|
||||
|
||||
h('.network-name', 'Private Network'),
|
||||
h('.network-name', t('privateNetwork')),
|
||||
h('i.fa.fa-chevron-down.fa-lg.network-caret'),
|
||||
])
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ const h = require('react-hyperscript')
|
||||
const ReactMarkdown = require('react-markdown')
|
||||
const linker = require('extension-link-enabler')
|
||||
const findDOMNode = require('react-dom').findDOMNode
|
||||
const t = require('../../i18n')
|
||||
|
||||
module.exports = Notice
|
||||
|
||||
@ -110,7 +111,7 @@ Notice.prototype.render = function () {
|
||||
style: {
|
||||
marginTop: '18px',
|
||||
},
|
||||
}, 'Accept'),
|
||||
}, t('accept')),
|
||||
])
|
||||
)
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
const Component = require('react').Component
|
||||
const h = require('react-hyperscript')
|
||||
const inherits = require('util').inherits
|
||||
const t = require('../../i18n')
|
||||
|
||||
const AccountPanel = require('./account-panel')
|
||||
|
||||
@ -39,7 +40,7 @@ PendingMsgDetails.prototype.render = function () {
|
||||
// message data
|
||||
h('.tx-data.flex-column.flex-justify-center.flex-grow.select-none', [
|
||||
h('.flex-column.flex-space-between', [
|
||||
h('label.font-small', 'MESSAGE'),
|
||||
h('label.font-small.allcaps', t('message')),
|
||||
h('span.font-small', msgParams.data),
|
||||
]),
|
||||
]),
|
||||
@ -47,4 +48,3 @@ PendingMsgDetails.prototype.render = function () {
|
||||
])
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@ const Component = require('react').Component
|
||||
const h = require('react-hyperscript')
|
||||
const inherits = require('util').inherits
|
||||
const PendingTxDetails = require('./pending-msg-details')
|
||||
const t = require('../../i18n')
|
||||
|
||||
module.exports = PendingMsg
|
||||
|
||||
@ -29,17 +30,14 @@ PendingMsg.prototype.render = function () {
|
||||
fontWeight: 'bold',
|
||||
textAlign: 'center',
|
||||
},
|
||||
}, 'Sign Message'),
|
||||
}, t('signMessage')),
|
||||
|
||||
h('.error', {
|
||||
style: {
|
||||
margin: '10px',
|
||||
},
|
||||
}, [
|
||||
`Signing this message can have
|
||||
dangerous side effects. Only sign messages from
|
||||
sites you fully trust with your entire account.
|
||||
This dangerous method will be removed in a future version. `,
|
||||
t('signNotice'),
|
||||
h('a', {
|
||||
href: 'https://medium.com/metamask/the-new-secure-way-to-sign-data-in-your-browser-6af9dd2a1527',
|
||||
style: { color: 'rgb(247, 134, 28)' },
|
||||
@ -48,7 +46,7 @@ PendingMsg.prototype.render = function () {
|
||||
const url = 'https://medium.com/metamask/the-new-secure-way-to-sign-data-in-your-browser-6af9dd2a1527'
|
||||
global.platform.openWindow({ url })
|
||||
},
|
||||
}, 'Read more here.'),
|
||||
}, t('readMore')),
|
||||
]),
|
||||
|
||||
// message details
|
||||
@ -58,13 +56,12 @@ PendingMsg.prototype.render = function () {
|
||||
h('.flex-row.flex-space-around', [
|
||||
h('button', {
|
||||
onClick: state.cancelMessage,
|
||||
}, 'Cancel'),
|
||||
}, t('cancel')),
|
||||
h('button', {
|
||||
onClick: state.signMessage,
|
||||
}, 'Sign'),
|
||||
}, t('sign')),
|
||||
]),
|
||||
])
|
||||
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
const Component = require('react').Component
|
||||
const h = require('react-hyperscript')
|
||||
const inherits = require('util').inherits
|
||||
const t = require('../../i18n')
|
||||
|
||||
const AccountPanel = require('./account-panel')
|
||||
const BinaryRenderer = require('./binary-renderer')
|
||||
@ -45,7 +46,7 @@ PendingMsgDetails.prototype.render = function () {
|
||||
height: '260px',
|
||||
},
|
||||
}, [
|
||||
h('label.font-small', { style: { display: 'block' } }, 'MESSAGE'),
|
||||
h('label.font-small.allcaps', { style: { display: 'block' } }, t('message')),
|
||||
h(BinaryRenderer, {
|
||||
value: data,
|
||||
style: {
|
||||
@ -57,4 +58,3 @@ PendingMsgDetails.prototype.render = function () {
|
||||
])
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@ const ethUtil = require('ethereumjs-util')
|
||||
const BN = ethUtil.BN
|
||||
const hexToBn = require('../../../../app/scripts/lib/hex-to-bn')
|
||||
const { conversionUtil } = require('../../conversion-util')
|
||||
const t = require('../../../i18n')
|
||||
|
||||
const { MIN_GAS_PRICE_HEX } = require('../send/send-constants')
|
||||
|
||||
@ -55,7 +56,7 @@ ConfirmDeployContract.prototype.onSubmit = function (event) {
|
||||
if (valid && this.verifyGasParams()) {
|
||||
this.props.sendTransaction(txMeta, event)
|
||||
} else {
|
||||
this.props.dispatch(actions.displayWarning('Invalid Gas Parameters'))
|
||||
this.props.dispatch(actions.displayWarning(t('invalidGasParams')))
|
||||
this.setState({ submitting: false })
|
||||
}
|
||||
}
|
||||
@ -200,7 +201,7 @@ ConfirmDeployContract.prototype.renderGasFee = function () {
|
||||
|
||||
return (
|
||||
h('section.flex-row.flex-center.confirm-screen-row', [
|
||||
h('span.confirm-screen-label.confirm-screen-section-column', [ 'Gas Fee' ]),
|
||||
h('span.confirm-screen-label.confirm-screen-section-column', [ t('gasFee') ]),
|
||||
h('div.confirm-screen-section-column', [
|
||||
h('div.confirm-screen-row-info', `${fiatGas} ${currentCurrency.toUpperCase()}`),
|
||||
|
||||
@ -239,8 +240,8 @@ ConfirmDeployContract.prototype.renderTotalPlusGas = function () {
|
||||
return (
|
||||
h('section.flex-row.flex-center.confirm-screen-total-box ', [
|
||||
h('div.confirm-screen-section-column', [
|
||||
h('span.confirm-screen-label', [ 'Total ' ]),
|
||||
h('div.confirm-screen-total-box__subtitle', [ 'Amount + Gas' ]),
|
||||
h('span.confirm-screen-label', [ t('total') + ' ' ]),
|
||||
h('div.confirm-screen-total-box__subtitle', [ t('amountPlusGas') ]),
|
||||
]),
|
||||
|
||||
h('div.confirm-screen-section-column', [
|
||||
@ -271,10 +272,10 @@ ConfirmDeployContract.prototype.render = function () {
|
||||
// Main Send token Card
|
||||
h('div.confirm-screen-wrapper.flex-column.flex-grow', [
|
||||
h('h3.flex-center.confirm-screen-header', [
|
||||
h('button.confirm-screen-back-button', {
|
||||
h('button.confirm-screen-back-button.allcaps', {
|
||||
onClick: () => backToAccountDetail(selectedAddress),
|
||||
}, 'BACK'),
|
||||
h('div.confirm-screen-title', 'Confirm Contract'),
|
||||
}, t('back')),
|
||||
h('div.confirm-screen-title', t('confirmContract')),
|
||||
h('div.confirm-screen-header-tip'),
|
||||
]),
|
||||
h('div.flex-row.flex-center.confirm-screen-identicons', [
|
||||
@ -292,7 +293,7 @@ ConfirmDeployContract.prototype.render = function () {
|
||||
h('i.fa.fa-arrow-right.fa-lg'),
|
||||
h('div.confirm-screen-account-wrapper', [
|
||||
h('i.fa.fa-file-text-o'),
|
||||
h('span.confirm-screen-account-name', 'New Contract'),
|
||||
h('span.confirm-screen-account-name', t('newContract')),
|
||||
h('span.confirm-screen-account-number', ' '),
|
||||
]),
|
||||
]),
|
||||
@ -310,7 +311,7 @@ ConfirmDeployContract.prototype.render = function () {
|
||||
|
||||
h('div.confirm-screen-rows', [
|
||||
h('section.flex-row.flex-center.confirm-screen-row', [
|
||||
h('span.confirm-screen-label.confirm-screen-section-column', [ 'From' ]),
|
||||
h('span.confirm-screen-label.confirm-screen-section-column', [ t('from') ]),
|
||||
h('div.confirm-screen-section-column', [
|
||||
h('div.confirm-screen-row-info', fromName),
|
||||
h('div.confirm-screen-row-detail', `...${fromAddress.slice(fromAddress.length - 4)}`),
|
||||
@ -318,9 +319,9 @@ ConfirmDeployContract.prototype.render = function () {
|
||||
]),
|
||||
|
||||
h('section.flex-row.flex-center.confirm-screen-row', [
|
||||
h('span.confirm-screen-label.confirm-screen-section-column', [ 'To' ]),
|
||||
h('span.confirm-screen-label.confirm-screen-section-column', [ t('to') ]),
|
||||
h('div.confirm-screen-section-column', [
|
||||
h('div.confirm-screen-row-info', 'New Contract'),
|
||||
h('div.confirm-screen-row-info', t('newContract')),
|
||||
]),
|
||||
]),
|
||||
|
||||
@ -335,12 +336,12 @@ ConfirmDeployContract.prototype.render = function () {
|
||||
onSubmit: this.onSubmit,
|
||||
}, [
|
||||
// Cancel Button
|
||||
h('div.cancel.btn-light.confirm-screen-cancel-button', {
|
||||
h('div.cancel.btn-light.confirm-screen-cancel-button.allcaps', {
|
||||
onClick: (event) => this.cancel(event, txMeta),
|
||||
}, 'CANCEL'),
|
||||
}, t('cancel')),
|
||||
|
||||
// Accept Button
|
||||
h('button.confirm-screen-confirm-button', ['CONFIRM']),
|
||||
h('button.confirm-screen-confirm-button.allcaps', [t('confirm')]),
|
||||
|
||||
]),
|
||||
])
|
||||
|
@ -9,6 +9,7 @@ const ethUtil = require('ethereumjs-util')
|
||||
const BN = ethUtil.BN
|
||||
const hexToBn = require('../../../../app/scripts/lib/hex-to-bn')
|
||||
const { conversionUtil, addCurrencies } = require('../../conversion-util')
|
||||
const t = require('../../../i18n')
|
||||
|
||||
const { MIN_GAS_PRICE_HEX } = require('../send/send-constants')
|
||||
|
||||
@ -165,7 +166,7 @@ ConfirmSendEther.prototype.getData = function () {
|
||||
},
|
||||
to: {
|
||||
address: txParams.to,
|
||||
name: identities[txParams.to] ? identities[txParams.to].name : 'New Recipient',
|
||||
name: identities[txParams.to] ? identities[txParams.to].name : t('newRecipient'),
|
||||
},
|
||||
memo: txParams.memo || '',
|
||||
gasFeeInFIAT,
|
||||
@ -266,7 +267,7 @@ ConfirmSendEther.prototype.render = function () {
|
||||
|
||||
h('div.confirm-screen-rows', [
|
||||
h('section.flex-row.flex-center.confirm-screen-row', [
|
||||
h('span.confirm-screen-label.confirm-screen-section-column', [ 'From' ]),
|
||||
h('span.confirm-screen-label.confirm-screen-section-column', [ t('from') ]),
|
||||
h('div.confirm-screen-section-column', [
|
||||
h('div.confirm-screen-row-info', fromName),
|
||||
h('div.confirm-screen-row-detail', `...${fromAddress.slice(fromAddress.length - 4)}`),
|
||||
@ -274,7 +275,7 @@ ConfirmSendEther.prototype.render = function () {
|
||||
]),
|
||||
|
||||
h('section.flex-row.flex-center.confirm-screen-row', [
|
||||
h('span.confirm-screen-label.confirm-screen-section-column', [ 'To' ]),
|
||||
h('span.confirm-screen-label.confirm-screen-section-column', [ t('to') ]),
|
||||
h('div.confirm-screen-section-column', [
|
||||
h('div.confirm-screen-row-info', toName),
|
||||
h('div.confirm-screen-row-detail', `...${toAddress.slice(toAddress.length - 4)}`),
|
||||
@ -282,7 +283,7 @@ ConfirmSendEther.prototype.render = function () {
|
||||
]),
|
||||
|
||||
h('section.flex-row.flex-center.confirm-screen-row', [
|
||||
h('span.confirm-screen-label.confirm-screen-section-column', [ 'Gas Fee' ]),
|
||||
h('span.confirm-screen-label.confirm-screen-section-column', [ t('gasFee') ]),
|
||||
h('div.confirm-screen-section-column', [
|
||||
h('div.confirm-screen-row-info', `${gasFeeInFIAT} ${currentCurrency.toUpperCase()}`),
|
||||
|
||||
@ -293,8 +294,8 @@ ConfirmSendEther.prototype.render = function () {
|
||||
|
||||
h('section.flex-row.flex-center.confirm-screen-total-box ', [
|
||||
h('div.confirm-screen-section-column', [
|
||||
h('span.confirm-screen-label', [ 'Total ' ]),
|
||||
h('div.confirm-screen-total-box__subtitle', [ 'Amount + Gas' ]),
|
||||
h('span.confirm-screen-label', [ t('total') + ' ' ]),
|
||||
h('div.confirm-screen-total-box__subtitle', [ t('amountPlusGas') ]),
|
||||
]),
|
||||
|
||||
h('div.confirm-screen-section-column', [
|
||||
@ -389,15 +390,15 @@ ConfirmSendEther.prototype.render = function () {
|
||||
onSubmit: this.onSubmit,
|
||||
}, [
|
||||
// Cancel Button
|
||||
h('div.cancel.btn-light.confirm-screen-cancel-button', {
|
||||
h('div.cancel.btn-light.confirm-screen-cancel-button.allcaps', {
|
||||
onClick: (event) => {
|
||||
clearSend()
|
||||
this.cancel(event, txMeta)
|
||||
},
|
||||
}, 'CANCEL'),
|
||||
}, t('cancel')),
|
||||
|
||||
// Accept Button
|
||||
h('button.confirm-screen-confirm-button', ['CONFIRM']),
|
||||
h('button.confirm-screen-confirm-button.allcaps', [t('confirm')]),
|
||||
]),
|
||||
])
|
||||
)
|
||||
@ -412,7 +413,7 @@ ConfirmSendEther.prototype.onSubmit = function (event) {
|
||||
if (valid && this.verifyGasParams()) {
|
||||
this.props.sendTransaction(txMeta, event)
|
||||
} else {
|
||||
this.props.dispatch(actions.displayWarning('Invalid Gas Parameters'))
|
||||
this.props.dispatch(actions.displayWarning(t('invalidGasParams')))
|
||||
this.setState({ submitting: false })
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ const tokenAbi = require('human-standard-token-abi')
|
||||
const abiDecoder = require('abi-decoder')
|
||||
abiDecoder.addABI(tokenAbi)
|
||||
const actions = require('../../actions')
|
||||
const t = require('../../../i18n')
|
||||
const clone = require('clone')
|
||||
const Identicon = require('../identicon')
|
||||
const ethUtil = require('ethereumjs-util')
|
||||
@ -133,7 +134,7 @@ ConfirmSendToken.prototype.getAmount = function () {
|
||||
? +(sendTokenAmount * tokenExchangeRate * conversionRate).toFixed(2)
|
||||
: null,
|
||||
token: typeof value === 'undefined'
|
||||
? 'Unknown'
|
||||
? t('unknown')
|
||||
: +sendTokenAmount.toFixed(decimals),
|
||||
}
|
||||
|
||||
@ -204,7 +205,7 @@ ConfirmSendToken.prototype.getData = function () {
|
||||
},
|
||||
to: {
|
||||
address: value,
|
||||
name: identities[value] ? identities[value].name : 'New Recipient',
|
||||
name: identities[value] ? identities[value].name : t('newRecipient'),
|
||||
},
|
||||
memo: txParams.memo || '',
|
||||
}
|
||||
@ -244,7 +245,7 @@ ConfirmSendToken.prototype.renderGasFee = function () {
|
||||
|
||||
return (
|
||||
h('section.flex-row.flex-center.confirm-screen-row', [
|
||||
h('span.confirm-screen-label.confirm-screen-section-column', [ 'Gas Fee' ]),
|
||||
h('span.confirm-screen-label.confirm-screen-section-column', [ t('gasFee') ]),
|
||||
h('div.confirm-screen-section-column', [
|
||||
h('div.confirm-screen-row-info', `${fiatGas} ${currentCurrency}`),
|
||||
|
||||
@ -266,8 +267,8 @@ ConfirmSendToken.prototype.renderTotalPlusGas = function () {
|
||||
? (
|
||||
h('section.flex-row.flex-center.confirm-screen-total-box ', [
|
||||
h('div.confirm-screen-section-column', [
|
||||
h('span.confirm-screen-label', [ 'Total ' ]),
|
||||
h('div.confirm-screen-total-box__subtitle', [ 'Amount + Gas' ]),
|
||||
h('span.confirm-screen-label', [ t('total') + ' ' ]),
|
||||
h('div.confirm-screen-total-box__subtitle', [ t('amountPlusGas') ]),
|
||||
]),
|
||||
|
||||
h('div.confirm-screen-section-column', [
|
||||
@ -279,13 +280,13 @@ ConfirmSendToken.prototype.renderTotalPlusGas = function () {
|
||||
: (
|
||||
h('section.flex-row.flex-center.confirm-screen-total-box ', [
|
||||
h('div.confirm-screen-section-column', [
|
||||
h('span.confirm-screen-label', [ 'Total ' ]),
|
||||
h('div.confirm-screen-total-box__subtitle', [ 'Amount + Gas' ]),
|
||||
h('span.confirm-screen-label', [ t('total') + ' ' ]),
|
||||
h('div.confirm-screen-total-box__subtitle', [ t('amountPlusGas') ]),
|
||||
]),
|
||||
|
||||
h('div.confirm-screen-section-column', [
|
||||
h('div.confirm-screen-row-info', `${tokenAmount} ${symbol}`),
|
||||
h('div.confirm-screen-row-detail', `+ ${fiatGas} ${currentCurrency} Gas`),
|
||||
h('div.confirm-screen-row-detail', `+ ${fiatGas} ${currentCurrency} ${t('gas')}`),
|
||||
]),
|
||||
])
|
||||
)
|
||||
@ -314,9 +315,9 @@ ConfirmSendToken.prototype.render = function () {
|
||||
h('div.page-container__header', [
|
||||
h('button.confirm-screen-back-button', {
|
||||
onClick: () => editTransaction(txMeta),
|
||||
}, 'Edit'),
|
||||
h('div.page-container__title', 'Confirm'),
|
||||
h('div.page-container__subtitle', `Please review your transaction.`),
|
||||
}, t('edit')),
|
||||
h('div.page-container__title', t('confirm')),
|
||||
h('div.page-container__subtitle', t('pleaseReviewTransaction')),
|
||||
]),
|
||||
h('div.flex-row.flex-center.confirm-screen-identicons', [
|
||||
h('div.confirm-screen-account-wrapper', [
|
||||
@ -357,7 +358,7 @@ ConfirmSendToken.prototype.render = function () {
|
||||
|
||||
h('div.confirm-screen-rows', [
|
||||
h('section.flex-row.flex-center.confirm-screen-row', [
|
||||
h('span.confirm-screen-label.confirm-screen-section-column', [ 'From' ]),
|
||||
h('span.confirm-screen-label.confirm-screen-section-column', [ t('from') ]),
|
||||
h('div.confirm-screen-section-column', [
|
||||
h('div.confirm-screen-row-info', fromName),
|
||||
h('div.confirm-screen-row-detail', `...${fromAddress.slice(fromAddress.length - 4)}`),
|
||||
@ -365,7 +366,7 @@ ConfirmSendToken.prototype.render = function () {
|
||||
]),
|
||||
|
||||
toAddress && h('section.flex-row.flex-center.confirm-screen-row', [
|
||||
h('span.confirm-screen-label.confirm-screen-section-column', [ 'To' ]),
|
||||
h('span.confirm-screen-label.confirm-screen-section-column', [ t('to') ]),
|
||||
h('div.confirm-screen-section-column', [
|
||||
h('div.confirm-screen-row-info', toName),
|
||||
h('div.confirm-screen-row-detail', `...${toAddress.slice(toAddress.length - 4)}`),
|
||||
@ -383,12 +384,12 @@ ConfirmSendToken.prototype.render = function () {
|
||||
onSubmit: this.onSubmit,
|
||||
}, [
|
||||
// Cancel Button
|
||||
h('div.cancel.btn-light.confirm-screen-cancel-button', {
|
||||
h('div.cancel.btn-light.confirm-screen-cancel-button.allcaps', {
|
||||
onClick: (event) => this.cancel(event, txMeta),
|
||||
}, 'CANCEL'),
|
||||
}, t('cancel')),
|
||||
|
||||
// Accept Button
|
||||
h('button.confirm-screen-confirm-button', ['CONFIRM']),
|
||||
h('button.confirm-screen-confirm-button.allcaps', [t('confirm')]),
|
||||
]),
|
||||
|
||||
|
||||
@ -405,7 +406,7 @@ ConfirmSendToken.prototype.onSubmit = function (event) {
|
||||
if (valid && this.verifyGasParams()) {
|
||||
this.props.sendTransaction(txMeta, event)
|
||||
} else {
|
||||
this.props.dispatch(actions.displayWarning('Invalid Gas Parameters'))
|
||||
this.props.dispatch(actions.displayWarning(t('invalidGasParams')))
|
||||
this.setState({ submitting: false })
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ const inherits = require('util').inherits
|
||||
|
||||
const AccountPanel = require('./account-panel')
|
||||
const TypedMessageRenderer = require('./typed-message-renderer')
|
||||
const t = require('../../i18n')
|
||||
|
||||
module.exports = PendingMsgDetails
|
||||
|
||||
@ -45,7 +46,7 @@ PendingMsgDetails.prototype.render = function () {
|
||||
height: '260px',
|
||||
},
|
||||
}, [
|
||||
h('label.font-small', { style: { display: 'block' } }, 'YOU ARE SIGNING'),
|
||||
h('label.font-small.allcaps', { style: { display: 'block' } }, t('youSign')),
|
||||
h(TypedMessageRenderer, {
|
||||
value: data,
|
||||
style: {
|
||||
|
@ -2,6 +2,7 @@ const Component = require('react').Component
|
||||
const h = require('react-hyperscript')
|
||||
const inherits = require('util').inherits
|
||||
const PendingTxDetails = require('./pending-typed-msg-details')
|
||||
const t = require('../../i18n')
|
||||
|
||||
module.exports = PendingMsg
|
||||
|
||||
@ -26,19 +27,19 @@ PendingMsg.prototype.render = function () {
|
||||
fontWeight: 'bold',
|
||||
textAlign: 'center',
|
||||
},
|
||||
}, 'Sign Message'),
|
||||
}, t('signMessage')),
|
||||
|
||||
// message details
|
||||
h(PendingTxDetails, state),
|
||||
|
||||
// sign + cancel
|
||||
h('.flex-row.flex-space-around', [
|
||||
h('button', {
|
||||
h('button.allcaps', {
|
||||
onClick: state.cancelTypedMessage,
|
||||
}, 'Cancel'),
|
||||
h('button', {
|
||||
}, t('cancel')),
|
||||
h('button.allcaps', {
|
||||
onClick: state.signTypedMessage,
|
||||
}, 'Sign'),
|
||||
}, t('sign')),
|
||||
]),
|
||||
])
|
||||
|
||||
|
@ -7,6 +7,7 @@ const inherits = require('util').inherits
|
||||
const actions = require('../../actions')
|
||||
const selectors = require('../../selectors')
|
||||
const { isValidAddress, allNull } = require('../../util')
|
||||
const t = require('../../../i18n')
|
||||
|
||||
// const BalanceComponent = require('./balance-component')
|
||||
const Identicon = require('../identicon')
|
||||
@ -126,14 +127,14 @@ SendTokenScreen.prototype.validate = function () {
|
||||
const amount = Number(stringAmount)
|
||||
|
||||
const errors = {
|
||||
to: !to ? 'Required' : null,
|
||||
amount: !amount ? 'Required' : null,
|
||||
gasPrice: !gasPrice ? 'Gas Price Required' : null,
|
||||
gasLimit: !gasLimit ? 'Gas Limit Required' : null,
|
||||
to: !to ? t('required') : null,
|
||||
amount: !amount ? t('required') : null,
|
||||
gasPrice: !gasPrice ? t('gasPriceRequired') : null,
|
||||
gasLimit: !gasLimit ? t('gasLimitRequired') : null,
|
||||
}
|
||||
|
||||
if (to && !isValidAddress(to)) {
|
||||
errors.to = 'Invalid address'
|
||||
errors.to = t('invalidAddress')
|
||||
}
|
||||
|
||||
const isValid = Object.entries(errors).every(([key, value]) => value === null)
|
||||
@ -233,11 +234,11 @@ SendTokenScreen.prototype.renderToAddressInput = function () {
|
||||
'send-screen-input-wrapper--error': errorMessage,
|
||||
}),
|
||||
}, [
|
||||
h('div', ['To:']),
|
||||
h('div', [t('to') + ':']),
|
||||
h('input.large-input.send-screen-input', {
|
||||
name: 'address',
|
||||
list: 'addresses',
|
||||
placeholder: 'Address',
|
||||
placeholder: t('address'),
|
||||
value: to,
|
||||
onChange: e => this.setState({
|
||||
to: e.target.value,
|
||||
@ -290,7 +291,7 @@ SendTokenScreen.prototype.renderAmountInput = function () {
|
||||
}),
|
||||
}, [
|
||||
h('div.send-screen-amount-labels', [
|
||||
h('span', ['Amount']),
|
||||
h('span', [t('amount')]),
|
||||
h(CurrencyToggle, {
|
||||
currentCurrency: tokenExchangeRate ? selectedCurrency : 'USD',
|
||||
currencies: tokenExchangeRate ? [ symbol, 'USD' ] : [],
|
||||
@ -355,8 +356,8 @@ SendTokenScreen.prototype.renderGasInput = function () {
|
||||
}),
|
||||
|
||||
h('div.send-screen-gas-labels', {}, [
|
||||
h('span', [ h('i.fa.fa-bolt'), 'Gas fee:']),
|
||||
h('span', ['What\'s this?']),
|
||||
h('span', [ h('i.fa.fa-bolt'), t('gasFee') + ':']),
|
||||
h('span', [t('whatsThis')]),
|
||||
]),
|
||||
h('div.large-input.send-screen-gas-input', [
|
||||
h(GasFeeDisplay, {
|
||||
@ -370,7 +371,7 @@ SendTokenScreen.prototype.renderGasInput = function () {
|
||||
h(
|
||||
'div.send-screen-gas-input-customize',
|
||||
{ onClick: () => this.setState({ isGasTooltipOpen: !isGasTooltipOpen }) },
|
||||
['Customize']
|
||||
[t('customize')]
|
||||
),
|
||||
]),
|
||||
h('div.send-screen-input-wrapper__error-message', [
|
||||
@ -381,7 +382,7 @@ SendTokenScreen.prototype.renderGasInput = function () {
|
||||
|
||||
SendTokenScreen.prototype.renderMemoInput = function () {
|
||||
return h('div.send-screen-input-wrapper', [
|
||||
h('div', {}, ['Transaction memo (optional)']),
|
||||
h('div', {}, [t('transactionMemo')]),
|
||||
h(
|
||||
'input.large-input.send-screen-input',
|
||||
{ onChange: e => this.setState({ memo: e.target.value }) }
|
||||
@ -397,10 +398,10 @@ SendTokenScreen.prototype.renderButtons = function () {
|
||||
h('button.send-token__button-next.btn-secondary', {
|
||||
className: !isValid && 'send-screen__send-button__disabled',
|
||||
onClick: () => isValid && this.submit(),
|
||||
}, ['Next']),
|
||||
}, [t('next')]),
|
||||
h('button.send-token__button-cancel.btn-tertiary', {
|
||||
onClick: () => backToAccountDetail(selectedAddress),
|
||||
}, ['Cancel']),
|
||||
}, [t('cancel')]),
|
||||
])
|
||||
}
|
||||
|
||||
@ -417,9 +418,9 @@ SendTokenScreen.prototype.render = function () {
|
||||
diameter: 75,
|
||||
address: selectedTokenAddress,
|
||||
}),
|
||||
h('div.send-token__title', ['Send Tokens']),
|
||||
h('div.send-token__description', ['Send Tokens to anyone with an Ethereum account']),
|
||||
h('div.send-token__balance-text', ['Your Token Balance is:']),
|
||||
h('div.send-token__title', [t('sendTokens')]),
|
||||
h('div.send-token__description', [t('sendTokensAnywhere')]),
|
||||
h('div.send-token__balance-text', [t('tokenBalance')]),
|
||||
h('div.send-token__token-balance', [
|
||||
h(TokenBalance, { token: selectedToken, balanceOnly: true }),
|
||||
]),
|
||||
|
@ -2,6 +2,7 @@ const Component = require('react').Component
|
||||
const h = require('react-hyperscript')
|
||||
const inherits = require('util').inherits
|
||||
const CurrencyDisplay = require('./currency-display')
|
||||
const t = require('../../../i18n')
|
||||
|
||||
module.exports = GasFeeDisplay
|
||||
|
||||
@ -30,7 +31,7 @@ GasFeeDisplay.prototype.render = function () {
|
||||
convertedPrefix: '$',
|
||||
readOnly: true,
|
||||
})
|
||||
: h('div.currency-display', 'Loading...'),
|
||||
: h('div.currency-display', t('loading')),
|
||||
|
||||
h('button.send-v2__sliders-icon-container', {
|
||||
onClick,
|
||||
@ -41,4 +42,3 @@ GasFeeDisplay.prototype.render = function () {
|
||||
|
||||
])
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@ const Component = require('react').Component
|
||||
const h = require('react-hyperscript')
|
||||
const inherits = require('util').inherits
|
||||
const InputNumber = require('../input-number.js')
|
||||
const t = require('../../../i18n')
|
||||
|
||||
module.exports = GasTooltip
|
||||
|
||||
@ -81,7 +82,7 @@ GasTooltip.prototype.render = function () {
|
||||
'marginTop': '81px',
|
||||
},
|
||||
}, [
|
||||
h('span.gas-tooltip-label', {}, ['Gas Limit']),
|
||||
h('span.gas-tooltip-label', {}, [t('gasLimit')]),
|
||||
h('i.fa.fa-info-circle'),
|
||||
]),
|
||||
h(InputNumber, {
|
||||
@ -97,4 +98,3 @@ GasTooltip.prototype.render = function () {
|
||||
]),
|
||||
])
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@ const Component = require('react').Component
|
||||
const h = require('react-hyperscript')
|
||||
const inherits = require('util').inherits
|
||||
const AccountListItem = require('./account-list-item')
|
||||
const t = require('../../../i18n')
|
||||
|
||||
module.exports = ToAutoComplete
|
||||
|
||||
@ -92,7 +93,7 @@ ToAutoComplete.prototype.render = function () {
|
||||
return h('div.send-v2__to-autocomplete', {}, [
|
||||
|
||||
h('input.send-v2__to-autocomplete__input', {
|
||||
placeholder: 'Recipient Address',
|
||||
placeholder: t('recipientAddress'),
|
||||
className: inError ? `send-v2__error-border` : '',
|
||||
value: to,
|
||||
onChange: event => onChange(event.target.value),
|
||||
@ -111,4 +112,3 @@ ToAutoComplete.prototype.render = function () {
|
||||
|
||||
])
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,7 @@ const { qrcode } = require('qrcode-npm')
|
||||
const { shapeShiftSubview, pairUpdate, buyWithShapeShift } = require('../actions')
|
||||
const { isValidAddress } = require('../util')
|
||||
const SimpleDropdown = require('./dropdowns/simple-dropdown')
|
||||
const t = require('../../i18n')
|
||||
|
||||
function mapStateToProps (state) {
|
||||
const {
|
||||
@ -15,7 +16,7 @@ function mapStateToProps (state) {
|
||||
selectedAddress,
|
||||
} = state.metamask
|
||||
const { warning } = state.appState
|
||||
|
||||
|
||||
return {
|
||||
coinOptions,
|
||||
tokenExchangeRates,
|
||||
@ -93,7 +94,7 @@ ShapeshiftForm.prototype.onBuyWithShapeShift = function () {
|
||||
}))
|
||||
.catch(() => this.setState({
|
||||
showQrCode: false,
|
||||
errorMessage: 'Invalid Request',
|
||||
errorMessage: t('invalidRequest'),
|
||||
isLoading: false,
|
||||
}))
|
||||
}
|
||||
@ -125,10 +126,10 @@ ShapeshiftForm.prototype.renderMarketInfo = function () {
|
||||
|
||||
return h('div.shapeshift-form__metadata', {}, [
|
||||
|
||||
this.renderMetadata('Status', limit ? 'Available' : 'Unavailable'),
|
||||
this.renderMetadata('Limit', limit),
|
||||
this.renderMetadata('Exchange Rate', rate),
|
||||
this.renderMetadata('Minimum', minimum),
|
||||
this.renderMetadata(t('status'), limit ? t('available') : t('unavailable')),
|
||||
this.renderMetadata(t('limit'), limit),
|
||||
this.renderMetadata(t('exchangeRate'), rate),
|
||||
this.renderMetadata(t('min'), minimum),
|
||||
|
||||
])
|
||||
}
|
||||
@ -142,7 +143,7 @@ ShapeshiftForm.prototype.renderQrCode = function () {
|
||||
return h('div.shapeshift-form', {}, [
|
||||
|
||||
h('div.shapeshift-form__deposit-instruction', [
|
||||
`Deposit your ${depositCoin.toUpperCase()} to the address below:`,
|
||||
t('depositCoin', depositCoin.toUpperCase()),
|
||||
]),
|
||||
|
||||
h('div', depositAddress),
|
||||
@ -179,7 +180,7 @@ ShapeshiftForm.prototype.render = function () {
|
||||
|
||||
h('div.shapeshift-form__selector', [
|
||||
|
||||
h('div.shapeshift-form__selector-label', 'Deposit'),
|
||||
h('div.shapeshift-form__selector-label', t('deposit')),
|
||||
|
||||
h(SimpleDropdown, {
|
||||
selectedOption: this.state.depositCoin,
|
||||
@ -199,7 +200,7 @@ ShapeshiftForm.prototype.render = function () {
|
||||
h('div.shapeshift-form__selector', [
|
||||
|
||||
h('div.shapeshift-form__selector-label', [
|
||||
'Receive',
|
||||
t('receive'),
|
||||
]),
|
||||
|
||||
h('div.shapeshift-form__selector-input', ['ETH']),
|
||||
@ -217,7 +218,7 @@ ShapeshiftForm.prototype.render = function () {
|
||||
}, [
|
||||
|
||||
h('div.shapeshift-form__address-input-label', [
|
||||
'Your Refund Address',
|
||||
t('refundAddress'),
|
||||
]),
|
||||
|
||||
h('input.shapeshift-form__address-input', {
|
||||
@ -239,7 +240,7 @@ ShapeshiftForm.prototype.render = function () {
|
||||
className: btnClass,
|
||||
disabled: !token,
|
||||
onClick: () => this.onBuyWithShapeShift(),
|
||||
}, ['Buy']),
|
||||
}, [t('buy')]),
|
||||
|
||||
])
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ const vreme = new (require('vreme'))()
|
||||
const explorerLink = require('etherscan-link').createExplorerLink
|
||||
const actions = require('../actions')
|
||||
const addressSummary = require('../util').addressSummary
|
||||
const t = require('../../i18n')
|
||||
|
||||
const CopyButton = require('./copyButton')
|
||||
const EthBalance = require('./eth-balance')
|
||||
@ -75,7 +76,7 @@ ShiftListItem.prototype.renderUtilComponents = function () {
|
||||
value: this.props.depositAddress,
|
||||
}),
|
||||
h(Tooltip, {
|
||||
title: 'QR Code',
|
||||
title: t('qrCode'),
|
||||
}, [
|
||||
h('i.fa.fa-qrcode.pointer.pop-hover', {
|
||||
onClick: () => props.dispatch(actions.reshowQrCode(props.depositAddress, props.depositType)),
|
||||
@ -135,8 +136,8 @@ ShiftListItem.prototype.renderInfo = function () {
|
||||
color: '#ABA9AA',
|
||||
width: '100%',
|
||||
},
|
||||
}, `${props.depositType} to ETH via ShapeShift`),
|
||||
h('div', 'No deposits received'),
|
||||
}, t('toETHviaShapeShift', [props.depositType])),
|
||||
h('div', t('noDeposits')),
|
||||
h('div', {
|
||||
style: {
|
||||
fontSize: 'x-small',
|
||||
@ -158,8 +159,8 @@ ShiftListItem.prototype.renderInfo = function () {
|
||||
color: '#ABA9AA',
|
||||
width: '100%',
|
||||
},
|
||||
}, `${props.depositType} to ETH via ShapeShift`),
|
||||
h('div', 'Conversion in progress'),
|
||||
}, t('toETHviaShapeShift', [props.depositType])),
|
||||
h('div', t('conversionProgress')),
|
||||
h('div', {
|
||||
style: {
|
||||
fontSize: 'x-small',
|
||||
@ -184,7 +185,7 @@ ShiftListItem.prototype.renderInfo = function () {
|
||||
color: '#ABA9AA',
|
||||
width: '100%',
|
||||
},
|
||||
}, 'From ShapeShift'),
|
||||
}, t('fromShapeShift')),
|
||||
h('div', formatDate(props.time)),
|
||||
h('div', {
|
||||
style: {
|
||||
@ -196,7 +197,7 @@ ShiftListItem.prototype.renderInfo = function () {
|
||||
])
|
||||
|
||||
case 'failed':
|
||||
return h('span.error', '(Failed)')
|
||||
return h('span.error', '(' + t('failed') + ')')
|
||||
default:
|
||||
return ''
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ const classnames = require('classnames')
|
||||
const AccountDropdownMini = require('./dropdowns/account-dropdown-mini')
|
||||
|
||||
const actions = require('../actions')
|
||||
const t = require('../../i18n')
|
||||
const { conversionUtil } = require('../conversion-util')
|
||||
|
||||
const {
|
||||
@ -54,7 +55,7 @@ SignatureRequest.prototype.renderHeader = function () {
|
||||
|
||||
h('div.request-signature__header-background'),
|
||||
|
||||
h('div.request-signature__header__text', 'Signature Request'),
|
||||
h('div.request-signature__header__text', t('sigRequest')),
|
||||
|
||||
h('div.request-signature__header__tip-container', [
|
||||
h('div.request-signature__header__tip'),
|
||||
@ -75,7 +76,7 @@ SignatureRequest.prototype.renderAccountDropdown = function () {
|
||||
|
||||
return h('div.request-signature__account', [
|
||||
|
||||
h('div.request-signature__account-text', ['Account:']),
|
||||
h('div.request-signature__account-text', [t('account') + ':']),
|
||||
|
||||
h(AccountDropdownMini, {
|
||||
selectedAccount,
|
||||
@ -102,7 +103,7 @@ SignatureRequest.prototype.renderBalance = function () {
|
||||
|
||||
return h('div.request-signature__balance', [
|
||||
|
||||
h('div.request-signature__balance-text', ['Balance:']),
|
||||
h('div.request-signature__balance-text', [t('balance')]),
|
||||
|
||||
h('div.request-signature__balance-value', `${balanceInEther} ETH`),
|
||||
|
||||
@ -136,7 +137,7 @@ SignatureRequest.prototype.renderRequestInfo = function () {
|
||||
return h('div.request-signature__request-info', [
|
||||
|
||||
h('div.request-signature__headline', [
|
||||
`Your signature is being requested`,
|
||||
t('yourSigRequested'),
|
||||
]),
|
||||
|
||||
])
|
||||
@ -154,21 +155,18 @@ SignatureRequest.prototype.msgHexToText = function (hex) {
|
||||
|
||||
SignatureRequest.prototype.renderBody = function () {
|
||||
let rows
|
||||
let notice = 'You are signing:'
|
||||
let notice = t('youSign') + ':'
|
||||
|
||||
const { txData } = this.props
|
||||
const { type, msgParams: { data } } = txData
|
||||
|
||||
if (type === 'personal_sign') {
|
||||
rows = [{ name: 'Message', value: this.msgHexToText(data) }]
|
||||
rows = [{ name: t('message'), value: this.msgHexToText(data) }]
|
||||
} else if (type === 'eth_signTypedData') {
|
||||
rows = data
|
||||
} else if (type === 'eth_sign') {
|
||||
rows = [{ name: 'Message', value: data }]
|
||||
notice = `Signing this message can have
|
||||
dangerous side effects. Only sign messages from
|
||||
sites you fully trust with your entire account.
|
||||
This dangerous method will be removed in a future version. `
|
||||
rows = [{ name: t('message'), value: data }]
|
||||
notice = t('signNotice')
|
||||
}
|
||||
|
||||
return h('div.request-signature__body', {}, [
|
||||
@ -227,10 +225,10 @@ SignatureRequest.prototype.renderFooter = function () {
|
||||
return h('div.request-signature__footer', [
|
||||
h('button.request-signature__footer__cancel-button', {
|
||||
onClick: cancel,
|
||||
}, 'CANCEL'),
|
||||
}, t('cancel')),
|
||||
h('button.request-signature__footer__sign-button', {
|
||||
onClick: sign,
|
||||
}, 'SIGN'),
|
||||
}, t('sign')),
|
||||
])
|
||||
}
|
||||
|
||||
@ -250,4 +248,3 @@ SignatureRequest.prototype.render = function () {
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,7 @@ const TokenTracker = require('eth-token-tracker')
|
||||
const TokenCell = require('./token-cell.js')
|
||||
const connect = require('react-redux').connect
|
||||
const selectors = require('../selectors')
|
||||
const t = require('../../i18n')
|
||||
|
||||
function mapStateToProps (state) {
|
||||
return {
|
||||
@ -42,7 +43,7 @@ TokenList.prototype.render = function () {
|
||||
const { tokens, isLoading, error } = state
|
||||
|
||||
if (isLoading) {
|
||||
return this.message('Loading Tokens...')
|
||||
return this.message(t('loadingTokens'))
|
||||
}
|
||||
|
||||
if (error) {
|
||||
@ -52,7 +53,7 @@ TokenList.prototype.render = function () {
|
||||
padding: '80px',
|
||||
},
|
||||
}, [
|
||||
'We had trouble loading your token balances. You can view them ',
|
||||
t('troubleTokenBalances'),
|
||||
h('span.hotFix', {
|
||||
style: {
|
||||
color: 'rgba(247, 134, 28, 1)',
|
||||
@ -63,7 +64,7 @@ TokenList.prototype.render = function () {
|
||||
url: `https://ethplorer.io/address/${userAddress}`,
|
||||
})
|
||||
},
|
||||
}, 'here'),
|
||||
}, t('here')),
|
||||
])
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,7 @@ const vreme = new (require('vreme'))()
|
||||
const Tooltip = require('./tooltip')
|
||||
const numberToBN = require('number-to-bn')
|
||||
const actions = require('../actions')
|
||||
const t = require('../../i18n')
|
||||
|
||||
const TransactionIcon = require('./transaction-list-item-icon')
|
||||
const ShiftListItem = require('./shift-list-item')
|
||||
@ -85,7 +86,7 @@ TransactionListItem.prototype.render = function () {
|
||||
]),
|
||||
|
||||
h(Tooltip, {
|
||||
title: 'Transaction Number',
|
||||
title: t('transactionNumber'),
|
||||
position: 'right',
|
||||
}, [
|
||||
h('span', {
|
||||
@ -142,12 +143,12 @@ TransactionListItem.prototype.render = function () {
|
||||
style: {
|
||||
paddingRight: '2px',
|
||||
},
|
||||
}, 'Taking too long?'),
|
||||
}, t('takesTooLong')),
|
||||
h('div', {
|
||||
style: {
|
||||
textDecoration: 'underline',
|
||||
},
|
||||
}, 'Retry with a higher gas price here'),
|
||||
}, t('retryWithMoreGas')),
|
||||
]),
|
||||
])
|
||||
)
|
||||
@ -176,11 +177,11 @@ function recipientField (txParams, transaction, isTx, isMsg) {
|
||||
let message
|
||||
|
||||
if (isMsg) {
|
||||
message = 'Signature Requested'
|
||||
message = t('sigRequested')
|
||||
} else if (txParams.to) {
|
||||
message = addressSummary(txParams.to)
|
||||
} else {
|
||||
message = 'Contract Deployment'
|
||||
message = t('contractDeployment')
|
||||
}
|
||||
|
||||
return h('div', {
|
||||
@ -203,7 +204,7 @@ function renderErrorOrWarning (transaction) {
|
||||
|
||||
// show rejected
|
||||
if (status === 'rejected') {
|
||||
return h('span.error', ' (Rejected)')
|
||||
return h('span.error', ' (' + t('rejected') + ')')
|
||||
}
|
||||
if (transaction.err || transaction.warning) {
|
||||
const { err, warning = {} } = transaction
|
||||
@ -219,7 +220,7 @@ function renderErrorOrWarning (transaction) {
|
||||
title: message,
|
||||
position: 'bottom',
|
||||
}, [
|
||||
h(`span.error`, ` (Failed)`),
|
||||
h(`span.error`, ` (` + t('failed') + `)`),
|
||||
])
|
||||
)
|
||||
}
|
||||
@ -231,7 +232,7 @@ function renderErrorOrWarning (transaction) {
|
||||
title: message,
|
||||
position: 'bottom',
|
||||
}, [
|
||||
h(`span.warning`, ` (Warning)`),
|
||||
h(`span.warning`, ` (` + t('warning') + `)`),
|
||||
])
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ const h = require('react-hyperscript')
|
||||
const inherits = require('util').inherits
|
||||
|
||||
const TransactionListItem = require('./transaction-list-item')
|
||||
const t = require('../../i18n')
|
||||
|
||||
module.exports = TransactionList
|
||||
|
||||
@ -78,10 +79,9 @@ TransactionList.prototype.render = function () {
|
||||
style: {
|
||||
marginTop: '50px',
|
||||
},
|
||||
}, 'No transaction history.'),
|
||||
}, t('noTransactionHistory')),
|
||||
]),
|
||||
]),
|
||||
])
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,7 @@ const { conversionUtil, multiplyCurrencies } = require('../conversion-util')
|
||||
const { calcTokenAmount } = require('../token-util')
|
||||
|
||||
const { getCurrentCurrency } = require('../selectors')
|
||||
const t = require('../../i18n')
|
||||
|
||||
module.exports = connect(mapStateToProps)(TxListItem)
|
||||
|
||||
@ -63,7 +64,7 @@ TxListItem.prototype.getAddressText = function () {
|
||||
default:
|
||||
return address
|
||||
? `${address.slice(0, 10)}...${address.slice(-4)}`
|
||||
: 'Contract Deployment'
|
||||
: t('contractDeployment')
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,7 @@ const { formatDate } = require('../util')
|
||||
const { showConfTxPage } = require('../actions')
|
||||
const classnames = require('classnames')
|
||||
const { tokenInfoGetter } = require('../token-util')
|
||||
const t = require('../../i18n')
|
||||
|
||||
module.exports = connect(mapStateToProps, mapDispatchToProps)(TxList)
|
||||
|
||||
@ -56,7 +57,7 @@ TxList.prototype.renderTransaction = function () {
|
||||
: [h(
|
||||
'div.tx-list-item.tx-list-item--empty',
|
||||
{ key: 'tx-list-none' },
|
||||
[ 'No Transactions' ],
|
||||
[ t('noTransactions') ],
|
||||
)]
|
||||
}
|
||||
|
||||
@ -107,7 +108,7 @@ TxList.prototype.renderTransactionListItem = function (transaction, conversionRa
|
||||
|
||||
if (isUnapproved) {
|
||||
opts.onClick = () => showConfTxPage({id: transActionId})
|
||||
opts.transactionStatus = 'Not Started'
|
||||
opts.transactionStatus = t('Not Started')
|
||||
} else if (transactionHash) {
|
||||
opts.onClick = () => this.view(transactionHash, transactionNetworkId)
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ const ethUtil = require('ethereumjs-util')
|
||||
const inherits = require('util').inherits
|
||||
const actions = require('../actions')
|
||||
const selectors = require('../selectors')
|
||||
const t = require('../../i18n')
|
||||
|
||||
const BalanceComponent = require('./balance-component')
|
||||
const TxList = require('./tx-list')
|
||||
@ -68,25 +69,25 @@ TxView.prototype.renderButtons = function () {
|
||||
return !selectedToken
|
||||
? (
|
||||
h('div.flex-row.flex-center.hero-balance-buttons', [
|
||||
h('button.btn-clear.hero-balance-button', {
|
||||
h('button.btn-clear.hero-balance-button.allcaps', {
|
||||
onClick: () => showModal({
|
||||
name: 'DEPOSIT_ETHER',
|
||||
}),
|
||||
}, 'DEPOSIT'),
|
||||
}, t('deposit')),
|
||||
|
||||
h('button.btn-clear.hero-balance-button', {
|
||||
h('button.btn-clear.hero-balance-button.allcaps', {
|
||||
style: {
|
||||
marginLeft: '0.8em',
|
||||
},
|
||||
onClick: showSendPage,
|
||||
}, 'SEND'),
|
||||
}, t('send')),
|
||||
])
|
||||
)
|
||||
: (
|
||||
h('div.flex-row.flex-center.hero-balance-buttons', [
|
||||
h('button.btn-clear.hero-balance-button', {
|
||||
onClick: showSendTokenPage,
|
||||
}, 'SEND'),
|
||||
}, t('send')),
|
||||
])
|
||||
)
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ const actions = require('../actions')
|
||||
const BalanceComponent = require('./balance-component')
|
||||
const TokenList = require('./token-list')
|
||||
const selectors = require('../selectors')
|
||||
const t = require('../../i18n')
|
||||
|
||||
module.exports = connect(mapStateToProps, mapDispatchToProps)(WalletView)
|
||||
|
||||
@ -116,7 +117,7 @@ WalletView.prototype.render = function () {
|
||||
onClick: hideSidebar,
|
||||
}),
|
||||
|
||||
h('div.wallet-view__keyring-label', isLoose ? 'IMPORTED' : ''),
|
||||
h('div.wallet-view__keyring-label.allcaps', isLoose ? t('imported') : ''),
|
||||
|
||||
h('div.flex-column.flex-center.wallet-view__name-container', {
|
||||
style: { margin: '0 auto' },
|
||||
@ -133,13 +134,13 @@ WalletView.prototype.render = function () {
|
||||
selectedIdentity.name,
|
||||
]),
|
||||
|
||||
h('button.btn-clear.wallet-view__details-button', 'DETAILS'),
|
||||
h('button.btn-clear.wallet-view__details-button.allcaps', t('details')),
|
||||
]),
|
||||
]),
|
||||
|
||||
h(Tooltip, {
|
||||
position: 'bottom',
|
||||
title: this.state.hasCopied ? 'Copied!' : 'Copy to clipboard',
|
||||
title: this.state.hasCopied ? t('copiedExclamation') : t('copyToClipboard'),
|
||||
wrapperClassName: 'wallet-view__tooltip',
|
||||
}, [
|
||||
h('button.wallet-view__address', {
|
||||
@ -172,7 +173,7 @@ WalletView.prototype.render = function () {
|
||||
showAddTokenPage()
|
||||
hideSidebar()
|
||||
},
|
||||
}, 'Add Token'),
|
||||
}, t('addToken')),
|
||||
])
|
||||
}
|
||||
|
||||
|
@ -70,6 +70,10 @@ input.large-input {
|
||||
height: 36px;
|
||||
}
|
||||
|
||||
.allcaps {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.page-container {
|
||||
width: 400px;
|
||||
background-color: $white;
|
||||
|
@ -6,6 +6,7 @@ const h = require('react-hyperscript')
|
||||
const Mascot = require('../components/mascot')
|
||||
const actions = require('../actions')
|
||||
const Tooltip = require('../components/tooltip')
|
||||
const t = require('../../i18n')
|
||||
const getCaretCoordinates = require('textarea-caret')
|
||||
const environmentType = require('../../../app/scripts/lib/environment-type')
|
||||
const { OLD_UI_NETWORK_TYPE } = require('../../../app/scripts/config').enums
|
||||
@ -59,7 +60,7 @@ InitializeMenuScreen.prototype.renderMenu = function (state) {
|
||||
color: '#7F8082',
|
||||
marginBottom: 10,
|
||||
},
|
||||
}, 'MetaMask'),
|
||||
}, t('appName')),
|
||||
|
||||
|
||||
h('div', [
|
||||
@ -69,10 +70,10 @@ InitializeMenuScreen.prototype.renderMenu = function (state) {
|
||||
color: '#7F8082',
|
||||
display: 'inline',
|
||||
},
|
||||
}, 'Encrypt your new DEN'),
|
||||
}, t('encryptNewDen')),
|
||||
|
||||
h(Tooltip, {
|
||||
title: 'Your DEN is your password-encrypted storage within MetaMask.',
|
||||
title: t('denExplainer'),
|
||||
}, [
|
||||
h('i.fa.fa-question-circle.pointer', {
|
||||
style: {
|
||||
@ -92,7 +93,7 @@ InitializeMenuScreen.prototype.renderMenu = function (state) {
|
||||
h('input.large-input.letter-spacey', {
|
||||
type: 'password',
|
||||
id: 'password-box',
|
||||
placeholder: 'New Password (min 8 chars)',
|
||||
placeholder: t('newPassword'),
|
||||
onInput: this.inputChanged.bind(this),
|
||||
style: {
|
||||
width: 260,
|
||||
@ -104,7 +105,7 @@ InitializeMenuScreen.prototype.renderMenu = function (state) {
|
||||
h('input.large-input.letter-spacey', {
|
||||
type: 'password',
|
||||
id: 'password-box-confirm',
|
||||
placeholder: 'Confirm Password',
|
||||
placeholder: t('confirmPassword'),
|
||||
onKeyPress: this.createVaultOnEnter.bind(this),
|
||||
onInput: this.inputChanged.bind(this),
|
||||
style: {
|
||||
@ -119,7 +120,7 @@ InitializeMenuScreen.prototype.renderMenu = function (state) {
|
||||
style: {
|
||||
margin: 12,
|
||||
},
|
||||
}, 'Create'),
|
||||
}, t('createDen')),
|
||||
|
||||
h('.flex-row.flex-center.flex-grow', [
|
||||
h('p.pointer', {
|
||||
@ -129,7 +130,7 @@ InitializeMenuScreen.prototype.renderMenu = function (state) {
|
||||
color: 'rgb(247, 134, 28)',
|
||||
textDecoration: 'underline',
|
||||
},
|
||||
}, 'Import Existing DEN'),
|
||||
}, t('importDen')),
|
||||
]),
|
||||
|
||||
h('.flex-row.flex-center.flex-grow', [
|
||||
@ -178,12 +179,12 @@ InitializeMenuScreen.prototype.createNewVaultAndKeychain = function () {
|
||||
var passwordConfirm = passwordConfirmBox.value
|
||||
|
||||
if (password.length < 8) {
|
||||
this.warning = 'password not long enough'
|
||||
this.warning = t('passwordShort')
|
||||
this.props.dispatch(actions.displayWarning(this.warning))
|
||||
return
|
||||
}
|
||||
if (password !== passwordConfirm) {
|
||||
this.warning = 'passwords don\'t match'
|
||||
this.warning = t('passwordMismatch')
|
||||
this.props.dispatch(actions.displayWarning(this.warning))
|
||||
return
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ const connect = require('react-redux').connect
|
||||
const actions = require('./actions')
|
||||
const getCaretCoordinates = require('textarea-caret')
|
||||
const EventEmitter = require('events').EventEmitter
|
||||
const t = require('../i18n')
|
||||
const { OLD_UI_NETWORK_TYPE } = require('../../app/scripts/config').enums
|
||||
const environmentType = require('../../app/scripts/lib/environment-type')
|
||||
|
||||
@ -40,7 +41,7 @@ UnlockScreen.prototype.render = function () {
|
||||
textTransform: 'uppercase',
|
||||
color: '#7F8082',
|
||||
},
|
||||
}, 'MetaMask'),
|
||||
}, t('appName')),
|
||||
|
||||
h('input.large-input', {
|
||||
type: 'password',
|
||||
|
33
ui/i18n.js
Normal file
33
ui/i18n.js
Normal file
@ -0,0 +1,33 @@
|
||||
|
||||
// cross-browser connection to extension i18n API
|
||||
|
||||
const chrome = chrome || null
|
||||
const browser = browser || null
|
||||
const extension = require('extensionizer')
|
||||
var log = require('loglevel')
|
||||
window.log = log
|
||||
let getMessage
|
||||
|
||||
if (extension.i18n && extension.i18n.getMessage) {
|
||||
getMessage = extension.i18n.getMessage
|
||||
} else {
|
||||
// fallback function
|
||||
log.warn('browser.i18n API not available, calling back to english.')
|
||||
const msg = require('../app/_locales/en/messages.json')
|
||||
getMessage = function (key, substitutions) {
|
||||
if (!msg[key]) {
|
||||
log.error(key)
|
||||
throw new Error(key)
|
||||
}
|
||||
let phrase = msg[key].message
|
||||
if (substitutions && substitutions.length) {
|
||||
phrase = phrase.replace(/\$1/g, substitutions[0])
|
||||
if (substitutions.length > 1) {
|
||||
phrase = phrase.replace(/\$2/g, substitutions[1])
|
||||
}
|
||||
}
|
||||
return phrase
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = getMessage
|
Loading…
x
Reference in New Issue
Block a user