Skip to content

Commit

Permalink
Use splitStringForTag
Browse files Browse the repository at this point in the history
  • Loading branch information
muliswilliam committed Aug 24, 2022
1 parent 0bd475a commit 27be3cc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 19 deletions.
6 changes: 2 additions & 4 deletions components/brave_wallet/browser/brave_wallet_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -717,10 +717,8 @@ constexpr webui::LocalizedString kLocalizedStrings[] = {
{"braveWalletAuroraModalTitle", IDS_BRAVE_WALLET_AURORA_MODAL_TITLE},
{"braveWalletAuroraModalDescription",
IDS_BRAVE_WALLET_AURORA_MODAL_DESCRIPTION},
{"braveWalletAuroraModalLearnMore",
IDS_BRAVE_WALLET_AURORA_MODAL_LEARN_MORE},
{"braveWalletAuroraModalLearnMoreOr", IDS_BRAVE_WALLET_AURORA_MODAL_LEARN_MORE_OR},
{"braveWalletAuroraModalLearnMoreRiskMitigation", IDS_BRAVE_WALLET_AURORA_MODAL_LEARN_MORE_RISK_MITIGATION},
{"braveWalletAuroraModalLearnMore",
IDS_BRAVE_WALLET_AURORA_MODAL_LEARN_MORE},
{"braveWalletAuroraModalOPenButtonText",
IDS_BRAVE_WALLET_AURORA_MODAL_OPEN_BUTTON_TEXT},
{"braveWalletPasswordStrengthTooltipHeading",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// you can obtain one at http://mozilla.org/MPL/2.0/.

import * as React from 'react'
import { getLocale } from '../../../../../common/locale'
import { getLocale, splitStringForTag } from '../../../../../common/locale'

import { PopupModal } from '../..'
import {
Expand All @@ -26,6 +26,7 @@ const learnMoreLink = 'https://doc.aurora.dev/bridge/bridge-overview/'
const learnMoreRiskMitigation = 'https://rainbowbridge.app/approvals'

export const BridgeToAuroraModal = ({ onClose, onOpenRainbowAppClick }: Props) => {
const { beforeTag, duringTag, afterTag } = splitStringForTag(getLocale('braveWalletAuroraModalLearnMore'))
return (
<PopupModal
title=''
Expand All @@ -41,17 +42,15 @@ export const BridgeToAuroraModal = ({ onClose, onOpenRainbowAppClick }: Props) =
target='_blank'
href={learnMoreLink}
>
{getLocale('braveWalletAuroraModalLearnMore')}
{beforeTag}
</LearnMoreLink>
&nbsp;
{getLocale('braveWalletAuroraModalLearnMoreOr')}
&nbsp;
{duringTag}
<LearnMoreLink
rel='noopener noreferrer'
target='_blank'
href={learnMoreRiskMitigation}
>
{getLocale('braveWalletAuroraModalLearnMoreRiskMitigation')}
{afterTag}
</LearnMoreLink>
</Description>
<OpenRainbowAppButton
Expand Down
9 changes: 3 additions & 6 deletions components/brave_wallet_ui/stories/locale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -701,13 +701,10 @@ provideStrings({
braveWalletHelpCenterText: 'Need help? See',

// Bridge to Aurora
braveWalletAuroraModalTitle: 'Open rainbowbridge.app',
braveWalletAuroraModalDescription: 'Rainbow Bridge is an independent service that helps you bridge assets across networks, and use' +
' your crypto on other networks and DApp ecosystems. Bridging assets to other networks has some risks.',
braveWalletAuroraModalLearnMore: 'Learn more about using Rainbow Bridge,',
braveWalletAuroraModalTitle: 'Open the Rainbow Bridge app?',
braveWalletAuroraModalDescription: 'Rainbow Bridge is an independent service that helps you bridge assets across networks, and use your crypto on other networks and DApp ecosystems. Bridging assets to other networks has some risks.',
braveWalletAuroraModalLearnMore: 'Learn more about using Rainbow Bridge$1, or $2learn more about mitigating risk on Rainbow Bridge.',
braveWalletAuroraModalOPenButtonText: 'Open the Rainbow Bridge app',
braveWalletAuroraModalLearnMoreOr: 'or ',
braveWalletAuroraModalLearnMoreRiskMitigation: 'learn more about mitigating risk on Rainbow Bridge.',

// Input field labels
braveWalletInputLabelPassword: 'Password',
Expand Down
4 changes: 1 addition & 3 deletions components/resources/wallet_strings.grdp
Original file line number Diff line number Diff line change
Expand Up @@ -527,9 +527,7 @@
<message name="IDS_BRAVE_WALLET_ENTER_YOUR_PASSWORD" desc="Prompt for the user to enter their password">Enter your Brave Wallet password</message>
<message name="IDS_BRAVE_WALLET_AURORA_MODAL_TITLE" desc="Bridge to Aurora modal title">Open the Rainbow Bridge app?</message>
<message name="IDS_BRAVE_WALLET_AURORA_MODAL_DESCRIPTION" desc="Bridge to Aurora modal description">Rainbow Bridge is an independent service that helps you bridge assets across networks, and use your crypto on other networks and DApp ecosystems. Bridging assets to other networks has some risks.</message>
<message name="IDS_BRAVE_WALLET_AURORA_MODAL_LEARN_MORE" desc="Bridge to Aurora modal learn more link text">Learn more about using Rainbow Bridge,</message>
<message name="IDS_BRAVE_WALLET_AURORA_MODAL_LEARN_MORE_OR" desc="Bridge to Aurora modal learn more linK text continued">or</message>
<message name="IDS_BRAVE_WALLET_AURORA_MODAL_LEARN_MORE_RISK_MITIGATION" desc="Bridge to Aurora modal learn more about risk mitigation link text">learn more about mitigating risk on Rainbow Bridge.</message>
<message name="IDS_BRAVE_WALLET_AURORA_MODAL_LEARN_MORE" desc="Bridge to Aurora modal learn more links">Learn more about using Rainbow Bridge<ph name="LEARN_MORE_LINK">$1</ph>, or <ph name="LEARN_MORE_RISK_LINK">$2</ph>learn more about mitigating risk on Rainbow Bridge.</message>
<message name="IDS_BRAVE_WALLET_AURORA_MODAL_OPEN_BUTTON_TEXT" desc="Bridge to Aurora modal action button text">Open Rainbow Bridge app</message>
<message name="IDS_BRAVE_WALLET_LEARN_MORE_ABOUT_BRAVE_WALLET" desc="Link to article explaining crypto wallets">Learn more about Brave Wallet</message>
<message name="IDS_BRAVE_WALLET_PASSWORD_STRENGTH_TOOLTIP_HEADING" desc="Heading of password strength tooltip">At least:</message>
Expand Down

0 comments on commit 27be3cc

Please sign in to comment.