From c1e9979d30fc5004d6637e3f0803c1c3bec78ac3 Mon Sep 17 00:00:00 2001 From: infiinte-persistence Date: Tue, 26 May 2020 11:48:12 +0800 Subject: [PATCH 1/9] Fix split sentence: "block|follow|unfollow this channel" Concatenating strings directly assumes that all languages have the same structure as English, which it is not. This fix allows translators to move the tokens around per their language/grammar requirements. #4239 --- static/app-strings.json | 5 ++++- ui/component/blockButton/view.jsx | 4 ++-- ui/component/subscribeButton/view.jsx | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/static/app-strings.json b/static/app-strings.json index 9d0121e3a..6547c00ab 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -1197,12 +1197,15 @@ "Sorry, your request timed out. Modify your options or %again%": "Sorry, your request timed out. Modify your options or %again%", "Pause at any time to select a thumbnail from your video": "Pause at any time to select a thumbnail from your video", "For video content, use MP4s in H264/AAC format and a friendly bitrate (under 5 mbps) and resolution (720p) for more reliable streaming.": "For video content, use MP4s in H264/AAC format and a friendly bitrate (under 5 mbps) and resolution (720p) for more reliable streaming.", - "this channel": "this channel", "Share this channel": "Share this channel", "File preview": "File preview", "Go Home": "Go Home", "Uploading (%progress%%) ": "Uploading (%progress%%) ", "Confirming": "Confirming", + "Unfollow this channel": "Unfollow this channel", + "Follow this channel": "Follow this channel", + "Unblock this channel": "Unblock this channel", + "Block this channel": "Block this channel", "%duration% years ago": "%duration% years ago", "%duration% year ago": "%duration% year ago", "%duration% months ago": "%duration% months ago", diff --git a/ui/component/blockButton/view.jsx b/ui/component/blockButton/view.jsx index 32dc5e840..ec9597446 100644 --- a/ui/component/blockButton/view.jsx +++ b/ui/component/blockButton/view.jsx @@ -21,7 +21,7 @@ export default function BlockButton(props: Props) { const blockRef = useRef(); const isHovering = useHover(blockRef); const blockLabel = channelIsBlocked ? __('Blocked') : __('Block'); - const blockTitlePrefix = channelIsBlocked ? __('Unblock') : __('Block'); + const blockTitlePrefix = channelIsBlocked ? __('Unblock this channel') : __('Block this channel'); const blockedOverride = channelIsBlocked && isHovering && __('Unblock'); return permanentUrl && !claimIsMine ? ( @@ -30,7 +30,7 @@ export default function BlockButton(props: Props) { icon={ICONS.BLOCK} button={'alt'} label={blockedOverride || blockLabel} - title={`${blockTitlePrefix} ${__('this channel')}`} + title={blockTitlePrefix} requiresAuth={IS_WEB} onClick={e => { e.stopPropagation(); diff --git a/ui/component/subscribeButton/view.jsx b/ui/component/subscribeButton/view.jsx index dc577a357..aefa6693e 100644 --- a/ui/component/subscribeButton/view.jsx +++ b/ui/component/subscribeButton/view.jsx @@ -50,7 +50,7 @@ export default function SubscribeButton(props: Props) { const unfollowOverride = isSubscribed && isHovering && __('Unfollow'); const label = isMobile && shrinkOnMobile ? '' : unfollowOverride || subscriptionLabel; - const titlePrefix = isSubscribed ? __('Unfollow') : __('Follow'); + const titlePrefix = isSubscribed ? __('Unfollow this channel') : __('Follow this channel'); return permanentUrl ? (