From 8dc18e8fcd69a2f67ccfad53bc1757445bc520ca Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Mon, 26 Jul 2021 12:29:29 +0800 Subject: [PATCH] Fix split (concat) string usage Concatenated strings are hard to translate. --- static/app-strings.json | 2 ++ ui/component/claimMenuList/view.jsx | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/static/app-strings.json b/static/app-strings.json index 665dd3884..d4ad7eb37 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -375,6 +375,8 @@ "Got it": "Got it", "View your channels": "View your channels", "Unfollow": "Unfollow", + "Follow @%channelName%": "Follow @%channelName%", + "Unfollow @%channelName%": "Unfollow @%channelName%", "These LBRY Credits remain yours. It is a deposit to reserve the name and can be undone at any time.": "These LBRY Credits remain yours. It is a deposit to reserve the name and can be undone at any time.", "Create channel": "Create channel", "Uh oh. The flux in our Retro Encabulator must be out of whack. Try refreshing to fix it.": "Uh oh. The flux in our Retro Encabulator must be out of whack. Try refreshing to fix it.", diff --git a/ui/component/claimMenuList/view.jsx b/ui/component/claimMenuList/view.jsx index 6220cc783..66535b73d 100644 --- a/ui/component/claimMenuList/view.jsx +++ b/ui/component/claimMenuList/view.jsx @@ -98,10 +98,13 @@ function ClaimMenuList(props: Props) { const isChannel = !incognitoClaim && !contentSigningChannel; const { channelName } = parseURI(contentChannelUri); const showDelete = claimIsMine || (fileInfo && (fileInfo.written_bytes > 0 || fileInfo.blobs_completed > 0)); - const subscriptionLabel = __('%action%' + '%user%', { - action: isSubscribed ? __('Unfollow') : __('Follow'), - user: repostedClaim ? __(' @' + channelName) : '', - }); + const subscriptionLabel = repostedClaim + ? isSubscribed + ? __('Unfollow @%channelName%', { channelName }) + : __('Follow @%channelName%', { channelName }) + : isSubscribed + ? __('Unfollow') + : __('Follow'); const lastCollectionName = 'Favorites'; const lastCollectionId = COLLECTIONS_CONSTS.FAVORITES_ID;