Make "Send a xxx tip" currency-agnostic so we don't need to re-translate again

This commit is contained in:
infinite-persistence 2022-03-31 17:43:41 +08:00
parent c232981f0c
commit 071b86fa06
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0
2 changed files with 8 additions and 6 deletions

View file

@ -24,7 +24,6 @@
"Following --[button label indicating a channel has been followed]--": "Following",
"The tags you follow will change what's trending for you.": "The tags you follow will change what's trending for you.",
"Tags": "Tags",
"Send a tip": "Send a tip",
"Share": "Share",
"Play": "Play",
"Shuffle Play": "Shuffle Play",
@ -1024,6 +1023,7 @@
"Sending": "Sending",
"From": "From",
"Only creators that verify cash accounts can receive tips": "Only creators that verify cash accounts can receive tips",
"Send a tip directly from your attached card": "Send a tip directly from your attached card",
"Amount must be at least one dollar": "Amount must be at least one dollar",
"Update Your Password": "Update Your Password",
"Your Wallet is Empty": "Your Wallet is Empty",
@ -1062,8 +1062,7 @@
"Boost This %claimTypeText%": "Boost This %claimTypeText%",
"Boost Your %claimTypeText%": "Boost Your %claimTypeText%",
"Tip This %claimTypeText%": "Tip This %claimTypeText%",
"Send a $%displayAmount% Tip": "Send a $%displayAmount% Tip",
"Send a %displayAmount% Credit Tip": "Send a %displayAmount% Credit Tip",
"Send a %amount% tip": "Send a %amount% tip",
"Boost": "Boost",
"Boost transaction successful.": "Boost transaction successful.",
"Boost transaction failed.": "Boost transaction failed.",

View file

@ -1,5 +1,6 @@
// @flow
import { Form } from 'component/common/form';
import LbcMessage from 'component/common/lbc-message';
import { Lbryio } from 'lbryinc';
import { parseURI } from 'util/lbryURI';
import * as ICONS from 'constants/icons';
@ -235,9 +236,11 @@ export default function WalletSendTip(props: Props) {
case TAB_BOOST:
return titleText;
case TAB_FIAT:
return __('Send a %fiatSymbolToUse%%displayAmount% Tip', { displayAmount, fiatSymbolToUse });
return __('Send a %amount% tip', { amount: `${fiatSymbolToUse}${displayAmount}` });
case TAB_LBC:
return __('Send a %displayAmount% Credit Tip', { displayAmount });
return __('Send a %amount% tip', { amount: `${displayAmount} LBC` });
default:
return titleText;
}
}
@ -351,7 +354,7 @@ export default function WalletSendTip(props: Props) {
button="primary"
type="submit"
disabled={fetchingChannels || isPending || tipError || !tipAmount || disableSubmitButton}
label={customText || buildButtonText()}
label={<LbcMessage>{customText || buildButtonText()}</LbcMessage>}
/>
{fetchingChannels && <span className="help">{__('Loading your channels...')}</span>}
</div>