Skip to content

Conversation

@peterlipt
Copy link
Member

  • Unified FileCard: Replaced disparate file displays with a standardized, reusable component across all pages.
  • I18n Cleanup: Removed redundant locale props and standardized usage of the useTranslate hook.

… and file type icon logic into `FileIcon` component.
…tor `LanguageProvider`, and update reminder translations with a new `EmptyState` component.
…ok and add new translation keys to dictionaries.
…ionary keys, and add corresponding translations.
…nowledge base pages, and remove redundant locale props from reminder and decision components.
@peterlipt peterlipt self-assigned this Dec 25, 2025
@vercel
Copy link

vercel bot commented Dec 25, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
ehk Ready Ready Preview, Comment Dec 26, 2025 11:21am

@peterlipt peterlipt linked an issue Dec 25, 2025 that may be closed by this pull request
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the codebase to unify file display components and standardize internationalization (i18n) handling. The changes introduce a reusable FileCard component, implement a custom useTranslate hook for accessing dictionary translations, and remove redundant locale props from server components.

Key changes:

  • Introduced useTranslate hook for client-side translation lookup from centralized dictionaries
  • Created reusable FileCard, PageHeader, PageLoader, and EmptyState components
  • Expanded dictionary files (hu.json, en.json) with comprehensive translation keys
  • Removed locale parameters from multiple server components and data-fetching functions
  • Updated LanguageProvider to pass dictionary to context for use by useTranslate hook

Reviewed changes

Copilot reviewed 60 out of 63 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
src/utils/normalizeString.ts New utility for string normalization (removes accents, lowercases)
src/hooks/useTranslate.ts New hook providing dictionary-based translation with legacy fallback support
src/dictionaries/hu.json, en.json Significantly expanded with translation keys for all pages
src/components/common/FileCard.tsx Enhanced reusable component for file display with view/download actions
src/components/common/PageHeader.tsx New generic page header component
src/components/common/PageLoader.tsx New loading spinner component with optional text
src/components/common/EmptyState.tsx New empty state component
src/components/common/LanguageProvider.tsx Updated to include dictionary in context and improved language toggle
src/components/regulations/* Updated to use FileCard and useTranslate hook
src/app/(app)/[lang]/*/page.tsx Multiple pages refactored to use getDictionary and PageHeader
src/app/(app)/[lang]//components/ Client components updated to use useTranslate hook
src/lib/payload-cms.ts Removed unused locale parameter from getRelatedNews
Comments suppressed due to low confidence (1)

src/app/(app)/[lang]/hirek/[slug]/lib/news-utils.ts:44

  • The translateTags function signature was changed to remove the lang parameter, but the implementation now just returns an empty array with a comment saying it should use the function from @/lib/utils. This is clearly broken - the function should either be removed entirely (and imports updated to use the one from @/lib/utils), or properly implemented. Currently, any code calling this function will receive an empty array instead of translated tags.
export function translateTags(tags: string[] | undefined): string[] {
  if (!tags) return []
  // This is a placeholder since the original translateTags was imported from @/lib/utils
  // but we are creating a dedicated utils file. If translateTags is generic, 
  // we should import it here or just import it directly in components.
  // Checking original code: it was imported from @/lib/utils.
  // So we don't need to copy it here, just use it from @/lib/utils in components.
  return [] 
}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…`t()` calls, adding dictionary keys, and ensuring `useTranslate` handles non-string inputs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reafcator code

2 participants