1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-22 17:33:23 +01:00

complete i18n across new UI

This commit is contained in:
Nick Doiron 2018-01-29 15:29:01 -05:00
parent 1698541bcd
commit abfa74f09a
34 changed files with 221 additions and 166 deletions

View File

@ -3,9 +3,9 @@
"message": "Accept"
},
"account": {
"message": "Account:"
"message": "Account"
},
"accDetails": {
"accountDetails": {
"message": "Account Details"
},
"accountName": {
@ -17,11 +17,14 @@
"addToken": {
"message": "Add Token"
},
"amount": {
"message": "Amount"
},
"amountPlusGas": {
"message": "Amount + Gas"
},
"appDescription": {
"message": "Ethereum Identity Management",
"message": "Ethereum Browser Extension",
"description": "The description of the application"
},
"appName": {
@ -43,10 +46,14 @@
"balanceIsInsufficientGas": {
"message": "Insufficient balance for current gas total"
},
"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)"
},
"buyButton": {
"buy": {
"message": "Buy"
},
"buyCoinbase": {
@ -58,26 +65,20 @@
"cancel": {
"message": "Cancel"
},
"cancelCaps": {
"message": "CANCEL"
},
"clickCopy": {
"message": "Click to Copy"
},
"confirm": {
"message": "Confirm"
},
"confirmCaps": {
"message": "CONFIRM"
},
"confirmContract": {
"message": "Confirm Contract"
},
"confirmPassword": {
"message": "Confirm Password"
},
"confirmPasswordSmall": {
"message": "confirm password"
"confirmTransaction": {
"message": "Confirm Transaction"
},
"continueToCoinbase": {
"message": "Continue to Coinbase"
@ -109,15 +110,19 @@
"copyPrivateKey": {
"message": "This is your private key (click to copy)"
},
"create": {
"message": "Create"
},
"createAccount": {
"message": "Create Account"
},
"createCaps": {
"message": "CREATE"
},
"createDen": {
"message": "Create"
},
"crypto": {
"message": "Crypto",
"description": "Exchange type (cryptocurrencies)"
},
"customGas": {
"message": "Customize Gas"
},
@ -139,9 +144,6 @@
"depositBTC": {
"message": "Deposit your BTC to the address below:"
},
"depositButton": {
"message": "DEPOSIT"
},
"depositEth": {
"message": "Deposit Eth"
},
@ -160,8 +162,8 @@
"depositShapeShiftExplainer": {
"message": "If you own other cryptocurrencies, you can trade and deposit Ether directly into your MetaMask wallet. No Account Needed."
},
"detailsCaps": {
"message": "DETAILS"
"details": {
"message": "Details"
},
"directDeposit": {
"message": "Direct Deposit"
@ -175,12 +177,12 @@
"done": {
"message": "Done"
},
"edit": {
"message": "Edit"
},
"editAccountName": {
"message": "Edit Account Name"
},
"editCaps": {
"message": "EDIT"
},
"encryptNewDen": {
"message": "Encrypt your new DEN"
},
@ -196,17 +198,19 @@
"exportPrivateKey": {
"message": "Export Private Key"
},
"exportPrivateKeyLower": {
"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!"
"message": "File import not working? Click here!",
"description": "Helps user import their account from a JSON file"
},
"from": {
"message": "From"
@ -214,12 +218,13 @@
"fromShapeShift": {
"message": "From ShapeShift"
},
"gas": {
"message": "Gas",
"description": "Short indication of gas cost"
},
"gasFee": {
"message": "Gas Fee"
},
"gasFeeSpecific": {
"message": "Gas fee:"
},
"gasLimit": {
"message": "Gas Limit"
},
@ -244,11 +249,20 @@
"getEther": {
"message": "Get Ether"
},
"here": {
"message": "here"
"getEtherFromFaucet": {
"message": "Get Ether from a faucet for the $1",
"description": "Displays network name for Ether faucet"
},
"hideCaps": {
"message": "HIDE"
"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"
@ -260,7 +274,8 @@
"message": "How would you like to deposit Ether?"
},
"import": {
"message": "Import"
"message": "Import",
"description": "Button to import an account from a selected file"
},
"importAccount": {
"message": "Import Account"
@ -268,14 +283,12 @@
"importAnAccount": {
"message": "Import an account"
},
"importCaps": {
"message": "IMPORT"
},
"importDen": {
"message": "Import Existing DEN"
},
"importedCaps": {
"message": "IMPORTED"
"imported": {
"message": "Imported",
"description": "status showing that an account has been fully loaded into the keyring"
},
"infoHelp": {
"message": "Info & Help"
@ -292,9 +305,17 @@
"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"
},
@ -310,8 +331,8 @@
"logout": {
"message": "Log out"
},
"looseCaps": {
"message": "LOOSE"
"loose": {
"message": "Loose"
},
"mainnet": {
"message": "Main Ethereum Network"
@ -319,9 +340,6 @@
"message": {
"message": "Message"
},
"messageCaps": {
"message": "MESSAGE"
},
"min": {
"message": "Minimum"
},
@ -332,10 +350,12 @@
"message": "To interact with decentralized applications using MetaMask, youll need Ether in your wallet."
},
"needImportFile": {
"message": "You must select a file to import."
"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."
"message": "You must enter a password for the selected file.",
"description": "Password and file needed to import an account"
},
"networks": {
"message": "Networks"
@ -377,20 +397,28 @@
"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"
"message": "or",
"description": "choice between creating or importing a new account"
},
"passwordMismatch": {
"message": "passwords don't match"
"message": "passwords don't match",
"description": "in password creation process, the two new password fields did not match"
},
"passwordShort": {
"message": "password not long enough"
"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:"
"message": "Paste your private key string here:",
"description": "For importing an account from a private key"
},
"pasteSeed": {
"message": "Paste your seed phrase here!"
},
"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."
},
@ -434,16 +462,21 @@
"message": "Ropsten Test Network"
},
"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"
},
"saveCaps": {
"message": "SAVE"
"save": {
"message": "Save"
},
"saveAsFile": {
"message": "Save as File",
"description": "Account export process"
},
"selectService": {
"message": "Select Service"
},
"sendButton": {
"message": "SEND"
"send": {
"message": "Send"
},
"sendTokens": {
"message": "Send Tokens"
@ -460,12 +493,12 @@
"showPrivateKeys": {
"message": "Show Private Keys"
},
"showQRCode": {
"message": "Show QR Code"
},
"sign": {
"message": "Sign"
},
"signCaps": {
"message": "SIGN"
},
"signMessage": {
"message": "Sign Message"
},
@ -490,12 +523,13 @@
"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:"
},
"toSpecific": {
"message": "To:"
},
"total": {
"message": "Total"
},
@ -509,7 +543,8 @@
"message": "Transfers"
},
"troubleTokenBalances": {
"message": "We had trouble loading your token balances. You can view them "
"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"
@ -532,6 +567,10 @@
"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"
},
@ -548,9 +587,6 @@
"message": "Your signature is being requested"
},
"youSign": {
"message": "You are signing:"
},
"youSignCaps": {
"message": "YOU ARE SIGNING"
"message": "You are signing"
}
}

View File

@ -1,10 +1,10 @@
{
"name": "MetaMask",
"short_name": "Metamask",
"name": "__MSG_appName__",
"short_name": "__MSG_appName__",
"version": "4.0.10",
"manifest_version": 2,
"author": "https://metamask.io",
"description": "Ethereum Browser Extension",
"description": "__MSG_appDescription__",
"commands": {
"_execute_browser_action": {
"suggested_key": {

View File

@ -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)
@ -70,9 +71,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)

View File

@ -50,16 +50,16 @@ JsonImportSubview.prototype.render = function () {
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(),
}, [
t('cancelCaps'),
t('cancel'),
]),
h('button.new-account-create-form__button-create', {
h('button.new-account-create-form__button-create.allcaps', {
onClick: () => this.createNewKeychain.bind(this),
}, [
t('importCaps'),
t('import'),
]),
]),

View File

@ -43,16 +43,16 @@ PrivateKeyImportView.prototype.render = function () {
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: () => goHome(),
}, [
t('cancelCaps'),
t('cancel'),
]),
h('button.new-account-create-form__button-create', {
h('button.new-account-create-form__button-create.allcaps', {
onClick: () => this.createNewKeychain(),
}, [
t('importCaps'),
t('import'),
]),
]),

View File

@ -35,16 +35,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(),
}, [
t('cancelCaps'),
t('cancel'),
]),
h('button.new-account-create-form__button-create', {
h('button.new-account-create-form__button-create.allcaps', {
onClick: () => this.props.createAccount(newAccountName),
}, [
t('createCaps'),
t('create'),
]),
]),

View File

@ -80,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', t('looseCaps')) : null
return isLoose ? h('.keyring-label.allcaps', t('loose')) : null
} catch (e) { return }
}
@ -155,7 +155,7 @@ class AccountDropdowns extends Component {
fontSize: '24px',
marginBottom: '5px',
},
}, 'Import Account'),
}, t('importAccount')),
]
),
]
@ -205,7 +205,7 @@ class AccountDropdowns extends Component {
actions.showQrView(selected, identity ? identity.name : '')
},
},
t('qrCode'),
t('showQRCode'),
),
h(
DropdownMenuItem,

View File

@ -54,7 +54,7 @@ ExportAccountView.prototype.render = function () {
h('p.error', warning),
h('input#exportAccount.sizing-input', {
type: 'password',
placeholder: t('confirmPasswordSmall'),
placeholder: t('confirmPassword').toLowerCase(),
onKeyPress: this.onExportKeyPress.bind(this),
style: {
position: 'relative',
@ -99,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',
@ -113,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')),
])
}
}

View File

@ -156,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', t('importedCaps')) : null
return isLoose ? h('.keyring-label.allcaps', t('imported')) : null
} catch (e) { return }
}

