Skip to content

Commit

Permalink
Fix eth_accounts permission language & selectability (#7614)
Browse files Browse the repository at this point in the history
* fix eth_accounts language & selectability

* fix MetaMask capitalization in all messages
  • Loading branch information
rekmarks authored Dec 2, 2019
1 parent 45e5666 commit 8b6a345
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/_locales/ca/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@
"message": "Conectant-te a Ethereum i la web descentralitzada."
},
"metamaskSeedWords": {
"message": "Frase de recuperació de Metamask"
"message": "Frase de recuperació de MetaMask"
},
"metamaskVersion": {
"message": "Versió MetaMask"
Expand Down
6 changes: 3 additions & 3 deletions app/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@
},
"extensionId": {
"message": "Extension ID: $1",
"description": "$1 is a string of random letters that are the id of another extension connecting to Metamask"
"description": "$1 is a string of random letters that are the id of another extension connecting to MetaMask"
},
"externalExtension": {
"message": "External Extension"
Expand Down Expand Up @@ -764,7 +764,7 @@
"message": "Would you like to add these tokens?"
},
"likeToConnect": {
"message": "$1 would like to connect to your Metamask account",
"message": "$1 would like to connect to your MetaMask account",
"description": "$1 is the name/url of a site/dapp asking to connect to MetaMask"
},
"links": {
Expand Down Expand Up @@ -1368,7 +1368,7 @@
},
"thisWillAllowExternalExtension": {
"message": "This will allow an external extension with id $1 to:",
"description": "$1 is a string of random letters that are the id of another extension connecting to Metamask"
"description": "$1 is a string of random letters that are the id of another extension connecting to MetaMask"
},
"thisWillCreate": {
"message": "This will create a new wallet and seed phrase"
Expand Down
4 changes: 2 additions & 2 deletions app/_locales/et/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@
"message": "Kui teil on küsimusi või näete midagi kahtlast, kirjutage meile support@metamask.io."
},
"endOfFlowMessage8": {
"message": "Metamask ei saa teie seemnefraasi taastada. Lisateave."
"message": "MetaMask ei saa teie seemnefraasi taastada. Lisateave."
},
"endOfFlowMessage9": {
"message": "Lisateave."
Expand Down Expand Up @@ -1162,7 +1162,7 @@
"message": "Saate sünkroonida oma kontod ja teabe oma mobiiliseadmega. Avage MetaMaski mobiilirakendus, avage \"Settings\" (Seaded) ja puudutage valikut \"Sync from Browser Extension\" (Sünkroonimine lehitseja laiendusest)"
},
"syncWithMobileDescNewUsers": {
"message": "Järgige Metamaski mobiilirakenduse esmakordsel avamisel telefonis esitatud samme."
"message": "Järgige MetaMaski mobiilirakenduse esmakordsel avamisel telefonis esitatud samme."
},
"syncWithMobileScanThisCode": {
"message": "Skanneerige see kood MetaMaski mobiilirakendusega"
Expand Down
2 changes: 1 addition & 1 deletion app/_locales/ja/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"message": "推奨トークンを追加"
},
"addAcquiredTokens": {
"message": "Metamaskで獲得したトークンを追加する"
"message": "MetaMaskで獲得したトークンを追加する"
},
"amount": {
"message": "金額"
Expand Down
2 changes: 1 addition & 1 deletion app/_locales/zh_CN/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"message": "添加推荐代币"
},
"addAcquiredTokens": {
"message": "在Metamask上添加已用的代币"
"message": "在MetaMask上添加已用的代币"
},
"amount": {
"message": "数量"
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/controllers/permissions/restrictedMethods.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = function getRestrictedMethods (permissionsController) {
return {

'eth_accounts': {
description: 'View Ethereum accounts',
description: 'View the address of the selected account',
method: (_, res, __, end) => {
permissionsController.keyringController.getAccounts()
.then((accounts) => {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/permissions.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ describe('MetaMask', function () {
await domains[0].click()

const permissionDescription = await findElement(driver, By.css('.connected-sites-list__permission-description'))
assert.equal(await permissionDescription.getText(), 'View Ethereum accounts')
assert.equal(await permissionDescription.getText(), 'View the address of the selected account')
})

it('can get accounts within the dapp', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,17 @@ export default class PermissionPageContainerContent extends PureComponent {
console.warn(`Unknown permission requested: ${methodName}`)
}
const description = permissionsDescriptions[methodName] || methodName
// don't allow deselecting eth_accounts
const isDisabled = methodName === 'eth_accounts'

return (
<div
className="permission-approval-container__content__permission" key={methodName}
onClick={() => onPermissionToggle(methodName)}
onClick={() => {
if (!isDisabled) {
onPermissionToggle(methodName)
}
}}
>
{ selectedPermissions[methodName]
? <i className="fa fa-check-circle fa-sm" />
Expand Down

0 comments on commit 8b6a345

Please sign in to comment.