Merge pull request #3635 from MetaMask/i3571-CompleteI18nTemplates

I3571 complete i18n templates
feature/default_network_editable
kumavis 7 years ago committed by GitHub
commit fd3e240dd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 71
      app/_locales/en/messages.json
  2. 6
      ui/app/accounts/import/index.js
  3. 4
      ui/app/accounts/import/json.js
  4. 43
      ui/app/add-token.js
  5. 33
      ui/app/app.js
  6. 27
      ui/app/components/tx-list-item.js
  7. 2
      ui/app/components/tx-list.js
  8. 7
      ui/app/keychains/hd/recover-seed/confirmation.js
  9. 35
      ui/app/keychains/hd/restore-vault.js
  10. 30
      ui/app/send-v2.js
  11. 76
      ui/app/settings.js
  12. 6
      ui/app/unlock.js

@ -37,6 +37,9 @@
"message": "MetaMask", "message": "MetaMask",
"description": "The name of the application" "description": "The name of the application"
}, },
"approved": {
"message": "Approved"
},
"attemptingConnect": { "attemptingConnect": {
"message": "Attempting to connect to blockchain." "message": "Attempting to connect to blockchain."
}, },
@ -83,6 +86,9 @@
"buyCoinbaseExplainer": { "buyCoinbaseExplainer": {
"message": "Coinbase is the world’s most popular way to buy and sell bitcoin, ethereum, and litecoin." "message": "Coinbase is the world’s most popular way to buy and sell bitcoin, ethereum, and litecoin."
}, },
"ok": {
"message": "Ok"
},
"cancel": { "cancel": {
"message": "Cancel" "message": "Cancel"
}, },
@ -95,6 +101,9 @@
"confirm": { "confirm": {
"message": "Confirm" "message": "Confirm"
}, },
"confirmed": {
"message": "Confirmed"
},
"confirmContract": { "confirmContract": {
"message": "Confirm Contract" "message": "Confirm Contract"
}, },
@ -226,6 +235,9 @@
"downloadStatelogs": { "downloadStatelogs": {
"message": "Download State Logs" "message": "Download State Logs"
}, },
"dropped": {
"message": "Dropped"
},
"edit": { "edit": {
"message": "Edit" "message": "Edit"
}, },
@ -244,6 +256,12 @@
"enterPasswordConfirm": { "enterPasswordConfirm": {
"message": "Enter your password to confirm" "message": "Enter your password to confirm"
}, },
"passwordNotLongEnough": {
"message": "Password not long enough"
},
"passwordsDontMatch": {
"message": "Passwords Don't Match"
},
"etherscanView": { "etherscanView": {
"message": "View account on Etherscan" "message": "View account on Etherscan"
}, },
@ -403,6 +421,9 @@
"knowledgeDataBase": { "knowledgeDataBase": {
"message": "Visit our Knowledge Base" "message": "Visit our Knowledge Base"
}, },
"max": {
"message": "Max"
},
"lessThanMax": { "lessThanMax": {
"message": "must be less than or equal to $1.", "message": "must be less than or equal to $1.",
"description": "helper for inputting hex as decimal input" "description": "helper for inputting hex as decimal input"
@ -410,6 +431,9 @@
"likeToAddTokens": { "likeToAddTokens": {
"message": "Would you like to add these tokens?" "message": "Would you like to add these tokens?"
}, },
"links": {
"message": "Links"
},
"limit": { "limit": {
"message": "Limit" "message": "Limit"
}, },
@ -583,12 +607,18 @@
"restoreFromSeed": { "restoreFromSeed": {
"message": "Restore from seed phrase" "message": "Restore from seed phrase"
}, },
"restoreVault": {
"message": "Restore Vault"
},
"required": { "required": {
"message": "Required" "message": "Required"
}, },
"retryWithMoreGas": { "retryWithMoreGas": {
"message": "Retry with a higher gas price here" "message": "Retry with a higher gas price here"
}, },
"walletSeed": {
"message": "Wallet Seed"
},
"revealSeedWords": { "revealSeedWords": {
"message": "Reveal Seed Words" "message": "Reveal Seed Words"
}, },
@ -604,6 +634,24 @@
"ropsten": { "ropsten": {
"message": "Ropsten Test Network" "message": "Ropsten Test Network"
}, },
"currentRpc": {
"message": "Current RPC"
},
"connectingToMainnet": {
"message": "Connecting to Main Ethereum Network"
},
"connectingToRopsten": {
"message": "Connecting to Ropsten Test Network"
},
"connectingToKovan": {
"message": "Connecting to Kovan Test Network"
},
"connectingToRinkeby": {
"message": "Connecting to Rinkeby Test Network"
},
"connectingToUnknown": {
"message": "Connecting to Unknown Network"
},
"sampleAccountName": { "sampleAccountName": {
"message": "E.g. My new account", "message": "E.g. My new account",
"description": "Help user understand concept of adding a human-readable name to their account" "description": "Help user understand concept of adding a human-readable name to their account"
@ -624,6 +672,9 @@
"secretPhrase": { "secretPhrase": {
"message": "Enter your secret twelve word phrase here to restore your vault." "message": "Enter your secret twelve word phrase here to restore your vault."
}, },
"newPassword8Chars": {
"message": "New Password (min 8 chars)"
},
"seedPhraseReq": { "seedPhraseReq": {
"message": "seed phrases are 12 words long" "message": "seed phrases are 12 words long"
}, },
@ -648,12 +699,18 @@
"sendTokens": { "sendTokens": {
"message": "Send Tokens" "message": "Send Tokens"
}, },
"onlySendToEtherAddress": {
"message": "Only send ETH to an Ethereum address."
},
"sendTokensAnywhere": { "sendTokensAnywhere": {
"message": "Send Tokens to anyone with an Ethereum account" "message": "Send Tokens to anyone with an Ethereum account"
}, },
"settings": { "settings": {
"message": "Settings" "message": "Settings"
}, },
"info": {
"message": "Info"
},
"shapeshiftBuy": { "shapeshiftBuy": {
"message": "Buy with Shapeshift" "message": "Buy with Shapeshift"
}, },
@ -666,6 +723,9 @@
"sign": { "sign": {
"message": "Sign" "message": "Sign"
}, },
"signed": {
"message": "Signed"
},
"signMessage": { "signMessage": {
"message": "Sign Message" "message": "Sign Message"
}, },
@ -690,9 +750,15 @@
"stateLogsDescription": { "stateLogsDescription": {
"message": "State logs contain your public account addresses and sent transactions." "message": "State logs contain your public account addresses and sent transactions."
}, },
"stateLogError": {
"message": "Error in retrieving state logs."
},
"submit": { "submit": {
"message": "Submit" "message": "Submit"
}, },
"submitted": {
"message": "Submitted"
},
"supportCenter": { "supportCenter": {
"message": "Visit our Support Center" "message": "Visit our Support Center"
}, },
@ -709,7 +775,7 @@
"message": "Test Faucet" "message": "Test Faucet"
}, },
"to": { "to": {
"message": "To" "message": "To: "
}, },
"toETHviaShapeShift": { "toETHviaShapeShift": {
"message": "$1 to ETH via ShapeShift", "message": "$1 to ETH via ShapeShift",
@ -764,6 +830,9 @@
"uiWelcomeMessage": { "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." "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."
}, },
"unapproved": {
"message": "Unapproved"
},
"unavailable": { "unavailable": {
"message": "Unavailable" "message": "Unavailable"
}, },

@ -37,7 +37,7 @@ AccountImportSubview.prototype.render = function () {
h('div.new-account-import-form', [ h('div.new-account-import-form', [
h('.new-account-import-disclaimer', [ h('.new-account-import-disclaimer', [
h('span', 'Imported accounts will not be associated with your originally created MetaMask account seedphrase. Learn more about imported accounts '), h('span', t('importAccountMsg')),
h('span', { h('span', {
style: { style: {
cursor: 'pointer', cursor: 'pointer',
@ -48,12 +48,12 @@ AccountImportSubview.prototype.render = function () {
url: 'https://metamask.helpscoutdocs.com/article/17-what-are-loose-accounts', url: 'https://metamask.helpscoutdocs.com/article/17-what-are-loose-accounts',
}) })
}, },
}, 'here'), }, t('here')),
]), ]),
h('div.new-account-import-form__select-section', [ h('div.new-account-import-form__select-section', [
h('div.new-account-import-form__select-label', 'Select Type'), h('div.new-account-import-form__select-label', t('selectType')),
h(Select, { h(Select, {
className: 'new-account-import-form__select', className: 'new-account-import-form__select',

@ -84,7 +84,7 @@ class JsonImportSubview extends Component {
const state = this.state const state = this.state
if (!state) { if (!state) {
const message = 'You must select a valid file to import.' const message = t('validFileImport')
return this.props.displayWarning(message) return this.props.displayWarning(message)
} }
@ -102,7 +102,7 @@ class JsonImportSubview extends Component {
const message = t('needImportPassword') const message = t('needImportPassword')
return this.props.displayWarning(message) return this.props.displayWarning(message)
} }
this.props.importNewJsonAccount([ fileContents, password ]) this.props.importNewJsonAccount([ fileContents, password ])
} }
} }

@ -26,6 +26,7 @@ const fuse = new Fuse(contractList, {
const actions = require('./actions') const actions = require('./actions')
const ethUtil = require('ethereumjs-util') const ethUtil = require('ethereumjs-util')
const { tokenInfoGetter } = require('./token-util') const { tokenInfoGetter } = require('./token-util')
const t = require('../i18n')
const emptyAddr = '0x0000000000000000000000000000000000000000' const emptyAddr = '0x0000000000000000000000000000000000000000'
@ -139,28 +140,28 @@ AddTokenScreen.prototype.validate = function () {
if (customAddress) { if (customAddress) {
const validAddress = ethUtil.isValidAddress(customAddress) const validAddress = ethUtil.isValidAddress(customAddress)
if (!validAddress) { if (!validAddress) {
errors.customAddress = 'Address is invalid. ' errors.customAddress = t('invalidAddress')
} }
const validDecimals = customDecimals !== null && customDecimals >= 0 && customDecimals < 36 const validDecimals = customDecimals !== null && customDecimals >= 0 && customDecimals < 36
if (!validDecimals) { if (!validDecimals) {
errors.customDecimals = 'Decimals must be at least 0, and not over 36.' errors.customDecimals = t('decimalsMustZerotoTen')
} }
const symbolLen = customSymbol.trim().length const symbolLen = customSymbol.trim().length
const validSymbol = symbolLen > 0 && symbolLen < 10 const validSymbol = symbolLen > 0 && symbolLen < 10
if (!validSymbol) { if (!validSymbol) {
errors.customSymbol = 'Symbol must be between 0 and 10 characters.' errors.customSymbol = t('symbolBetweenZeroTen')
} }
const ownAddress = identitiesList.includes(standardAddress) const ownAddress = identitiesList.includes(standardAddress)
if (ownAddress) { if (ownAddress) {
errors.customAddress = 'Personal address detected. Input the token contract address.' errors.customAddress = t('personalAddressDetected')
} }
const tokenAlreadyAdded = this.checkExistingAddresses(customAddress) const tokenAlreadyAdded = this.checkExistingAddresses(customAddress)
if (tokenAlreadyAdded) { if (tokenAlreadyAdded) {
errors.customAddress = 'Token has already been added.' errors.customAddress = t('tokenAlreadyAdded')
} }
} else if ( } else if (
Object.entries(selectedTokens) Object.entries(selectedTokens)
@ -168,7 +169,7 @@ AddTokenScreen.prototype.validate = function () {
isEmpty && !isSelected isEmpty && !isSelected
), true) ), true)
) { ) {
errors.tokenSelector = 'Must select at least 1 token.' errors.tokenSelector = t('mustSelectOne')
} }
return { return {
@ -198,7 +199,7 @@ AddTokenScreen.prototype.renderCustomForm = function () {
'add-token__add-custom-field--error': errors.customAddress, 'add-token__add-custom-field--error': errors.customAddress,
}), }),
}, [ }, [
h('div.add-token__add-custom-label', 'Token Address'), h('div.add-token__add-custom-label', t('tokenAddress')),
h('input.add-token__add-custom-input', { h('input.add-token__add-custom-input', {
type: 'text', type: 'text',
onChange: this.tokenAddressDidChange, onChange: this.tokenAddressDidChange,
@ -211,7 +212,7 @@ AddTokenScreen.prototype.renderCustomForm = function () {
'add-token__add-custom-field--error': errors.customSymbol, 'add-token__add-custom-field--error': errors.customSymbol,
}), }),
}, [ }, [
h('div.add-token__add-custom-label', 'Token Symbol'), h('div.add-token__add-custom-label', t('tokenSymbol')),
h('input.add-token__add-custom-input', { h('input.add-token__add-custom-input', {
type: 'text', type: 'text',
onChange: this.tokenSymbolDidChange, onChange: this.tokenSymbolDidChange,
@ -225,7 +226,7 @@ AddTokenScreen.prototype.renderCustomForm = function () {
'add-token__add-custom-field--error': errors.customDecimals, 'add-token__add-custom-field--error': errors.customDecimals,
}), }),
}, [ }, [
h('div.add-token__add-custom-label', 'Decimals of Precision'), h('div.add-token__add-custom-label', t('decimal')),
h('input.add-token__add-custom-input', { h('input.add-token__add-custom-input', {
type: 'number', type: 'number',
onChange: this.tokenDecimalsDidChange, onChange: this.tokenDecimalsDidChange,
@ -299,11 +300,11 @@ AddTokenScreen.prototype.renderConfirmation = function () {
h('div.add-token', [ h('div.add-token', [
h('div.add-token__wrapper', [ h('div.add-token__wrapper', [
h('div.add-token__title-container.add-token__confirmation-title', [ h('div.add-token__title-container.add-token__confirmation-title', [
h('div.add-token__title', 'Add Token'), h('div.add-token__title', t('addToken')),
h('div.add-token__description', 'Would you like to add these tokens?'), h('div.add-token__description', t('likeToAddTokens')),
]), ]),
h('div.add-token__content-container.add-token__confirmation-content', [ h('div.add-token__content-container.add-token__confirmation-content', [
h('div.add-token__description.add-token__confirmation-description', 'Your balances'), h('div.add-token__description.add-token__confirmation-description', t('balances')),
h('div.add-token__confirmation-token-list', h('div.add-token__confirmation-token-list',
Object.entries(tokens) Object.entries(tokens)
.map(([ address, token ]) => ( .map(([ address, token ]) => (
@ -322,10 +323,10 @@ AddTokenScreen.prototype.renderConfirmation = function () {
h('div.add-token__buttons', [ h('div.add-token__buttons', [
h('button.btn-cancel.add-token__button', { h('button.btn-cancel.add-token__button', {
onClick: () => this.setState({ isShowingConfirmation: false }), onClick: () => this.setState({ isShowingConfirmation: false }),
}, 'Back'), }, t('back')),
h('button.btn-clear.add-token__button', { h('button.btn-clear.add-token__button', {
onClick: () => addTokens(tokens).then(goHome), onClick: () => addTokens(tokens).then(goHome),
}, 'Add Tokens'), }, t('addTokens')),
]), ]),
]) ])
) )
@ -341,15 +342,15 @@ AddTokenScreen.prototype.render = function () {
h('div.add-token', [ h('div.add-token', [
h('div.add-token__wrapper', [ h('div.add-token__wrapper', [
h('div.add-token__title-container', [ h('div.add-token__title-container', [
h('div.add-token__title', 'Add Token'), h('div.add-token__title', t('addToken')),
h('div.add-token__description', 'Keep track of the tokens you’ve bought with your MetaMask account. If you bought tokens using a different account, those tokens will not appear here.'), h('div.add-token__description', t('tokenWarning1')),
h('div.add-token__description', 'Search for tokens or select from our list of popular tokens.'), h('div.add-token__description', t('tokenSelection')),
]), ]),
h('div.add-token__content-container', [ h('div.add-token__content-container', [
h('div.add-token__input-container', [ h('div.add-token__input-container', [
h('input.add-token__input', { h('input.add-token__input', {
type: 'text', type: 'text',
placeholder: 'Search', placeholder: t('search'),
onChange: e => this.setState({ searchQuery: e.target.value }), onChange: e => this.setState({ searchQuery: e.target.value }),
}), }),
h('div.add-token__search-input-error-message', errors.tokenSelector), h('div.add-token__search-input-error-message', errors.tokenSelector),
@ -363,7 +364,7 @@ AddTokenScreen.prototype.render = function () {
h('div.add-token__add-custom', { h('div.add-token__add-custom', {
onClick: () => this.setState({ isCollapsed: !isCollapsed }), onClick: () => this.setState({ isCollapsed: !isCollapsed }),
}, [ }, [
'Add custom token', t('addCustomToken'),
h(`i.fa.fa-angle-${isCollapsed ? 'down' : 'up'}`), h(`i.fa.fa-angle-${isCollapsed ? 'down' : 'up'}`),
]), ]),
this.renderCustomForm(), this.renderCustomForm(),
@ -372,10 +373,10 @@ AddTokenScreen.prototype.render = function () {
h('div.add-token__buttons', [ h('div.add-token__buttons', [
h('button.btn-cancel.add-token__button', { h('button.btn-cancel.add-token__button', {
onClick: goHome, onClick: goHome,
}, 'Cancel'), }, t('cancel')),
h('button.btn-clear.add-token__button', { h('button.btn-clear.add-token__button', {
onClick: this.onNext, onClick: this.onNext,
}, 'Next'), }, t('next')),
]), ]),
]) ])
) )

@ -132,7 +132,7 @@ App.prototype.render = function () {
} = props } = props
const isLoadingNetwork = network === 'loading' && props.currentView.name !== 'config' const isLoadingNetwork = network === 'loading' && props.currentView.name !== 'config'
const loadMessage = loadingMessage || isLoadingNetwork ? const loadMessage = loadingMessage || isLoadingNetwork ?
`Connecting to ${this.getNetworkName()}` : null this.getConnectingLabel() : null
log.debug('Main ui render function') log.debug('Main ui render function')
return ( return (
@ -550,6 +550,27 @@ App.prototype.toggleMetamaskActive = function () {
} }
} }
App.prototype.getConnectingLabel = function () {
const { provider } = this.props
const providerName = provider.type
let name
if (providerName === 'mainnet') {
name = t('connectingToMainnet')
} else if (providerName === 'ropsten') {
name = t('connectingToRopsten')
} else if (providerName === 'kovan') {
name = t('connectingToRopsten')
} else if (providerName === 'rinkeby') {
name = t('connectingToRinkeby')
} else {
name = t('connectingToUnknown')
}
return name
}
App.prototype.getNetworkName = function () { App.prototype.getNetworkName = function () {
const { provider } = this.props const { provider } = this.props
const providerName = provider.type const providerName = provider.type
@ -557,15 +578,15 @@ App.prototype.getNetworkName = function () {
let name let name
if (providerName === 'mainnet') { if (providerName === 'mainnet') {
name = 'Main Ethereum Network' name = t('mainnet')
} else if (providerName === 'ropsten') { } else if (providerName === 'ropsten') {
name = 'Ropsten Test Network' name = t('ropsten')
} else if (providerName === 'kovan') { } else if (providerName === 'kovan') {
name = 'Kovan Test Network' name = t('kovan')
} else if (providerName === 'rinkeby') { } else if (providerName === 'rinkeby') {
name = 'Rinkeby Test Network' name = t('rinkeby')
} else { } else {
name = 'Unknown Private Network' name = t('unknownNetwork')
} }
return name return name

@ -265,7 +265,7 @@ TxListItem.prototype.render = function () {
'tx-list-status--dropped': transactionStatus === 'dropped', 'tx-list-status--dropped': transactionStatus === 'dropped',
}), }),
}, },
transactionStatus, this.txStatusIndicator(),
), ),
]), ]),
]), ]),
@ -300,3 +300,28 @@ TxListItem.prototype.render = function () {
]), // holding on icon from design ]), // holding on icon from design
]) ])
} }
TxListItem.prototype.txStatusIndicator = function () {
const { transactionStatus } = this.props
let name
if (transactionStatus === 'unapproved') {
name = t('unapproved')
} else if (transactionStatus === 'rejected') {
name = t('rejected')
} else if (transactionStatus === 'approved') {
name = t('approved')
} else if (transactionStatus === 'signed') {
name = t('signed')
} else if (transactionStatus === 'submitted') {
name = t('submitted')
} else if (transactionStatus === 'confirmed') {
name = t('confirmed')
} else if (transactionStatus === 'failed') {
name = t('failed')
} else if (transactionStatus === 'dropped') {
name = t('dropped')
}
return name
}

@ -40,7 +40,7 @@ TxList.prototype.render = function () {
return h('div.flex-column', [ return h('div.flex-column', [
h('div.flex-row.tx-list-header-wrapper', [ h('div.flex-row.tx-list-header-wrapper', [
h('div.flex-row.tx-list-header', [ h('div.flex-row.tx-list-header', [
h('div', 'transactions'), h('div', t('transactions')),
]), ]),
]), ]),
h('div.flex-column.tx-list-container', {}, [ h('div.flex-column.tx-list-container', {}, [

@ -4,6 +4,7 @@ const Component = require('react').Component
const connect = require('react-redux').connect const connect = require('react-redux').connect
const h = require('react-hyperscript') const h = require('react-hyperscript')
const actions = require('../../../actions') const actions = require('../../../actions')
const t = require('../../../../i18n')
module.exports = connect(mapStateToProps)(RevealSeedConfirmation) module.exports = connect(mapStateToProps)(RevealSeedConfirmation)
@ -49,13 +50,13 @@ RevealSeedConfirmation.prototype.render = function () {
}, },
}, [ }, [
h('h4', 'Do not recover your seed words in a public place! These words can be used to steal all your accounts.'), h('h4', t('revealSeedWordsWarning')),
// confirmation // confirmation
h('input.large-input.letter-spacey', { h('input.large-input.letter-spacey', {
type: 'password', type: 'password',
id: 'password-box', id: 'password-box',
placeholder: 'Enter your password to confirm', placeholder: t('enterPasswordConfirm'),
onKeyPress: this.checkConfirmation.bind(this), onKeyPress: this.checkConfirmation.bind(this),
style: { style: {
width: 260, width: 260,
@ -91,7 +92,7 @@ RevealSeedConfirmation.prototype.render = function () {
), ),
props.inProgress && ( props.inProgress && (
h('span.in-progress-notification', 'Generating Seed...') h('span.in-progress-notification', t('generatingSeed'))
), ),
]), ]),
]) ])

@ -2,6 +2,7 @@ const inherits = require('util').inherits
const PersistentForm = require('../../../lib/persistent-form') const PersistentForm = require('../../../lib/persistent-form')
const connect = require('react-redux').connect const connect = require('react-redux').connect
const h = require('react-hyperscript') const h = require('react-hyperscript')
const t = require('../../../i18n')
const actions = require('../../actions') const actions = require('../../actions')
module.exports = connect(mapStateToProps)(RestoreVaultScreen) module.exports = connect(mapStateToProps)(RestoreVaultScreen)
@ -36,23 +37,23 @@ RestoreVaultScreen.prototype.render = function () {
padding: 6, padding: 6,
}, },
}, [ }, [
'Restore Vault', t('restoreVault'),
]), ]),
// wallet seed entry // wallet seed entry
h('h3', 'Wallet Seed'), h('h3', t('walletSeed')),
h('textarea.twelve-word-phrase.letter-spacey', { h('textarea.twelve-word-phrase.letter-spacey', {
dataset: { dataset: {
persistentFormId: 'wallet-seed', persistentFormId: 'wallet-seed',
}, },
placeholder: 'Enter your secret twelve word phrase here to restore your vault.', placeholder: t('secretPhrase'),
}), }),
// password // password
h('input.large-input.letter-spacey', { h('input.large-input.letter-spacey', {
type: 'password', type: 'password',
id: 'password-box', id: 'password-box',
placeholder: 'New Password (min 8 chars)', placeholder: t('newPassword8Chars'),
dataset: { dataset: {
persistentFormId: 'password', persistentFormId: 'password',
}, },
@ -66,7 +67,7 @@ RestoreVaultScreen.prototype.render = function () {
h('input.large-input.letter-spacey', { h('input.large-input.letter-spacey', {
type: 'password', type: 'password',
id: 'password-box-confirm', id: 'password-box-confirm',
placeholder: 'Confirm Password', placeholder: t('confirmPassword'),
onKeyPress: this.createOnEnter.bind(this), onKeyPress: this.createOnEnter.bind(this),
dataset: { dataset: {
persistentFormId: 'password-confirmation', persistentFormId: 'password-confirmation',
@ -93,16 +94,20 @@ RestoreVaultScreen.prototype.render = function () {
// cancel // cancel
h('button.primary', { h('button.primary', {
onClick: this.showInitializeMenu.bind(this), onClick: this.showInitializeMenu.bind(this),
}, 'CANCEL'), style: {
textTransform: 'uppercase',
},
}, t('cancel')),
// submit // submit
h('button.primary', { h('button.primary', {
onClick: this.createNewVaultAndRestore.bind(this), onClick: this.createNewVaultAndRestore.bind(this),
}, 'OK'), style: {
textTransform: 'uppercase',
},
}, t('ok')),
]), ]),
]) ])
) )
} }
@ -131,13 +136,13 @@ RestoreVaultScreen.prototype.createNewVaultAndRestore = function () {
var passwordConfirmBox = document.getElementById('password-box-confirm') var passwordConfirmBox = document.getElementById('password-box-confirm')
var passwordConfirm = passwordConfirmBox.value var passwordConfirm = passwordConfirmBox.value
if (password.length < 8) { if (password.length < 8) {
this.warning = 'Password not long enough' this.warning = t('passwordNotLongEnough')
this.props.dispatch(actions.displayWarning(this.warning)) this.props.dispatch(actions.displayWarning(this.warning))
return return
} }
if (password !== passwordConfirm) { if (password !== passwordConfirm) {
this.warning = 'Passwords don\'t match' this.warning = t('passwordsDontMatch')
this.props.dispatch(actions.displayWarning(this.warning)) this.props.dispatch(actions.displayWarning(this.warning))
return return
} }
@ -147,18 +152,18 @@ RestoreVaultScreen.prototype.createNewVaultAndRestore = function () {
// true if the string has more than a space between words. // true if the string has more than a space between words.
if (seed.split(' ').length > 1) { if (seed.split(' ').length > 1) {
this.warning = 'there can only be a space between words' this.warning = t('spaceBetween')
this.props.dispatch(actions.displayWarning(this.warning)) this.props.dispatch(actions.displayWarning(this.warning))
return return
} }
// true if seed contains a character that is not between a-z or a space // true if seed contains a character that is not between a-z or a space
if (!seed.match(/^[a-z ]+$/)) { if (!seed.match(/^[a-z ]+$/)) {
this.warning = 'seed words only have lowercase characters' this.warning = t('loweCaseWords')
this.props.dispatch(actions.displayWarning(this.warning)) this.props.dispatch(actions.displayWarning(this.warning))
return return
} }
if (seed.split(' ').length !== 12) { if (seed.split(' ').length !== 12) {
this.warning = 'seed phrases are 12 words long' this.warning = t('seedPhraseReq')
this.props.dispatch(actions.displayWarning(this.warning)) this.props.dispatch(actions.displayWarning(this.warning))
return return
} }

@ -1,6 +1,7 @@
const { inherits } = require('util') const { inherits } = require('util')
const PersistentForm = require('../lib/persistent-form') const PersistentForm = require('../lib/persistent-form')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const t = require('../i18n')
const ethAbi = require('ethereumjs-abi') const ethAbi = require('ethereumjs-abi')
const ethUtil = require('ethereumjs-util') const ethUtil = require('ethereumjs-util')
@ -185,13 +186,12 @@ SendTransactionScreen.prototype.componentDidUpdate = function (prevProps) {
SendTransactionScreen.prototype.renderHeader = function () { SendTransactionScreen.prototype.renderHeader = function () {
const { selectedToken, clearSend, goHome } = this.props const { selectedToken, clearSend, goHome } = this.props
const tokenText = selectedToken ? 'tokens' : 'ETH'
return h('div.page-container__header', [ return h('div.page-container__header', [
h('div.page-container__title', selectedToken ? 'Send Tokens' : 'Send ETH'), h('div.page-container__title', selectedToken ? t('sendTokens') : t('sendETH')),
h('div.page-container__subtitle', `Only send ${tokenText} to an Ethereum address.`), h('div.page-container__subtitle', t('onlySendToEtherAddress')),
h('div.page-container__header-close', { h('div.page-container__header-close', {
onClick: () => { onClick: () => {
@ -262,11 +262,11 @@ SendTransactionScreen.prototype.handleToChange = function (to) {
let toError = null let toError = null
if (!to) { if (!to) {
toError = 'Required' toError = t('required')
} else if (!isValidAddress(to)) { } else if (!isValidAddress(to)) {
toError = 'Recipient address is invalid' toError = t('invalidAddressRecipient')
} else if (to === from) { } else if (to === from) {
toError = 'From and To address cannot be the same' toError = t('fromToSame')
} }
updateSendTo(to) updateSendTo(to)
@ -282,9 +282,9 @@ SendTransactionScreen.prototype.renderToRow = function () {
h('div.send-v2__form-label', [ h('div.send-v2__form-label', [
'To:', t('to'),
this.renderErrorMessage('to'), this.renderErrorMessage(t('to')),
]), ]),
@ -382,11 +382,11 @@ SendTransactionScreen.prototype.validateAmount = function (value) {
) )
if (conversionRate && !sufficientBalance) { if (conversionRate && !sufficientBalance) {
amountError = 'Insufficient funds.' amountError = t('insufficientFunds')
} else if (verifyTokenBalance && !sufficientTokens) { } else if (verifyTokenBalance && !sufficientTokens) {
amountError = 'Insufficient tokens.' amountError = t('insufficientTokens')
} else if (amountLessThanZero) { } else if (amountLessThanZero) {
amountError = 'Can not send negative amounts of ETH.' amountError = t('negativeETH')
} }
updateSendErrors({ amount: amountError }) updateSendErrors({ amount: amountError })
@ -416,7 +416,7 @@ SendTransactionScreen.prototype.renderAmountRow = function () {
setMaxModeTo(true) setMaxModeTo(true)
this.setAmountToMax() this.setAmountToMax()
}, },
}, [ !maxModeOn ? 'Max' : '' ]), }, [ !maxModeOn ? t('max') : '' ]),
]), ]),
h('div.send-v2__form-field', [ h('div.send-v2__form-field', [
@ -445,7 +445,7 @@ SendTransactionScreen.prototype.renderGasRow = function () {
return h('div.send-v2__form-row', [ return h('div.send-v2__form-row', [
h('div.send-v2__form-label', 'Gas fee:'), h('div.send-v2__form-label', h('gasFee')),
h('div.send-v2__form-field', [ h('div.send-v2__form-field', [
@ -514,11 +514,11 @@ SendTransactionScreen.prototype.renderFooter = function () {
clearSend() clearSend()
goHome() goHome()
}, },
}, 'Cancel'), }, t('cancel')),
h('button.btn-clear.page-container__footer-button', { h('button.btn-clear.page-container__footer-button', {
disabled: !noErrors || !gasTotal || missingTokenBalance, disabled: !noErrors || !gasTotal || missingTokenBalance,
onClick: event => this.onSubmit(event), onClick: event => this.onSubmit(event),
}, 'Next'), }, t('next')),
]) ])
} }

@ -10,6 +10,7 @@ const TabBar = require('./components/tab-bar')
const SimpleDropdown = require('./components/dropdowns/simple-dropdown') const SimpleDropdown = require('./components/dropdowns/simple-dropdown')
const ToggleButton = require('react-toggle-button') const ToggleButton = require('react-toggle-button')
const { OLD_UI_NETWORK_TYPE } = require('../../app/scripts/config').enums const { OLD_UI_NETWORK_TYPE } = require('../../app/scripts/config').enums
const t = require('../i18n')
const getInfuraCurrencyOptions = () => { const getInfuraCurrencyOptions = () => {
const sortedCurrencies = infuraCurrencies.objects.sort((a, b) => { const sortedCurrencies = infuraCurrencies.objects.sort((a, b) => {
@ -44,8 +45,8 @@ class Settings extends Component {
return h('div.settings__tabs', [ return h('div.settings__tabs', [
h(TabBar, { h(TabBar, {
tabs: [ tabs: [
{ content: 'Settings', key: 'settings' }, { content: t('settings'), key: 'settings' },
{ content: 'Info', key: 'info' }, { content: t('info'), key: 'info' },
], ],
defaultTab: activeTab, defaultTab: activeTab,
tabSelected: key => this.setState({ activeTab: key }), tabSelected: key => this.setState({ activeTab: key }),
@ -58,7 +59,7 @@ class Settings extends Component {
return h('div.settings__content-row', [ return h('div.settings__content-row', [
h('div.settings__content-item', [ h('div.settings__content-item', [
h('span', 'Use Blockies Identicon'), h('span', t('blockiesIdenticon')),
]), ]),
h('div.settings__content-item', [ h('div.settings__content-item', [
h('div.settings__content-item-col', [ h('div.settings__content-item-col', [
@ -78,13 +79,13 @@ class Settings extends Component {
return h('div.settings__content-row', [ return h('div.settings__content-row', [
h('div.settings__content-item', [ h('div.settings__content-item', [
h('span', 'Current Conversion'), h('span', t('currentConversion')),
h('span.settings__content-description', `Updated ${Date(conversionDate)}`), h('span.settings__content-description', `Updated ${Date(conversionDate)}`),
]), ]),
h('div.settings__content-item', [ h('div.settings__content-item', [
h('div.settings__content-item-col', [ h('div.settings__content-item-col', [
h(SimpleDropdown, { h(SimpleDropdown, {
placeholder: 'Select Currency', placeholder: t('selectCurrency'),
options: getInfuraCurrencyOptions(), options: getInfuraCurrencyOptions(),
selectedOption: currentCurrency, selectedOption: currentCurrency,
onSelect: newCurrency => setCurrentCurrency(newCurrency), onSelect: newCurrency => setCurrentCurrency(newCurrency),
@ -101,31 +102,31 @@ class Settings extends Component {
switch (provider.type) { switch (provider.type) {
case 'mainnet': case 'mainnet':
title = 'Current Network' title = t('currentNetwork')
value = 'Main Ethereum Network' value = t('mainnet')
color = '#038789' color = '#038789'
break break
case 'ropsten': case 'ropsten':
title = 'Current Network' title = t('currentNetwork')
value = 'Ropsten Test Network' value = t('ropsten')
color = '#e91550' color = '#e91550'
break break
case 'kovan': case 'kovan':
title = 'Current Network' title = t('currentNetwork')
value = 'Kovan Test Network' value = t('kovan')
color = '#690496' color = '#690496'
break break
case 'rinkeby': case 'rinkeby':
title = 'Current Network' title = t('currentNetwork')
value = 'Rinkeby Test Network' value = t('rinkeby')
color = '#ebb33f' color = '#ebb33f'
break break
default: default:
title = 'Current RPC' title = t('currentRpc')
value = provider.rpcTarget value = provider.rpcTarget
} }
@ -146,12 +147,12 @@ class Settings extends Component {
return ( return (
h('div.settings__content-row', [ h('div.settings__content-row', [
h('div.settings__content-item', [ h('div.settings__content-item', [
h('span', 'New RPC URL'), h('span', t('newRPC')),
]), ]),
h('div.settings__content-item', [ h('div.settings__content-item', [
h('div.settings__content-item-col', [ h('div.settings__content-item-col', [
h('input.settings__input', { h('input.settings__input', {
placeholder: 'New RPC URL', placeholder: t('newRPC'),
onChange: event => this.setState({ newRpc: event.target.value }), onChange: event => this.setState({ newRpc: event.target.value }),
onKeyPress: event => { onKeyPress: event => {
if (event.key === 'Enter') { if (event.key === 'Enter') {
@ -164,7 +165,7 @@ class Settings extends Component {
event.preventDefault() event.preventDefault()
this.validateRpc(this.state.newRpc) this.validateRpc(this.state.newRpc)
}, },
}, 'Save'), }, t('save')),
]), ]),
]), ]),
]) ])
@ -180,9 +181,9 @@ class Settings extends Component {
const appendedRpc = `http://${newRpc}` const appendedRpc = `http://${newRpc}`
if (validUrl.isWebUri(appendedRpc)) { if (validUrl.isWebUri(appendedRpc)) {
displayWarning('URIs require the appropriate HTTP/HTTPS prefix.') displayWarning(t('uriErrorMsg'))
} else { } else {
displayWarning('Invalid RPC URI') displayWarning(t('invalidRPC'))
} }
} }
} }
@ -191,10 +192,10 @@ class Settings extends Component {
return ( return (
h('div.settings__content-row', [ h('div.settings__content-row', [
h('div.settings__content-item', [ h('div.settings__content-item', [
h('div', 'State Logs'), h('div', t('stateLogs')),
h( h(
'div.settings__content-description', 'div.settings__content-description',
'State logs contain your public account addresses and sent transactions.' t('stateLogsDescription')
), ),
]), ]),
h('div.settings__content-item', [ h('div.settings__content-item', [
@ -203,13 +204,13 @@ class Settings extends Component {
onClick (event) { onClick (event) {
window.logStateString((err, result) => { window.logStateString((err, result) => {
if (err) { if (err) {
this.state.dispatch(actions.displayWarning('Error in retrieving state logs.')) this.state.dispatch(actions.displayWarning(t('stateLogError')))
} else { } else {
exportAsFile('MetaMask State Logs.json', result) exportAsFile('MetaMask State Logs.json', result)
} }
}) })
}, },
}, 'Download State Logs'), }, t('downloadStateLogs')),
]), ]),
]), ]),
]) ])
@ -221,7 +222,7 @@ class Settings extends Component {
return ( return (
h('div.settings__content-row', [ h('div.settings__content-row', [
h('div.settings__content-item', 'Reveal Seed Words'), h('div.settings__content-item', t('revealSeedWords')),
h('div.settings__content-item', [ h('div.settings__content-item', [
h('div.settings__content-item-col', [ h('div.settings__content-item-col', [
h('button.settings__clear-button.settings__clear-button--red', { h('button.settings__clear-button.settings__clear-button--red', {
@ -229,7 +230,7 @@ class Settings extends Component {
event.preventDefault() event.preventDefault()
revealSeedConfirmation() revealSeedConfirmation()
}, },
}, 'Reveal Seed Words'), }, t('revealSeedWords')),
]), ]),
]), ]),
]) ])
@ -241,7 +242,7 @@ class Settings extends Component {
return ( return (
h('div.settings__content-row', [ h('div.settings__content-row', [
h('div.settings__content-item', 'Use old UI'), h('div.settings__content-item', t('useOldUI')),
h('div.settings__content-item', [ h('div.settings__content-item', [
h('div.settings__content-item-col', [ h('div.settings__content-item-col', [
h('button.settings__clear-button.settings__clear-button--orange', { h('button.settings__clear-button.settings__clear-button--orange', {
@ -249,7 +250,7 @@ class Settings extends Component {
event.preventDefault() event.preventDefault()
setFeatureFlagToBeta() setFeatureFlagToBeta()
}, },
}, 'Use old UI'), }, t('useOldUI')),
]), ]),
]), ]),
]) ])
@ -260,7 +261,7 @@ class Settings extends Component {
const { showResetAccountConfirmationModal } = this.props const { showResetAccountConfirmationModal } = this.props
return h('div.settings__content-row', [ return h('div.settings__content-row', [
h('div.settings__content-item', 'Reset Account'), h('div.settings__content-item', t('resetAccount')),
h('div.settings__content-item', [ h('div.settings__content-item', [
h('div.settings__content-item-col', [ h('div.settings__content-item-col', [
h('button.settings__clear-button.settings__clear-button--orange', { h('button.settings__clear-button.settings__clear-button--orange', {
@ -268,7 +269,7 @@ class Settings extends Component {
event.preventDefault() event.preventDefault()
showResetAccountConfirmationModal() showResetAccountConfirmationModal()
}, },
}, 'Reset Account'), }, t('resetAccount')),
]), ]),
]), ]),
]) ])
@ -303,13 +304,13 @@ class Settings extends Component {
renderInfoLinks () { renderInfoLinks () {
return ( return (
h('div.settings__content-item.settings__content-item--without-height', [ h('div.settings__content-item.settings__content-item--without-height', [
h('div.settings__info-link-header', 'Links'), h('div.settings__info-link-header', t('links')),
h('div.settings__info-link-item', [ h('div.settings__info-link-item', [
h('a', { h('a', {
href: 'https://metamask.io/privacy.html', href: 'https://metamask.io/privacy.html',
target: '_blank', target: '_blank',
}, [ }, [
h('span.settings__info-link', 'Privacy Policy'), h('span.settings__info-link', t('privacyMsg')),
]), ]),
]), ]),
h('div.settings__info-link-item', [ h('div.settings__info-link-item', [
@ -317,7 +318,7 @@ class Settings extends Component {
href: 'https://metamask.io/terms.html', href: 'https://metamask.io/terms.html',
target: '_blank', target: '_blank',
}, [ }, [
h('span.settings__info-link', 'Terms of Use'), h('span.settings__info-link', t('terms')),
]), ]),
]), ]),
h('div.settings__info-link-item', [ h('div.settings__info-link-item', [
@ -325,7 +326,7 @@ class Settings extends Component {
href: 'https://metamask.io/attributions.html', href: 'https://metamask.io/attributions.html',
target: '_blank', target: '_blank',
}, [ }, [
h('span.settings__info-link', 'Attributions'), h('span.settings__info-link', t('attributions')),
]), ]),
]), ]),
h('hr.settings__info-separator'), h('hr.settings__info-separator'),
@ -334,7 +335,7 @@ class Settings extends Component {
href: 'https://support.metamask.io', href: 'https://support.metamask.io',
target: '_blank', target: '_blank',
}, [ }, [
h('span.settings__info-link', 'Visit our Support Center'), h('span.settings__info-link', t('supportCenter')),
]), ]),
]), ]),
h('div.settings__info-link-item', [ h('div.settings__info-link-item', [
@ -342,7 +343,7 @@ class Settings extends Component {
href: 'https://metamask.io/', href: 'https://metamask.io/',
target: '_blank', target: '_blank',
}, [ }, [
h('span.settings__info-link', 'Visit our web site'), h('span.settings__info-link', t('visitWebSite')),
]), ]),
]), ]),
h('div.settings__info-link-item', [ h('div.settings__info-link-item', [
@ -350,7 +351,7 @@ class Settings extends Component {
target: '_blank', target: '_blank',
href: 'mailto:help@metamask.io?subject=Feedback', href: 'mailto:help@metamask.io?subject=Feedback',
}, [ }, [
h('span.settings__info-link', 'Email us!'), h('span.settings__info-link', t('emailUs')),
]), ]),
]), ]),
]) ])
@ -372,7 +373,7 @@ class Settings extends Component {
h('div.settings__info-item', [ h('div.settings__info-item', [
h( h(
'div.settings__info-about', 'div.settings__info-about',
'MetaMask is designed and built in California.' t('builtInCalifornia')
), ),
]), ]),
]), ]),
@ -445,3 +446,4 @@ const mapDispatchToProps = dispatch => {
} }
module.exports = connect(mapStateToProps, mapDispatchToProps)(Settings) module.exports = connect(mapStateToProps, mapDispatchToProps)(Settings)

@ -67,7 +67,7 @@ UnlockScreen.prototype.render = function () {
style: { style: {
margin: 10, margin: 10,
}, },
}, 'Log In'), }, t('login')),
h('p.pointer', { h('p.pointer', {
onClick: () => { onClick: () => {
@ -81,7 +81,7 @@ UnlockScreen.prototype.render = function () {
color: 'rgb(247, 134, 28)', color: 'rgb(247, 134, 28)',
textDecoration: 'underline', textDecoration: 'underline',
}, },
}, 'Restore from seed phrase'), }, t('restoreFromSeed')),
h('p.pointer', { h('p.pointer', {
onClick: () => { onClick: () => {
@ -94,7 +94,7 @@ UnlockScreen.prototype.render = function () {
textDecoration: 'underline', textDecoration: 'underline',
marginTop: '32px', marginTop: '32px',
}, },
}, 'Use classic interface'), }, t('classicInterface')),
]) ])
) )
} }

Loading…
Cancel
Save