Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion web/src/features/profile/MemberProfilePage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,23 @@ describe("member profile", () => {
vi.stubGlobal("scrollTo", vi.fn());
});

afterEach(() => {
afterEach(async () => {
cleanup();
await i18n.changeLanguage("zh-CN");
vi.restoreAllMocks();
vi.unstubAllGlobals();
window.sessionStorage.clear();
});

it("renders the English joined date as a complete phrase", async () => {
await i18n.changeLanguage("en");
vi.stubGlobal("fetch", signedIn(null));
mount(new PublicApi(async () => json(memberEnvelope())), "linlin");
expect(
(await screen.findByText("Joined August 2026")).closest("time"),
).toHaveAttribute("datetime", "2026-08-01T09:08:00Z");
});

it("renders another account's identity over the plain cover band", async () => {
const requested: string[] = [];
const fetcher = vi.fn(async (input: RequestInfo | URL) => {
Expand Down
4 changes: 2 additions & 2 deletions web/src/features/profile/MemberProfilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ export function MemberProfilePage({
exact={joinedExact}
children={
<time dateTime={account.joinedAt}>
<Icon name="calendar" /> {joined}
{t("加入")}
<Icon name="calendar" />
<span>{t("{{value1}}加入", { value1: joined })}</span>
</time>
}
/>
Expand Down
9 changes: 5 additions & 4 deletions web/src/features/profile/ProfilePage.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -149,16 +149,17 @@
}

.profileMeta time {
display: inline-flex;
align-items: center;
gap: 4px;
display: block;
line-height: 12px;
cursor: default;
}

.profileMeta svg {
display: inline-block;
inline-size: 18.75px;
block-size: 18.75px;
flex: none;
margin-inline-end: 4px;
vertical-align: text-bottom;
}

.headerSearch {
Expand Down
2 changes: 1 addition & 1 deletion web/src/features/profile/ProfilePage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ describe("profile page", () => {
);
expect(screen.queryByText("媒体与归档")).not.toBeInTheDocument();
expect(screen.getByText("@owner", { selector: "p" })).toBeInTheDocument();
expect(screen.getByText("2026年8月加入")).toHaveAttribute(
expect(screen.getByText("2026年8月加入").closest("time")).toHaveAttribute(
"datetime",
site.instanceInitializedAt,
);
Expand Down
4 changes: 2 additions & 2 deletions web/src/features/profile/ProfilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,8 @@ export function ProfilePage({
exact={initialized.absolute}
children={
<time dateTime={site.instanceInitializedAt}>
<Icon name="calendar" /> {joined}
{t("加入")}
<Icon name="calendar" />
<span>{t("{{value1}}加入", { value1: joined })}</span>
</time>
}
/>
Expand Down
2 changes: 1 addition & 1 deletion web/src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@
"取消转发": "Undo repost",
"没有这个用户": "User not found",
"{{value1}} 的个人资料": "{{value1}}'s profile",
"加入": "Joined",
"{{value1}}加入": "Joined {{value1}}",
"账户通过审核后就能上传图片": "You can upload images after account approval",
"这里只能放图片": "Choose an image",
"这张图片太大了,请换一张小一些的。": "This image is too large. Choose a smaller image.",
Expand Down
2 changes: 1 addition & 1 deletion web/src/i18n/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@
"取消转发": "取消转发",
"没有这个用户": "没有这个用户",
"{{value1}} 的个人资料": "{{value1}} 的个人资料",
"加入": "加入",
"{{value1}}加入": "{{value1}}加入",
"账户通过审核后就能上传图片": "账户通过审核后就能上传图片",
"这里只能放图片": "这里只能放图片",
"这张图片太大了,请换一张小一些的。": "这张图片太大了,请换一张小一些的。",
Expand Down
Loading