feat(search): i18n with Trans for result summary, remove dead loadingAvailableTags state#1144
Merged
Conversation
…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
Contributor
There was a problem hiding this comment.
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
searchtranslations (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-i18nextdependency and wireinitReactI18nextinto 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.