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
This commit is contained in:
infiinte-persistence 2020-05-26 11:48:12 +08:00 committed by Sean Yesmunt
parent 21b26ea34f
commit 8bd129799e
3 changed files with 8 additions and 5 deletions

View file

@ -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",

View file

@ -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();

View file

@ -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 ? (
<Button
@ -61,7 +61,7 @@ export default function SubscribeButton(props: Props) {
button={'alt'}
requiresAuth={IS_WEB}
label={label}
title={`${titlePrefix} ${__('this channel')}`}
title={titlePrefix}
onClick={e => {
e.stopPropagation();