fix(i18n): translate remaining recipe card/detail strings, localize AI responses

Recipe cards, the recipe detail page, and meal planner still rendered raw
"{n} servings"/"{n}m cook"/"{n} srv" text and untranslated difficulty labels
outside the earlier i18n pass. Also wires the user's locale into AI features
that previously always answered in English regardless of app language:
recipe chat, ingredient substitution, recipe ideas, and generate-from-idea.
The recipe-language picker in the AI generate dialog now defaults to the
user's locale instead of always defaulting to English.
This commit is contained in:
Arnaud
2026-07-02 08:25:51 +02:00
parent 01fdbb880b
commit 2154512e54
15 changed files with 64 additions and 24 deletions
+3 -2
View File
@@ -45,6 +45,7 @@ function SelectableRecipeCard({
selectMode: boolean;
onToggle: (id: string) => void;
}) {
const t = useTranslations("recipe");
const cover = recipe.photos?.find((p) => p.isCover) ?? recipe.photos?.[0];
const totalMins = (recipe.prepMins ?? 0) + (recipe.cookMins ?? 0);
const VisibilityIcon = VISIBILITY_ICON[recipe.visibility];
@@ -139,12 +140,12 @@ function SelectableRecipeCard({
{totalMins > 0 && (
<span className="flex items-center gap-1">
<Clock className="h-3 w-3" />
{totalMins}m
{t("total", { mins: totalMins })}
</span>
)}
{recipe.difficulty && (
<Badge variant={DIFFICULTY_COLOR[recipe.difficulty]} className="text-xs h-4 px-1.5">
{recipe.difficulty}
{t(`difficulty.${recipe.difficulty}`)}
</Badge>
)}
</div>