View File

@ -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

View File

@ -144,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: {
@ -204,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),
}),

View File

@ -283,13 +283,13 @@ CustomizeGasModal.prototype.render = function () {
}, [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,
}, [t('cancelCaps')]),
}, [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),
}, [t('saveCaps')]),
}, [t('save')]),
]),
]),

View File

@ -122,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',
},
@ -130,7 +130,7 @@ class AccountDropdowns extends Component {
actions.showEditAccountModal(identity)
},
}, [
t('editCaps'),
t('edit'),
]),
]),
@ -160,7 +160,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', t('looseCaps')) : null
return isLoose ? h('.keyring-label.allcaps', t('loose')) : null
} catch (e) { return }
}
@ -303,7 +303,7 @@ class AccountDropdowns extends Component {
menuItemStyles,
),
},
t('accDetails'),
t('accountDetails'),
),
h(
DropdownMenuItem,

View File

@ -127,11 +127,11 @@ 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 += t('invalidInput')
}

View File

@ -70,7 +70,7 @@ AccountDetailsModal.prototype.render = function () {
// Holding on redesign for Export Private Key functionality
h('button.btn-clear.account-modal__button', {
onClick: () => showExportPrivateKeyModal(),
}, t('exportPrivateKeyLower')),
}, t('exportPrivateKey')),
])
}

