diff --git a/frontend/src/components/MaterialSidebar.tsx b/frontend/src/components/MaterialSidebar.tsx index 95b96f6..6bfb7dd 100644 --- a/frontend/src/components/MaterialSidebar.tsx +++ b/frontend/src/components/MaterialSidebar.tsx @@ -8,13 +8,13 @@ import TagLink from '@/components/TagLink' import { fetchMaterialTagTree, parseMaterialFilter } from '@/lib/materials' import { materialsKeys } from '@/lib/queryKeys' import { cn } from '@/lib/utils' +import { useUITranslation } from '@/lib/useUITranslation' import type { CSSProperties, Dispatch, FC, ReactNode, SetStateAction } from 'react' import type { MaterialFilter, MaterialSidebarTag, Tag } from '@/types' const FILTERS: MaterialFilter[] = ['missing', 'present', 'any'] -const FILTER_LABELS: Record = { present: '有', missing: '無', any: '全' } const px = (value: string): number => { @@ -96,24 +96,27 @@ const updateMaterialFilterQuery = ( const MaterialFilterButtons: FC<{ materialFilter: MaterialFilter onChange: (materialFilter: MaterialFilter) => void }> = ( { materialFilter, onChange }, -) => ( -
- - {FILTERS.map (value => ( - ))} -
) +) => { + const { label } = useUITranslation ('materials') + return ( +
+ + {FILTERS.map (value => ( + ))} +
) +} const MaterialTreeNode: FC<{ @@ -385,6 +388,7 @@ const MobileMaterialTreeNode: FC<{ depth?: number const MaterialSidebar: FC = () => { + const { label } = useUITranslation ('materials') const locale = useLocale () const location = useLocation () const navigate = useLocaleNavigate () @@ -498,10 +502,12 @@ const MaterialSidebar: FC = () => { materialFilter={materialFilter} onChange={handleFilterChange}/> {isLoading && ( -

読込中……

)} +

+ {label ('shared:messages.loadingEllipsis')} +

)} {isError && (

- タグ一覧の取得に失敗しました. + {label ('sidebar.error')}

)} {(!isLoading && !isError) && (