Compare commits

..

5 Commits

Author SHA1 Message Date
Hayden
5f72724d2d New translations en-us.json (Norwegian)
[ci skip]
2026-05-13 12:39:01 -05:00
Hayden
5dc98e8e7e New translations en-us.json (Norwegian)
[ci skip]
2026-05-13 12:38:59 -05:00
Hayden
eaf3a1b9bd New translations en-us.json (Slovenian)
[ci skip]
2026-05-13 00:32:09 -05:00
Hayden
f7e4d5ad99 New translations en-us.json (Norwegian)
[ci skip]
2026-05-13 00:32:07 -05:00
Hayden
04b975b779 New translations en-us.json (Norwegian)
[ci skip]
2026-05-13 00:32:06 -05:00
19 changed files with 62 additions and 167 deletions

View File

@@ -321,7 +321,7 @@ async function consolidateRecipesIntoSections(recipes: RecipeWithScale[]) {
const householdsWithFood = subIng.food?.householdsWithIngredientFood || [];
ownIngs.push({
checked: !householdsWithFood.includes(currentHouseholdSlug.value),
ingredient: subIng,
ingredient: { ...subIng, quantity: (ing.quantity || 1) * (subIng.quantity || 1) },
});
}
}

View File

@@ -13,10 +13,9 @@ describe("useStoreActions", () => {
const mockStore = ref([]);
const mockLoading = ref(false);
const mockInitialized = ref(false);
test("deleteMany calls deleteOne for each ID and refreshes once", async () => {
const actions = useStoreActions("test-store", mockApi, mockStore, mockLoading, mockInitialized);
const actions = useStoreActions("test-store", mockApi, mockStore, mockLoading);
mockApi.deleteOne = vi.fn().mockResolvedValue({ response: { data: {} } });
mockApi.getAll = vi.fn().mockResolvedValue({ data: { items: [] } });
@@ -33,7 +32,7 @@ describe("useStoreActions", () => {
});
test("deleteMany handles empty array", async () => {
const actions = useStoreActions("test-store", mockApi, mockStore, mockLoading, mockInitialized);
const actions = useStoreActions("test-store", mockApi, mockStore, mockLoading);
mockApi.deleteOne = vi.fn();
mockApi.getAll = vi.fn().mockResolvedValue({ data: { items: [] } });
@@ -45,7 +44,7 @@ describe("useStoreActions", () => {
});
test("deleteMany sets loading state", async () => {
const actions = useStoreActions("test-store", mockApi, mockStore, mockLoading, mockInitialized);
const actions = useStoreActions("test-store", mockApi, mockStore, mockLoading);
mockApi.deleteOne = vi.fn().mockResolvedValue({});
mockApi.getAll = vi.fn().mockResolvedValue({ data: { items: [] } });
@@ -56,25 +55,4 @@ describe("useStoreActions", () => {
await promise;
expect(mockLoading.value).toBe(false);
});
test("refresh sets initialized to true even when store returns empty results", async () => {
const localInitialized = ref(false);
const actions = useStoreActions("test-store", mockApi, mockStore, mockLoading, localInitialized);
mockApi.getAll = vi.fn().mockResolvedValue({ data: { items: [] } });
expect(localInitialized.value).toBe(false);
await actions.refresh();
expect(localInitialized.value).toBe(true);
});
test("refresh sets initialized to true when store returns items", async () => {
const localInitialized = ref(false);
const actions = useStoreActions("test-store", mockApi, mockStore, mockLoading, localInitialized);
mockApi.getAll = vi.fn().mockResolvedValue({ data: { items: [{ id: "1", name: "item" }] } });
await actions.refresh();
expect(localInitialized.value).toBe(true);
});
});

View File

@@ -26,7 +26,6 @@ export function useReadOnlyActions<T extends BoundT>(
api: BaseCRUDAPIReadOnly<T>,
allRef: Ref<T[] | null> | null,
loading: Ref<boolean>,
initialized: Ref<boolean>,
defaultQueryParams: Record<string, QueryValue> = {},
): ReadOnlyStoreActions<T> {
function getAll(page = 1, perPage = -1, params = {} as Record<string, QueryValue>) {
@@ -70,7 +69,6 @@ export function useReadOnlyActions<T extends BoundT>(
allRef.value = data.items;
}
initialized.value = true;
loading.value = false;
}
@@ -91,7 +89,6 @@ export function useStoreActions<T extends BoundT>(
api: BaseCRUDAPI<unknown, T, unknown>,
allRef: Ref<T[] | null> | null,
loading: Ref<boolean>,
initialized: Ref<boolean>,
defaultQueryParams: Record<string, QueryValue> = {},
): StoreActions<T> {
function getAll(page = 1, perPage = -1, params = {} as Record<string, QueryValue>) {
@@ -135,7 +132,6 @@ export function useStoreActions<T extends BoundT>(
allRef.value = data.items;
}
initialized.value = true;
loading.value = false;
}

View File

@@ -16,11 +16,10 @@ export const useReadOnlyStore = function <T extends BoundT>(
storeKey: string,
store: Ref<T[]>,
loading: Ref<boolean>,
initialized: Ref<boolean>,
api: BaseCRUDAPIReadOnly<T>,
params = {} as Record<string, QueryValue>,
) {
const storeActions = useReadOnlyActions(`${storeKey}-store-readonly`, api, store, loading, initialized);
const storeActions = useReadOnlyActions(`${storeKey}-store-readonly`, api, store, loading);
const actions = {
...storeActions,
async refresh() {
@@ -28,12 +27,11 @@ export const useReadOnlyStore = function <T extends BoundT>(
},
flushStore() {
store.value = [];
initialized.value = false;
},
};
// initial hydration
if (!loading.value && !initialized.value) {
if (!loading.value && !store.value.length) {
actions.refresh();
}
@@ -44,11 +42,10 @@ export const useStore = function <T extends BoundT>(
storeKey: string,
store: Ref<T[]>,
loading: Ref<boolean>,
initialized: Ref<boolean>,
api: BaseCRUDAPI<unknown, T, unknown>,
params = {} as Record<string, QueryValue>,
) {
const storeActions = useStoreActions(`${storeKey}-store`, api, store, loading, initialized);
const storeActions = useStoreActions(`${storeKey}-store`, api, store, loading);
const actions = {
...storeActions,
async refresh() {
@@ -56,12 +53,11 @@ export const useStore = function <T extends BoundT>(
},
flushStore() {
store.value = [];
initialized.value = false;
},
};
// initial hydration
if (!loading.value && !initialized.value) {
if (!loading.value && !store.value.length) {
actions.refresh();
}

View File

@@ -5,16 +5,12 @@ import { usePublicExploreApi, useUserApi } from "~/composables/api";
const store: Ref<RecipeCategory[]> = ref([]);
const loading = ref(false);
const initialized = ref(false);
const publicLoading = ref(false);
const publicInitialized = ref(false);
export function resetCategoryStore() {
store.value = [];
loading.value = false;
initialized.value = false;
publicLoading.value = false;
publicInitialized.value = false;
}
export const useCategoryData = function () {
@@ -27,10 +23,10 @@ export const useCategoryData = function () {
export const useCategoryStore = function (i18n?: Composer) {
const api = useUserApi(i18n);
return useStore<RecipeCategory>("category", store, loading, initialized, api.categories);
return useStore<RecipeCategory>("category", store, loading, api.categories);
};
export const usePublicCategoryStore = function (groupSlug: string, i18n?: Composer) {
const api = usePublicExploreApi(groupSlug, i18n).explore;
return useReadOnlyStore<RecipeCategory>("category", store, publicLoading, publicInitialized, api.categories);
return useReadOnlyStore<RecipeCategory>("category", store, publicLoading, api.categories);
};

View File

@@ -5,21 +5,17 @@ import { usePublicExploreApi, useUserApi } from "~/composables/api";
const cookbooks: Ref<ReadCookBook[]> = ref([]);
const loading = ref(false);
const initialized = ref(false);
const publicLoading = ref(false);
const publicInitialized = ref(false);
export function resetCookbookStore() {
cookbooks.value = [];
loading.value = false;
initialized.value = false;
publicLoading.value = false;
publicInitialized.value = false;
}
export const useCookbookStore = function (i18n?: Composer) {
const api = useUserApi(i18n);
const store = useStore<ReadCookBook>("cookbook", cookbooks, loading, initialized, api.cookbooks);
const store = useStore<ReadCookBook>("cookbook", cookbooks, loading, api.cookbooks);
const updateAll = async function (updateData: UpdateCookBook[]) {
loading.value = true;
@@ -35,5 +31,5 @@ export const useCookbookStore = function (i18n?: Composer) {
export const usePublicCookbookStore = function (groupSlug: string, i18n?: Composer) {
const api = usePublicExploreApi(groupSlug, i18n).explore;
return useReadOnlyStore<ReadCookBook>("cookbook", cookbooks, publicLoading, publicInitialized, api.cookbooks);
return useReadOnlyStore<ReadCookBook>("cookbook", cookbooks, publicLoading, api.cookbooks);
};

View File

@@ -5,16 +5,12 @@ import { usePublicExploreApi, useUserApi } from "~/composables/api";
const store: Ref<IngredientFood[]> = ref([]);
const loading = ref(false);
const initialized = ref(false);
const publicLoading = ref(false);
const publicInitialized = ref(false);
export function resetFoodStore() {
store.value = [];
loading.value = false;
initialized.value = false;
publicLoading.value = false;
publicInitialized.value = false;
}
export const useFoodData = function () {
@@ -28,10 +24,10 @@ export const useFoodData = function () {
export const useFoodStore = function (i18n?: Composer) {
const api = useUserApi(i18n);
return useStore<IngredientFood>("food", store, loading, initialized, api.foods);
return useStore<IngredientFood>("food", store, loading, api.foods);
};
export const usePublicFoodStore = function (groupSlug: string, i18n?: Composer) {
const api = usePublicExploreApi(groupSlug, i18n).explore;
return useReadOnlyStore<IngredientFood>("food", store, publicLoading, publicInitialized, api.foods);
return useReadOnlyStore<IngredientFood>("food", store, publicLoading, api.foods);
};

View File

@@ -5,24 +5,20 @@ import { usePublicExploreApi, useUserApi } from "~/composables/api";
const store: Ref<HouseholdSummary[]> = ref([]);
const loading = ref(false);
const initialized = ref(false);
const publicLoading = ref(false);
const publicInitialized = ref(false);
export function resetHouseholdStore() {
store.value = [];
loading.value = false;
initialized.value = false;
publicLoading.value = false;
publicInitialized.value = false;
}
export const useHouseholdStore = function (i18n?: Composer) {
const api = useUserApi(i18n);
return useReadOnlyStore<HouseholdSummary>("household", store, loading, initialized, api.households);
return useReadOnlyStore<HouseholdSummary>("household", store, loading, api.households);
};
export const usePublicHouseholdStore = function (groupSlug: string, i18n?: Composer) {
const api = usePublicExploreApi(groupSlug, i18n).explore;
return useReadOnlyStore<HouseholdSummary>("household-public", store, publicLoading, publicInitialized, api.households);
return useReadOnlyStore<HouseholdSummary>("household-public", store, publicLoading, api.households);
};

View File

@@ -5,12 +5,10 @@ import { useUserApi } from "~/composables/api";
const store: Ref<MultiPurposeLabelOut[]> = ref([]);
const loading = ref(false);
const initialized = ref(false);
export function resetLabelStore() {
store.value = [];
loading.value = false;
initialized.value = false;
}
export const useLabelData = function () {
@@ -24,5 +22,5 @@ export const useLabelData = function () {
export const useLabelStore = function (i18n?: Composer) {
const api = useUserApi(i18n);
return useStore<MultiPurposeLabelOut>("label", store, loading, initialized, api.multiPurposeLabels);
return useStore<MultiPurposeLabelOut>("label", store, loading, api.multiPurposeLabels);
};

View File

@@ -5,16 +5,12 @@ import { usePublicExploreApi, useUserApi } from "~/composables/api";
const store: Ref<RecipeTag[]> = ref([]);
const loading = ref(false);
const initialized = ref(false);
const publicLoading = ref(false);
const publicInitialized = ref(false);
export function resetTagStore() {
store.value = [];
loading.value = false;
initialized.value = false;
publicLoading.value = false;
publicInitialized.value = false;
}
export const useTagData = function () {
@@ -27,10 +23,10 @@ export const useTagData = function () {
export const useTagStore = function (i18n?: Composer) {
const api = useUserApi(i18n);
return useStore<RecipeTag>("tag", store, loading, initialized, api.tags);
return useStore<RecipeTag>("tag", store, loading, api.tags);
};
export const usePublicTagStore = function (groupSlug: string, i18n?: Composer) {
const api = usePublicExploreApi(groupSlug, i18n).explore;
return useReadOnlyStore<RecipeTag>("tag", store, publicLoading, publicInitialized, api.tags);
return useReadOnlyStore<RecipeTag>("tag", store, publicLoading, api.tags);
};

View File

@@ -9,16 +9,12 @@ interface RecipeToolWithOnHand extends RecipeTool {
const store: Ref<RecipeTool[]> = ref([]);
const loading = ref(false);
const initialized = ref(false);
const publicLoading = ref(false);
const publicInitialized = ref(false);
export function resetToolStore() {
store.value = [];
loading.value = false;
initialized.value = false;
publicLoading.value = false;
publicInitialized.value = false;
}
export const useToolData = function () {
@@ -33,10 +29,10 @@ export const useToolData = function () {
export const useToolStore = function (i18n?: Composer) {
const api = useUserApi(i18n);
return useStore<RecipeTool>("tool", store, loading, initialized, api.tools);
return useStore<RecipeTool>("tool", store, loading, api.tools);
};
export const usePublicToolStore = function (groupSlug: string, i18n?: Composer) {
const api = usePublicExploreApi(groupSlug, i18n).explore;
return useReadOnlyStore<RecipeTool>("tool", store, publicLoading, publicInitialized, api.tools);
return useReadOnlyStore<RecipeTool>("tool", store, publicLoading, api.tools);
};

View File

@@ -5,12 +5,10 @@ import { useUserApi } from "~/composables/api";
const store: Ref<IngredientUnit[]> = ref([]);
const loading = ref(false);
const initialized = ref(false);
export function resetUnitStore() {
store.value = [];
loading.value = false;
initialized.value = false;
}
export const useUnitData = function () {
@@ -25,5 +23,5 @@ export const useUnitData = function () {
export const useUnitStore = function (i18n?: Composer) {
const api = useUserApi(i18n);
return useStore<IngredientUnit>("unit", store, loading, initialized, api.units);
return useStore<IngredientUnit>("unit", store, loading, api.units);
};

View File

@@ -6,12 +6,10 @@ import { BaseCRUDAPIReadOnly } from "~/lib/api/base/base-clients";
const store: Ref<UserSummary[]> = ref([]);
const loading = ref(false);
const initialized = ref(false);
export function resetUserStore() {
store.value = [];
loading.value = false;
initialized.value = false;
}
class GroupUserAPIReadOnly extends BaseCRUDAPIReadOnly<UserSummary> {
@@ -23,5 +21,5 @@ export const useUserStore = function (i18n?: Composer) {
const requests = useRequests(i18n);
const api = new GroupUserAPIReadOnly(requests);
return useReadOnlyStore<UserSummary>("user", store, loading, initialized, api, { orderBy: "full_name" });
return useReadOnlyStore<UserSummary>("user", store, loading, api, { orderBy: "full_name" });
};

View File

@@ -98,7 +98,7 @@
"dashboard": "Kontrollpanel",
"delete": "Slett",
"disabled": "Deaktivert",
"done": "Done",
"done": "Ferdig",
"download": "Last ned",
"duplicate": "Dupliser",
"edit": "Rediger",
@@ -169,7 +169,7 @@
"token": "Token",
"tuesday": "Tirsdag",
"type": "Type",
"undo": "Undo",
"undo": "Angre",
"update": "Oppdater",
"updated": "Oppdatert",
"upload": "Last opp",
@@ -334,7 +334,7 @@
"no-meal-plan-defined-yet": "Ingen måltidsplan er definert ennå",
"no-meal-planned-for-today": "Ingen måltid planlagt i dag",
"numberOfDaysPast-hint": "Number of days in the past on page load",
"numberOfDaysPast-label": "Default Days in the Past",
"numberOfDaysPast-label": "Standard antall dager tilbake",
"numberOfDays-hint": "Antall dager på sideinnlasting",
"numberOfDays-label": "Standard antall dager",
"only-recipes-with-these-categories-will-be-used-in-meal-plans": "Kun oppskrifter med disse kategoriene vil bli brukt i måltidsplaner",
@@ -392,7 +392,7 @@
"nextcloud": {
"description": "Overfør data fra en Nextcloud Cookbook-instans",
"description-long": "Oppskrifter fra Nextcloud kan importeres fra en zip-fil som inneholder dataene lagret i Nextcloud. Se eksempelet på mappestrukture nedenfor for å sikre at oppskriftene kan importeres.",
"title": "Nextcloud Cookbook"
"title": "Nextcloud kokebok"
},
"copymethat": {
"description-long": "Mealie kan importere oppskrifter fra Copy Me That. Eksporter oppskrifter i HTML-format, last deretter opp .zip-filen under.",
@@ -917,7 +917,7 @@
"quantity": "Antall: {0}",
"shopping-list": "Handleliste",
"shopping-lists": "Handlelister",
"add-item": "Add item",
"add-item": "Legg til produkt",
"food": "Matvare",
"note": "Notat",
"label": "Etikett",
@@ -943,7 +943,7 @@
"are-you-sure-you-want-to-uncheck-all-items": "Er du sikker på at du vil fjerne valg av alle elementer?",
"are-you-sure-you-want-to-delete-checked-items": "Er du sikker på at du vil slette alle valgte elementer?",
"no-shopping-lists-found": "Ingen handlelister funnet",
"item-checked-off": "Checked off {item}"
"item-checked-off": "Avkrysset av {item}"
},
"sidebar": {
"all-recipes": "Alle oppskrifter",
@@ -1478,10 +1478,10 @@
"max-length": "Må være minst minst {max} tegn må bestå av maks {max} tegn"
},
"announcements": {
"announcements": "Announcements",
"all-announcements": "All announcements",
"mark-all-as-read": "Mark All as Read",
"show-announcements-from-mealie": "Show announcements from Mealie",
"announcements": "Kunngjøringer",
"all-announcements": "Alle kunngjøringer",
"mark-all-as-read": "Marker alle som lest",
"show-announcements-from-mealie": "Vis kunngjøringer fra Mealie",
"show-announcements-setting-description": "Whether or not you want to allow users to see announcements from Mealie. When enabled users can still opt-out from seeing them in their user settings"
}
}

View File

@@ -943,7 +943,7 @@
"are-you-sure-you-want-to-uncheck-all-items": "Ali res ne želite izbrati vseh elementov?",
"are-you-sure-you-want-to-delete-checked-items": "Ali ste prepričani, da želite izbrisati vse izbrane elemente?",
"no-shopping-lists-found": "Ni nakupovalnih seznamov",
"item-checked-off": "Checked off {item}"
"item-checked-off": "Odkljukano {item}"
},
"sidebar": {
"all-recipes": "Vsi recepti",

View File

@@ -571,8 +571,8 @@
"delicata squash": {
"aliases": [],
"description": "",
"name": "delicata squash",
"plural_name": "delicata squashes"
"name": "delikat squash",
"plural_name": "delikate squasher"
},
"Frisée": {
"aliases": [
@@ -980,7 +980,7 @@
"aliases": [],
"description": "",
"name": "kastanjepuré",
"plural_name": "chestnut purée"
"plural_name": "kastanjepuré"
},
"prickly pear": {
"aliases": [],
@@ -1045,7 +1045,7 @@
"sweet lime": {
"aliases": [],
"description": "",
"name": "sweet lime",
"name": "søt lime",
"plural_name": "sweet limes"
},
"custard-apple": {
@@ -1873,8 +1873,8 @@
"melon seed": {
"aliases": [],
"description": "",
"name": "melon seed",
"plural_name": "melon seeds"
"name": "melonfrø",
"plural_name": "melonfrø"
},
"lotus seed": {
"aliases": [],
@@ -2003,48 +2003,48 @@
"parmesan cheese": {
"aliases": [],
"description": "",
"name": "parmesan cheese",
"plural_name": "parmesan cheese"
"name": "parmesanost",
"plural_name": "parmesanost"
},
"cheddar cheese": {
"aliases": [
"cheddar cheese"
"cheddarost"
],
"description": "",
"name": "cheddar cheese",
"plural_name": "cheddar cheese"
"name": "cheddarost",
"plural_name": "cheddarost"
},
"cream cheese": {
"aliases": [],
"description": "",
"name": "cream cheese",
"plural_name": "cream cheese"
"name": "kremost",
"plural_name": "kremost"
},
"sharp cheddar cheese": {
"aliases": [
"sharp cheddar"
"skarp cheddarost"
],
"description": "",
"name": "sharp cheddar cheese",
"plural_name": "sharp cheddar cheese"
"name": "skarp cheddarost",
"plural_name": "skarp cheddarost"
},
"cheese": {
"aliases": [],
"description": "",
"name": "cheese",
"plural_name": "cheese"
"name": "ost",
"plural_name": "ost"
},
"mozzarella cheese": {
"aliases": [],
"description": "",
"name": "mozzarella cheese",
"plural_name": "mozzarella cheese"
"name": "mozzarellaost",
"plural_name": "mozzarellaost"
},
"feta cheese": {
"aliases": [],
"description": "",
"name": "feta cheese",
"plural_name": "feta cheese"
"name": "fetaost",
"plural_name": "fetaost"
},
"ricotta cheese": {
"aliases": [],
@@ -2073,14 +2073,14 @@
"goat cheese": {
"aliases": [],
"description": "",
"name": "goat cheese",
"plural_name": "goat cheese"
"name": "geitost",
"plural_name": "geitost"
},
"fresh mozzarella cheese": {
"aliases": [],
"description": "",
"name": "fresh mozzarella cheese",
"plural_name": "fresh mozzarella cheese"
"name": "fersk mozzarellaost",
"plural_name": "fersk mozzarellaost"
},
"swis cheese": {
"aliases": [],

View File

@@ -15,7 +15,6 @@ from mealie.schema.recipe.recipe_timeline_events import (
RecipeTimelineEventPagination,
RecipeTimelineEventUpdate,
TimelineEventImage,
TimelineEventType,
)
from mealie.schema.recipe.request_helpers import UpdateImageResponse
from mealie.schema.response.pagination import PaginationQuery
@@ -51,10 +50,6 @@ class RecipeTimelineEventsController(BaseCrudController):
override=RecipeTimelineEventOut,
)
for event in response.items:
if event.event_type == TimelineEventType.system.value:
event.subject = self.t(event.subject)
response.set_pagination_guides(router.url_path_for("get_all"), q.model_dump())
return response
@@ -88,10 +83,7 @@ class RecipeTimelineEventsController(BaseCrudController):
@router.get("/{item_id}", response_model=RecipeTimelineEventOut)
def get_one(self, item_id: UUID4):
event = self.mixins.get_one(item_id)
if event.event_type == TimelineEventType.system.value:
event.subject = self.t(event.subject)
return event
return self.mixins.get_one(item_id)
@router.put("/{item_id}", response_model=RecipeTimelineEventOut)
def update_one(self, item_id: UUID4, data: RecipeTimelineEventUpdate):

View File

@@ -224,7 +224,7 @@ class RecipeService(RecipeServiceBase):
timeline_event_data = RecipeTimelineEventCreate(
user_id=new_recipe.user_id,
recipe_id=new_recipe.id,
subject="recipe.recipe-created",
subject=self.t("recipe.recipe-created"),
event_type=TimelineEventType.system,
timestamp=new_recipe.created_at or datetime.now(UTC),
)

View File

@@ -8,7 +8,6 @@ from mealie.schema.recipe.recipe_timeline_events import (
RecipeTimelineEventOut,
RecipeTimelineEventPagination,
TimelineEventImage,
TimelineEventType,
)
from mealie.schema.recipe.request_helpers import UpdateImageResponse
from tests.utils import api_routes
@@ -342,42 +341,6 @@ def test_create_recipe_with_timeline_event(
assert events_pagination.items
def test_recipe_created_system_event_is_translated(
api_client: TestClient,
unique_user: TestUser,
recipes: list[Recipe],
):
recipe = recipes[0]
params = {"queryFilter": f"recipe_id={recipe.id}"}
# fetch events in French — the system "recipe created" event should be translated
fr_headers = {**unique_user.token, "Accept-Language": "fr-FR"}
events_response = api_client.get(api_routes.recipes_timeline_events, params=params, headers=fr_headers)
assert events_response.status_code == 200
events_pagination = RecipeTimelineEventPagination.model_validate(events_response.json())
system_events = [e for e in events_pagination.items if e.event_type == TimelineEventType.system.value]
assert system_events, "expected at least one system event for a newly created recipe"
for event in system_events:
assert event.subject == "Recette créée", f"expected French translation, got: {event.subject!r}"
# also verify the individual GET endpoint translates correctly
single_response = api_client.get(api_routes.recipes_timeline_events_item_id(event.id), headers=fr_headers)
assert single_response.status_code == 200
single_event = RecipeTimelineEventOut.model_validate(single_response.json())
assert single_event.subject == "Recette créée"
# fetch the same events in English — subject should be the English string
en_headers = {**unique_user.token, "Accept-Language": "en-US"}
events_response = api_client.get(api_routes.recipes_timeline_events, params=params, headers=en_headers)
events_pagination = RecipeTimelineEventPagination.model_validate(events_response.json())
system_events = [e for e in events_pagination.items if e.event_type == TimelineEventType.system.value]
for event in system_events:
assert event.subject == "Recipe Created", f"expected English string, got: {event.subject!r}"
@pytest.mark.parametrize("use_other_household_user", [True, False])
def test_invalid_recipe_id(
api_client: TestClient, unique_user: TestUser, h2_user: TestUser, use_other_household_user: bool