feat(34-02): i18n collection and item components

- CollectionView: t() for empty state, stats labels, filter text
- ItemCard: t() for tooltip title attributes
- ItemForm: t() for all form labels, placeholders, error messages, buttons
- CategoryPicker: t() for search placeholder, create button, no results
- CategoryFilterDropdown: t() for all categories label, search placeholder
- CategoryHeader: t() for save/cancel buttons, item count
- WeightSummaryCard: t() for title, legend labels, view mode toggle
- ItemPicker: t() for panel title, empty state, action buttons
- ManualEntryForm: t() for all form labels, error messages, submit button
- LinkToGlobalItem: t() for all UI chrome strings
- ProfileSection: t() for all form labels, messages, buttons
- collection.json: added new keys for categoryPicker, categoryFilter, weightSummary, itemPicker, categoryHeader, linkToGlobal, manualEntry, profileSection, itemCard
This commit is contained in:
2026-04-18 13:35:59 +02:00
parent 8634ca41c1
commit c5af1247c0
12 changed files with 180 additions and 87 deletions

View File

@@ -1,4 +1,5 @@
import { useNavigate } from "@tanstack/react-router";
import { useTranslation } from "react-i18next";
import { useFormatters } from "../hooks/useFormatters";
import { useDuplicateItem } from "../hooks/useItems";
import { LucideIcon } from "../lib/iconData";
@@ -51,6 +52,7 @@ export function ItemCard({
linkTo,
priceCurrency,
}: ItemCardProps) {
const { t } = useTranslation("collection");
const { weight, price } = useFormatters();
const navigate = useNavigate();
const openExternalLink = useUIStore((s) => s.openExternalLink);
@@ -102,7 +104,7 @@ export function ItemCard({
}
}}
className={`absolute top-2 ${productUrl ? "right-10" : "right-2"} z-10 w-6 h-6 flex items-center justify-center rounded-full bg-gray-100/80 text-gray-400 hover:bg-blue-100 hover:text-blue-500 opacity-0 group-hover:opacity-100 transition-all cursor-pointer`}
title="Duplicate item"
title={t("itemCard.duplicateItem")}
>
<svg
className="w-3.5 h-3.5"
@@ -134,7 +136,7 @@ export function ItemCard({
}
}}
className={`absolute top-2 ${onRemove ? "right-10" : "right-2"} z-10 w-6 h-6 flex items-center justify-center rounded-full bg-gray-100/80 text-gray-400 hover:bg-gray-200 hover:text-gray-600 opacity-0 group-hover:opacity-100 transition-all cursor-pointer`}
title="Open product link"
title={t("itemCard.openProductLink")}
>
<svg
className="w-3.5 h-3.5"
@@ -166,7 +168,7 @@ export function ItemCard({
}
}}
className="absolute top-2 right-2 z-10 w-6 h-6 flex items-center justify-center rounded-full bg-gray-100/80 text-gray-400 hover:bg-red-100 hover:text-red-500 opacity-0 group-hover:opacity-100 transition-all cursor-pointer"
title="Remove from setup"
title={t("itemCard.removeFromSetup")}
>
<svg
className="w-3.5 h-3.5"