Skip to content

feat(search): i18n with Trans for result summary, remove dead loadingAvailableTags state#1144

Merged
perber merged 2 commits into
mainfrom
feat/search-i18n
Jun 9, 2026
Merged

feat(search): i18n with Trans for result summary, remove dead loadingAvailableTags state#1144
perber merged 2 commits into
mainfrom
feat/search-i18n

Conversation

@perber

@perber perber commented Jun 9, 2026

Copy link
Copy Markdown
Owner

No description provided.

…AvailableTags state

- Replace split 'Found / result(s) for' sentence with a single pluralized
  Trans key so translators can control word order
- Install react-i18next and wire initReactI18next into i18n.ts
- Remove loadingAvailableTags state (was always false, never set to true)
- Add t() helper to SearchResultCard for namespace consistency
Copilot AI review requested due to automatic review settings June 9, 2026 16:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a dedicated search i18n namespace to the LeafWiki UI search feature, using react-i18next’s <Trans> for the result count summary and converting various hard-coded search strings to localized keys. It also removes the previous “loading available tags” UI/state handling.

Changes:

  • Introduce search translations (src/locales/en/search.json) and register them in the shared i18n setup.
  • Localize search UI labels and result summary (including pluralization and bold count via <Trans>).
  • Add react-i18next dependency and wire initReactI18next into i18n initialization.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
ui/leafwiki-ui/src/locales/en/search.json Adds English translation keys for search input, tags, results summary, and card labels.
ui/leafwiki-ui/src/lib/i18n.ts Registers the new search namespace and initializes react-i18next integration.
ui/leafwiki-ui/src/features/search/SearchResultCard.tsx Localizes “Page/Section” kind label using the new search namespace.
ui/leafwiki-ui/src/features/search/Search.tsx Replaces hard-coded strings with i18n keys and uses <Trans> for the pluralized result summary.
ui/leafwiki-ui/package.json Adds react-i18next dependency.
ui/leafwiki-ui/package-lock.json Locks react-i18next and transitive deps.
Files not reviewed (1)
  • ui/leafwiki-ui/package-lock.json: Language not supported

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

Comment thread ui/leafwiki-ui/src/features/search/SearchResultCard.tsx
Comment thread ui/leafwiki-ui/src/features/search/Search.tsx Outdated
Comment thread ui/leafwiki-ui/src/locales/en/search.json
@perber
perber force-pushed the feat/search-i18n branch from 33bfd7e to 3a09fbf Compare June 9, 2026 16:40
@perber
perber merged commit 2f31c64 into main Jun 9, 2026
9 checks passed
@perber
perber deleted the feat/search-i18n branch June 9, 2026 16:56
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.

2 participants