i18n: translate meal/drink pairing, nutrition, comments, DMs, people search, URL import

Full sweep of hardcoded English strings across:
- Meal pairing and drink pairing dialogs (titles, descriptions, role/
  type labels, regenerate/generate buttons, progress labels) — also
  fixed drink type labels that had French text hardcoded regardless
  of locale ("Sans alcool"/"Chaud").
- Nutrition panel — had no useTranslations at all.
- Comments: header, empty/loading state, post/reply/cancel/delete
  buttons, relative timestamps (just now/Xm ago/Xh ago/Xd ago), and
  comment-reactions' toasts + aria-labels.
- Rating stars toasts.
- Direct messages: thread, conversation list, message button, both
  /messages pages.
- People search page and component.
- URL import dialog (title, description, buttons, toasts).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Arnaud
2026-07-09 03:20:49 +02:00
parent e67145493e
commit 08ab9ac71f
16 changed files with 299 additions and 101 deletions
@@ -3,6 +3,7 @@
import { useEffect, useState } from "react";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { useTranslations } from "next-intl";
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
import { Badge } from "@/components/ui/badge";
import { cn } from "@/lib/utils";
@@ -17,6 +18,7 @@ type ConversationSummary = {
export function ConversationsList() {
const pathname = usePathname();
const t = useTranslations("messages");
const [conversations, setConversations] = useState<ConversationSummary[]>([]);
const [loading, setLoading] = useState(true);
@@ -35,9 +37,9 @@ export function ConversationsList() {
return () => { cancelled = true; clearInterval(interval); };
}, []);
if (loading) return <p className="text-sm text-muted-foreground p-4">Loading</p>;
if (loading) return <p className="text-sm text-muted-foreground p-4">{t("loading")}</p>;
if (conversations.length === 0) {
return <p className="text-sm text-muted-foreground p-4">No conversations yet. Visit a profile to say hi.</p>;
return <p className="text-sm text-muted-foreground p-4">{t("noConversationsYet")}</p>;
}
return (
@@ -58,7 +60,7 @@ export function ConversationsList() {
<div className="flex-1 min-w-0">
<div className="flex items-center justify-between gap-2">
<p className={cn("text-sm truncate", c.unreadCount > 0 && "font-semibold")}>
{c.otherUser?.name ?? "Unknown"}
{c.otherUser?.name ?? t("unknownUser")}
</p>
{c.unreadCount > 0 && (
<Badge variant="destructive" className="h-4 min-w-4 px-1 text-[10px] shrink-0">
@@ -67,7 +69,7 @@ export function ConversationsList() {
)}
</div>
<p className={cn("text-xs truncate", c.unreadCount > 0 ? "text-foreground" : "text-muted-foreground")}>
{c.lastMessage ?? "No messages yet"}
{c.lastMessage ?? t("noMessagesPreview")}
</p>
</div>
</Link>