View File

@ -14,7 +14,9 @@ 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 => `Get Ether from a faucet for the ${networkName}`
const facuetRowText = (networkName) => {
return t('getEtherFromFaucet', [networkName])
}
function mapStateToProps (state) {
return {

View File

@ -61,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)
@ -70,7 +70,7 @@ EditAccountNameModal.prototype.render = function () {
},
disabled: this.state.inputText.length === 0,
}, [
t('saveCaps'),
t('save'),
]),
]),

View File

@ -59,15 +59,15 @@ HideTokenConfirmationModal.prototype.render = function () {
]),
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(),
}, [
t('cancelCaps'),
t('cancel'),
]),
h('button.btn-clear.hide-token-confirmation__button', {
h('button.btn-clear.hide-token-confirmation__button.allcaps', {
onClick: () => hideToken(address),
}, [
t('hideCaps'),
t('hide'),
]),
]),
]),

View File

@ -12,7 +12,7 @@ class NewAccountModal extends Component {
const newAccountNumber = numberOfExistingAccounts + 1
this.state = {
newAccountName: `Account ${newAccountNumber}`,
newAccountName: `${t('account')} ${newAccountNumber}`,
}
}
@ -53,11 +53,11 @@ class NewAccountModal extends Component {
},
}, 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),
}, [
t('saveCaps'),
t('save'),
]),
]),
]),

