diff --git a/hooks/useRefreshMetadata.ts b/hooks/useRefreshMetadata.ts index 598f9d47..2b0ee08e 100644 --- a/hooks/useRefreshMetadata.ts +++ b/hooks/useRefreshMetadata.ts @@ -2,12 +2,14 @@ import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client"; import { getItemRefreshApi } from "@jellyfin/sdk/lib/utils/api"; import { useMutation, useQueryClient } from "@tanstack/react-query"; import { useAtom } from "jotai"; +import { useTranslation } from "react-i18next"; import { toast } from "sonner-native"; import { apiAtom } from "@/providers/JellyfinProvider"; export const useRefreshMetadata = (item: BaseItemDto) => { const queryClient = useQueryClient(); const [api] = useAtom(apiAtom); + const { t } = useTranslation(); const type = "item"; const refreshMetadataMutation = useMutation({ @@ -19,12 +21,12 @@ export const useRefreshMetadata = (item: BaseItemDto) => { } }, onSuccess: () => { - toast.success("Metadata refresh triggered"); + toast.success(t("metadata.refresh_triggered")); queryClient.invalidateQueries({ queryKey: [type, item.Id] }); }, onError: (error) => { console.error("Failed to refresh metadata:", error); - toast.error("Failed to refresh metadata"); + toast.error(t("metadata.refresh_failed")); }, }); diff --git a/translations/en.json b/translations/en.json index 148c08c9..240d5639 100644 --- a/translations/en.json +++ b/translations/en.json @@ -511,5 +511,9 @@ "library": "Library", "custom_links": "Custom Links", "favorites": "Favorites" + }, + "metadata": { + "refresh_triggered": "Metadata refresh triggered", + "refresh_failed": "Failed to refresh metadata" } }