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:
@@ -3,6 +3,7 @@
|
||||
import { useState } from "react";
|
||||
import { Star } from "lucide-react";
|
||||
import { toast } from "sonner";
|
||||
import { useTranslations } from "next-intl";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
export function RatingStars({
|
||||
@@ -16,6 +17,7 @@ export function RatingStars({
|
||||
readonly?: boolean;
|
||||
size?: "sm" | "default";
|
||||
}) {
|
||||
const t = useTranslations("social");
|
||||
const [score, setScore] = useState(initialScore);
|
||||
const [hovered, setHovered] = useState(0);
|
||||
const [saving, setSaving] = useState(false);
|
||||
@@ -31,11 +33,11 @@ export function RatingStars({
|
||||
});
|
||||
if (!res.ok) {
|
||||
const err = await res.json() as { error?: string };
|
||||
toast.error(err.error ?? "Failed to rate");
|
||||
toast.error(err.error ?? t("ratingFailed"));
|
||||
return;
|
||||
}
|
||||
setScore(value);
|
||||
toast.success("Rating saved");
|
||||
toast.success(t("ratingSaved"));
|
||||
} finally {
|
||||
setSaving(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user