View File

@ -40,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', t('messageCaps')),
h('label.font-small.allcaps', t('message')),
h('span.font-small', msgParams.data),
]),
]),

View File

@ -46,7 +46,7 @@ PendingMsgDetails.prototype.render = function () {
height: '260px',
},
}, [
h('label.font-small', { style: { display: 'block' } }, t('messageCaps')),
h('label.font-small.allcaps', { style: { display: 'block' } }, t('message')),
h(BinaryRenderer, {
value: data,
style: {

View File

@ -56,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 })
}
}
@ -272,9 +272,9 @@ 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'),
}, t('back')),
h('div.confirm-screen-title', t('confirmContract')),
h('div.confirm-screen-header-tip'),
]),
@ -336,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),
}, t('cancelCaps')),
}, t('cancel')),
// Accept Button
h('button.confirm-screen-confirm-button', [t('confirmCaps')]),
h('button.confirm-screen-confirm-button.allcaps', [t('confirm')]),
]),
])

View File

@ -392,15 +392,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)
},
}, t('cancelCaps')),
}, t('cancel')),
// Accept Button
h('button.confirm-screen-confirm-button', [t('confirmCaps')]),
h('button.confirm-screen-confirm-button.allcaps', [t('confirm')]),
]),
])
)

View File

@ -286,7 +286,7 @@ ConfirmSendToken.prototype.renderTotalPlusGas = function () {
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')}`),
]),
])
)
@ -315,10 +315,10 @@ ConfirmSendToken.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.btn-clear.confirm-screen-back-button', {
h('button.btn-clear.confirm-screen-back-button.allcaps', {
onClick: () => editTransaction(txMeta),
}, t('editCaps')),
h('div.confirm-screen-title', 'Confirm Transaction'),
}, t('edit')),
h('div.confirm-screen-title', t('confirmTransaction')),
h('div.confirm-screen-header-tip'),
]),
h('div.flex-row.flex-center.confirm-screen-identicons', [
@ -386,12 +386,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),
}, t('cancelCaps')),
}, t('cancel')),
// Accept Button
h('button.confirm-screen-confirm-button', [t('confirmCaps')]),
h('button.confirm-screen-confirm-button.allcaps', [t('confirm')]),
]),

View File

@ -46,7 +46,7 @@ PendingMsgDetails.prototype.render = function () {
height: '260px',
},
}, [
h('label.font-small', { style: { display: 'block' } }, t('youSignCaps')),
h('label.font-small.allcaps', { style: { display: 'block' } }, t('youSign')),
h(TypedMessageRenderer, {
value: data,
style: {

View File

@ -34,12 +34,12 @@ PendingMsg.prototype.render = function () {
// sign + cancel
h('.flex-row.flex-space-around', [
h('button', {
h('button.allcaps', {
onClick: state.cancelTypedMessage,
}, t('cancelCaps')),
h('button', {
}, t('cancel')),
h('button.allcaps', {
onClick: state.signTypedMessage,
}, t('signCaps')),
}, t('sign')),
]),
])

View File

@ -234,7 +234,7 @@ SendTokenScreen.prototype.renderToAddressInput = function () {
'send-screen-input-wrapper--error': errorMessage,
}),
}, [
h('div', [t('toSpecific')]),
h('div', [t('to') + ':']),
h('input.large-input.send-screen-input', {
name: 'address',
list: 'addresses',
@ -291,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' ] : [],
@ -356,7 +356,7 @@ SendTokenScreen.prototype.renderGasInput = function () {
}),
h('div.send-screen-gas-labels', {}, [
h('span', [ h('i.fa.fa-bolt'), t('gasFeeSpecific')]),
h('span', [ h('i.fa.fa-bolt'), t('gasFee') + ':']),
h('span', [t('whatsThis')]),
]),
h('div.large-input.send-screen-gas-input', [

View File

@ -237,7 +237,7 @@ ShapeshiftForm.prototype.render = function () {
className: btnClass,
disabled: !token,
onClick: () => this.onBuyWithShapeShift(),
}, [t('buyButton')]),
}, [t('buy')]),
])
}

