Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
fix connection upgraded string in total blocked section
Browse files Browse the repository at this point in the history
  • Loading branch information
cezaraugusto committed Feb 20, 2019
1 parent 3790b07 commit c598b03
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default class HTTPSUpgradesControl extends React.PureComponent<Props, Sta
>
<ArrowDownIcon />
<BlockedInfoRowStats>{httpsUpgrades > 99 ? '99+' : httpsUpgrades}</BlockedInfoRowStats>
<BlockedInfoRowText>{getLocale('connectionsUpgradedHTTPS')}</BlockedInfoRowText>
<BlockedInfoRowText>{getLocale('connectionsUpgradedHTTPSCapital')}</BlockedInfoRowText>
</BlockedInfoRowData>
<Toggle
size='small'
Expand All @@ -100,7 +100,7 @@ export default class HTTPSUpgradesControl extends React.PureComponent<Props, Sta
favicon={favicon}
hostname={hostname}
stats={httpsUpgrades}
name={getLocale('connectionsUpgradedHTTPS')}
name={getLocale('connectionsUpgradedHTTPSCapital')}
list={data.blockedFakeResources}
onClose={this.onOpenConnectionsUpgradedToHTTPS}
/>
Expand Down
8 changes: 4 additions & 4 deletions stories/features/shields/components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ export default class Header extends React.PureComponent<Props, {}> {
const blockedItems = adsTrackersBlocked + scriptsBlocked + fingerprintingBlocked

if (blockedItems === 0 && httpsUpgrades === 0) {
return getLocale('itemsBlocked')
return `${getLocale('itemsBlocked')} ${getLocale('and')} ${getLocale('connectionsUpgradedHTTPSLowercase')}`
} else if (blockedItems === 1 && httpsUpgrades === 0) {
return getLocale('itemBlocked')
} else if (blockedItems === 0 && httpsUpgrades === 1) {
return getLocale('connectionUpgraded')
return getLocale('connectionUpgradedHTTPSCapital')
} else if (blockedItems > 1 && httpsUpgrades === 0) {
return getLocale('itemsBlocked')
} else if (blockedItems === 0 && httpsUpgrades > 1) {
return getLocale('connectionsUpgraded')
return getLocale('connectionsUpgradedHTTPSCapital')
} else {
return ` ${getLocale('itemsBlocked')} ${getLocale('and')} ${getLocale('connectionsUpgraded')}`
return `${getLocale('itemsBlocked')} ${getLocale('and')} ${getLocale('connectionsUpgradedHTTPSLowercase')}`
}
}

Expand Down
7 changes: 4 additions & 3 deletions stories/features/shields/fakeLocale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ const locale: { [key: string]: string } = {
itemsBlocked: 'Items blocked',
itemBlocked: 'Item blocked',
and: 'and',
connectionsUpgraded: 'connections upgraded',
connectionUpgraded: 'connection upgraded',
connectionsUpgradedHTTPSLowercase: 'connections upgraded to HTTPS',
connectionUpgradedHTTPSLowercase: 'connection upgraded to HTTPS',
// Controls
thirdPartyTrackersBlocked: '3rd-party trackers blocked',
connectionsUpgradedHTTPS: 'Connections upgraded to HTTPS',
connectionsUpgradedHTTPSCapital: 'Connections upgraded to HTTPS',
connectionUpgradedHTTPSCapital: 'Connection upgraded to HTTPS',
scriptsBlocked: 'Scripts blocked',
thirdPartyCookiesBlocked: '3rd-party cookies blocked',
allCookiesBlocked: 'Cookies blocked',
Expand Down

0 comments on commit c598b03

Please sign in to comment.