Skip to content

Commit 04ed47f

Browse files
committed
fix(i18n): 修正 profile 子 namespace 路径 + feedback namespace 对齐新字典
profile 下的 follow/activity/card/repos/docs/edit 统一从独立顶层 namespace 改为 profile.xxx 嵌套路径,与 translator 发布的新字典结构一致。 pageFeedback → feedback namespace,sec3/sec4 titleField key 修正。
1 parent 17a26ed commit 04ed47f

8 files changed

Lines changed: 10 additions & 10 deletions

File tree

app/components/PageFeedback.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { ThumbsUp, ThumbsDown } from "lucide-react";
88

99
export function PageFeedback() {
1010
const pathname = usePathname();
11-
const t = useTranslations("pageFeedback");
11+
const t = useTranslations("feedback");
1212
const [voted, setVoted] = useState<"helpful" | "not_helpful" | null>(null);
1313

1414
const handleVote = (vote: "helpful" | "not_helpful") => {

app/u/[username]/ActivityHeatmap.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function formatDay(d: Date): string {
3232
}
3333

3434
export async function ActivityHeatmap({ dailyCounts }: Props) {
35-
const t = await getTranslations("activity");
35+
const t = await getTranslations("profile.activity");
3636
// 以今天为右边界,往前 52 周;按周对齐:从上上周日起(GitHub 图的起点)
3737
const today = new Date();
3838
today.setUTCHours(0, 0, 0, 0);

app/u/[username]/FollowButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function readToken(): string | null {
3838
*/
3939
export function FollowButton({ identifier, targetUserId }: Props) {
4040
const { user, status } = useAuth();
41-
const t = useTranslations("follow");
41+
const t = useTranslations("profile.follow");
4242
const [followerCount, setFollowerCount] = useState<number | null>(null);
4343
const [followingCount, setFollowingCount] = useState<number | null>(null);
4444
const [isFollowing, setIsFollowing] = useState(false);

app/u/[username]/GithubRepos.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function fmtDate(iso: string): string {
5656
export async function GithubRepos({ identifier }: Props) {
5757
const repos = await fetchRepos(identifier);
5858
if (repos.length === 0) return null;
59-
const t = await getTranslations("repos");
59+
const t = await getTranslations("profile.repos");
6060

6161
return (
6262
<section className="border border-[var(--foreground)] p-6 lg:p-8 flex flex-col gap-4">

app/u/[username]/ProfileCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export function ProfileCard({
6060
spanFull,
6161
}: ProfileCardProps) {
6262
const [expanded, setExpanded] = useState(false);
63-
const t = useTranslations("card");
63+
const t = useTranslations("profile.card");
6464

6565
const kindLabel = {
6666
PROJ: t("kind.project"),

app/u/[username]/edit/EditProfileForm.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ interface Props {
105105
export function EditProfileForm({ targetIdentifier }: Props) {
106106
const { user, status } = useAuth();
107107
const router = useRouter();
108-
const t = useTranslations("edit");
108+
const t = useTranslations("profile.edit");
109109

110110
const [prefs, setPrefs] = useState<Preferences>(EMPTY_PREFS);
111111
const [loading, setLoading] = useState(true);
@@ -316,7 +316,7 @@ export function EditProfileForm({ targetIdentifier }: Props) {
316316
type="text"
317317
value={item.title}
318318
onChange={(e) => update({ ...item, title: e.target.value })}
319-
placeholder={t("sec3.title.placeholder")}
319+
placeholder={t("sec3.titleField.placeholder")}
320320
className="border border-[var(--foreground)] bg-[var(--background)] px-3 py-2 font-serif text-sm font-bold"
321321
/>
322322
<textarea
@@ -388,7 +388,7 @@ export function EditProfileForm({ targetIdentifier }: Props) {
388388
type="text"
389389
value={item.title}
390390
onChange={(e) => update({ ...item, title: e.target.value })}
391-
placeholder={t("sec4.title.placeholder")}
391+
placeholder={t("sec4.titleField.placeholder")}
392392
className="border border-[var(--foreground)] bg-[var(--background)] px-3 py-2 font-serif text-sm font-bold"
393393
/>
394394
<div className="grid grid-cols-1 md:grid-cols-[2fr_1fr] gap-2">

app/u/[username]/edit/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ interface Param {
1414
*/
1515
export default async function EditProfilePage({ params }: Param) {
1616
const { username } = await params;
17-
const t = await getTranslations("edit");
17+
const t = await getTranslations("profile.edit");
1818
return (
1919
<>
2020
<Header />

app/u/[username]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ export default async function UserProfilePage({ params }: Param) {
230230
if (!data) notFound();
231231

232232
const t = await getTranslations("profile");
233-
const tDocs = await getTranslations("docs");
233+
const tDocs = await getTranslations("profile.docs");
234234
const { user } = data;
235235
const preferences = data.preferences ?? {};
236236
const { docs, points, commits, dailyCounts } = findContributions(

0 commit comments

Comments
 (0)