View File

@ -81,7 +81,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)),
@ -141,7 +141,7 @@ ShiftListItem.prototype.renderInfo = function () {
color: '#ABA9AA',
width: '100%',
},
}, `${props.depositType} to ETH via ShapeShift`),
}, t('toETHviaShapeShift', [props.depositType])),
h('div', t('noDeposits')),
h('div', {
style: {
@ -164,7 +164,7 @@ ShiftListItem.prototype.renderInfo = function () {
color: '#ABA9AA',
width: '100%',
},
}, `${props.depositType} to ETH via ShapeShift`),
}, t('toETHviaShapeShift', [props.depositType])),
h('div', t('conversionProgress')),
h('div', {
style: {

View File

@ -76,7 +76,7 @@ SignatureRequest.prototype.renderAccountDropdown = function () {
return h('div.request-signature__account', [
h('div.request-signature__account-text', [t('account')]),
h('div.request-signature__account-text', [t('account') + ':']),
h(AccountDropdownMini, {
selectedAccount,
@ -155,7 +155,7 @@ SignatureRequest.prototype.msgHexToText = function (hex) {
SignatureRequest.prototype.renderBody = function () {
let rows
let notice = t('youSign')
let notice = t('youSign') + ':'
const { txData } = this.props
const { type, msgParams: { data } } = txData
@ -225,10 +225,10 @@ SignatureRequest.prototype.renderFooter = function () {
return h('div.request-signature__footer', [
h('button.request-signature__footer__cancel-button', {
onClick: cancel,
}, t('cancelCaps')),
}, t('cancel')),
h('button.request-signature__footer__sign-button', {
onClick: sign,
}, t('signCaps')),
}, t('sign')),
])
}

View File

@ -69,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',
}),
}, t('depositButton')),
}, t('deposit')),
h('button.btn-clear.hero-balance-button', {
style: {
marginLeft: '0.8em',
},
onClick: showSendPage,
}, t('sendButton')),
}, t('send')),
])
)
: (
h('div.flex-row.flex-center.hero-balance-buttons', [
h('button.btn-clear.hero-balance-button', {
onClick: showSendTokenPage,
}, t('sendButton')),
}, t('send')),
])
)
}

View File

@ -114,7 +114,7 @@ WalletView.prototype.render = function () {
onClick: hideSidebar,
}),
h('div.wallet-view__keyring-label', isLoose ? t('importedCaps') : ''),
h('div.wallet-view__keyring-label.allcaps', isLoose ? t('imported') : ''),
h('div.flex-column.flex-center.wallet-view__name-container', {
style: { margin: '0 auto' },
@ -131,7 +131,7 @@ WalletView.prototype.render = function () {
selectedIdentity.name,
]),
h('button.btn-clear.wallet-view__details-button', t('detailsCaps')),
h('button.btn-clear.wallet-view__details-button.allcaps', t('details')),
]),
]),

View File

@ -69,3 +69,7 @@ textarea.large-input {
input.large-input {
height: 36px;
}
.allcaps {
text-transform: uppercase;
}

View File

@ -11,9 +11,20 @@ if ((chrome && chrome.i18n && chrome.i18n.getMessage) ||
} else {
// fallback function
console.warn('browser.i18n API not available?')
let msg = require('../app/_locales/en/messages.json')
getMessage = function (key) {
return msg[key].message
const msg = require('../app/_locales/en/messages.json')
getMessage = function (key, substitutions) {
if (!msg[key]) {
console.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
}
}