Skip to content

Commit

Permalink
chore(l10n): Migrated member-since
Browse files Browse the repository at this point in the history
  • Loading branch information
null2264 committed Oct 28, 2023
1 parent cd3756b commit d5f2ab6
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 22 deletions.
2 changes: 2 additions & 0 deletions src/locales/en-US/app.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ account-Status--familiar-followers-more =
account-Status--last-status = Last active
account-Status--locked =
.alt = This account privacy status is set to locked. The owner manually reviews who can follow them.
account-Status--member-since = Joined { DATETIME($date, year: "numeric", month: "long") }
account-Status--muted = Muted
account-Status--muted = Muted
account-Status--no-followers = No one follows this user yet.
account-Status--no-following = This user doesn't follow anyone yet.
Expand Down
1 change: 1 addition & 0 deletions src/locales/id-ID/app.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ account-Status--follows-you = Mengikuti anda
account-Status--last-status = Terakhir aktif
account-Status--locked =
.alt = Status privasi akun ini disetel untuk dikunci. Pemilik secara manual meninjau siapa yang dapat mengikuti mereka.
account-Status--member-since = Terdaftar sejak { DATETIME($date, year: "numeric", month: "long") }
account-Status--muted = Dibisukan
account-Status--no-followers = Tidak ada yang mengikuti pengguna ini saat ini.
account-Status--no-following = Pengguna ini belum mengikuti siapapun.
Expand Down
1 change: 1 addition & 0 deletions src/locales/ja-JP/app.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ account-Status--familiar-followers-more = { $count } 人のおすすめユーザ
account-Status--last-status = 最後の活動
account-Status--locked =
.alt = このアカウントは承認制アカウントです。相手が承認するまでフォローは完了しません。
account-Status--member-since = { DATETIME($date, year: "numeric", month: "long") }から利用しています
account-Status--muted = ミュートしています
account-Status--no-followers = まだ誰もフォローしていません。
account-Status--no-following = まだ誰もフォローしていません。
Expand Down
16 changes: 6 additions & 10 deletions src/soapbox/components/profile-hover-card.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Localized } from '@fluent/react';
import clsx from 'clsx';
import React, { useEffect, useState } from 'react';
import { useIntl, FormattedMessage } from 'react-intl';
import { FormattedMessage } from 'react-intl';
import { usePopper } from 'react-popper';
import { useHistory } from 'react-router-dom';

Expand Down Expand Up @@ -62,7 +62,6 @@ interface IProfileHoverCard {
export const ProfileHoverCard: React.FC<IProfileHoverCard> = ({ visible = true }) => {
const dispatch = useAppDispatch();
const history = useHistory();
const intl = useIntl();

const [popperElement, setPopperElement] = useState<HTMLElement | null>(null);

Expand Down Expand Up @@ -92,7 +91,6 @@ export const ProfileHoverCard: React.FC<IProfileHoverCard> = ({ visible = true }

if (!account) return null;
const accountBio = { __html: account.note_emojified };
const memberSinceDate = intl.formatDate(account.created_at, { month: 'long', year: 'numeric' });
const followedBy = me !== account.id && account.relationship?.followed_by === true;

return (
Expand Down Expand Up @@ -128,13 +126,11 @@ export const ProfileHoverCard: React.FC<IProfileHoverCard> = ({ visible = true }
className='h-4 w-4 text-gray-800 dark:text-gray-200'
/>

<Text size='sm'>
<FormattedMessage
id='account.member_since' defaultMessage='Joined {date}' values={{
date: memberSinceDate,
}}
/>
</Text>
<Localized id='account-Status--member-since' vars={{ date: new Date(account.created_at) }}>
<Text size='sm'>
Joined {account.created_at}
</Text>
</Localized>
</HStack>
)}

Expand Down
15 changes: 5 additions & 10 deletions src/soapbox/features/ui/components/profile-info-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import { Localized } from '@fluent/react';
import React from 'react';
import { useIntl, FormattedMessage } from 'react-intl';

import { usePatronUser } from 'soapbox/api/hooks';
import AccountAcct from 'soapbox/components/account-acct';
Expand Down Expand Up @@ -37,7 +36,6 @@ interface IProfileInfoPanel {

/** User profile metadata, such as location, birthday, etc. */
const ProfileInfoPanel: React.FC<IProfileInfoPanel> = ({ account, username }) => {
const intl = useIntl();
const { patronUser } = usePatronUser(account?.url);
const me = useAppSelector(state => state.me);
const ownAccount = account?.id === me;
Expand Down Expand Up @@ -128,7 +126,6 @@ const ProfileInfoPanel: React.FC<IProfileInfoPanel> = ({ account, username }) =>
}

const deactivated = account.pleroma?.deactivated ?? false;
const memberSinceDate = intl.formatDate(account.created_at, { month: 'long', year: 'numeric' });
const badges = getBadges();

return (
Expand Down Expand Up @@ -184,13 +181,11 @@ const ProfileInfoPanel: React.FC<IProfileInfoPanel> = ({ account, username }) =>
className='h-4 w-4 text-gray-800 dark:text-gray-200'
/>

<Text size='sm'>
<FormattedMessage
id='account.member_since' defaultMessage='Joined {date}' values={{
date: memberSinceDate,
}}
/>
</Text>
<Localized id='account-Status--member-since' vars={{ date: new Date(account.created_at) }}>
<Text size='sm'>
Joined {account.created_at}
</Text>
</Localized>
</HStack>
)}

Expand Down
2 changes: 0 additions & 2 deletions src/soapbox/locales/en.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"account.media": "Media",
"account.member_since": "Joined {date}",
"account.mention": "Mention",
"account.mute": "Mute @{name}",
"account.never_active": "Never",
Expand Down

0 comments on commit d5f2ab6

Please sign in to comment.