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:
@@ -41,10 +41,13 @@ export async function POST(req: NextRequest) {
|
||||
? { provider: parsed.data.provider, model: parsed.data.model }
|
||||
: await getDefaultProviderWithKey(session!.user.id);
|
||||
|
||||
const locale = (session!.user as { locale?: string }).locale ?? "en";
|
||||
|
||||
const substitutions = await substituteIngredient(
|
||||
parsed.data.ingredient,
|
||||
context,
|
||||
aiConfig
|
||||
aiConfig,
|
||||
locale
|
||||
);
|
||||
|
||||
return NextResponse.json({ substitutions });
|
||||
|
||||
Reference in New Issue
Block a user