Update copy for empty featured tabs (#34483)

This commit is contained in:
Echo 2025-04-17 12:27:44 +02:00 committed by GitHub
parent 8489f6c8fc
commit 64d94f9e57
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 25 additions and 4 deletions

View file

@ -1,6 +1,9 @@
import { FormattedMessage } from 'react-intl'; import { FormattedMessage } from 'react-intl';
import { useParams } from 'react-router';
import { LimitedAccountHint } from 'mastodon/features/account_timeline/components/limited_account_hint'; import { LimitedAccountHint } from 'mastodon/features/account_timeline/components/limited_account_hint';
import { me } from 'mastodon/initial_state';
interface EmptyMessageProps { interface EmptyMessageProps {
suspended: boolean; suspended: boolean;
@ -15,13 +18,21 @@ export const EmptyMessage: React.FC<EmptyMessageProps> = ({
hidden, hidden,
blockedBy, blockedBy,
}) => { }) => {
const { acct } = useParams<{ acct?: string }>();
if (!accountId) { if (!accountId) {
return null; return null;
} }
let message: React.ReactNode = null; let message: React.ReactNode = null;
if (suspended) { if (me === accountId) {
message = (
<FormattedMessage
id='empty_column.account_featured.me'
defaultMessage='You have not featured anything yet. Did you know that you can feature your posts, hashtags you use the most, and even your friends accounts on your profile?'
/>
);
} else if (suspended) {
message = ( message = (
<FormattedMessage <FormattedMessage
id='empty_column.account_suspended' id='empty_column.account_suspended'
@ -37,11 +48,19 @@ export const EmptyMessage: React.FC<EmptyMessageProps> = ({
defaultMessage='Profile unavailable' defaultMessage='Profile unavailable'
/> />
); );
} else if (acct) {
message = (
<FormattedMessage
id='empty_column.account_featured.other'
defaultMessage='{acct} has not featured anything yet. Did you know that you can feature your posts, hashtags you use the most, and even your friends accounts on your profile?'
values={{ acct }}
/>
);
} else { } else {
message = ( message = (
<FormattedMessage <FormattedMessage
id='empty_column.account_featured' id='empty_column.account_featured_other.unknown'
defaultMessage='This list is empty' defaultMessage='This account has not featured anything yet.'
/> />
); );
} }

View file

@ -300,7 +300,9 @@
"emoji_button.search_results": "Search results", "emoji_button.search_results": "Search results",
"emoji_button.symbols": "Symbols", "emoji_button.symbols": "Symbols",
"emoji_button.travel": "Travel & Places", "emoji_button.travel": "Travel & Places",
"empty_column.account_featured": "This list is empty", "empty_column.account_featured.me": "You have not featured anything yet. Did you know that you can feature your posts, hashtags you use the most, and even your friends accounts on your profile?",
"empty_column.account_featured.other": "{acct} has not featured anything yet. Did you know that you can feature your posts, hashtags you use the most, and even your friends accounts on your profile?",
"empty_column.account_featured_other.unknown": "This account has not featured anything yet.",
"empty_column.account_hides_collections": "This user has chosen to not make this information available", "empty_column.account_hides_collections": "This user has chosen to not make this information available",
"empty_column.account_suspended": "Account suspended", "empty_column.account_suspended": "Account suspended",
"empty_column.account_timeline": "No posts here!", "empty_column.account_timeline": "No posts here!",