-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
chore(orama): translate search box #7799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this 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 updates the search box to support full translation via a custom dictionary in the new @orama/react-components
v0.8.0.
- Flattened and expanded search/chat keys in the English locale file
- Bumped
@orama/react-components
from v0.7.0 to v0.8.0 - Exposed
translationKeys
and passed adictionary
prop into theOramaSearchBox
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
packages/i18n/locales/en.json | Flattened searchBox.placeholder and added new translation keys |
apps/site/package.json | Updated @orama/react-components version to ^0.8.0 |
apps/site/components/Common/Search/utils.ts | Added translationKeys array for mapping dictionary entries |
apps/site/components/Common/Search/index.tsx | Imported translationKeys ; wired dictionary into Orama components |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (3)
packages/i18n/locales/en.json:241
- The placeholder text ends with a comma instead of an ellipsis; it should match the original
"Start typing..."
.
"searchPlaceholder": "Start typing,",
apps/site/components/Common/Search/index.tsx:86
- [nitpick] This inline
Object.fromEntries(...)
is recreated on every render. Consider memoizing the dictionary withuseMemo
to avoid unnecessary recomputation.
dictionary={Object.fromEntries(translationKeys.map(key => [key, t(`components.search.${key}`)]))}
apps/site/components/Common/Search/index.tsx:86
- New dictionary-driven behavior should be covered by a unit or integration test to verify all translation keys are passed correctly.
dictionary={Object.fromEntries(translationKeys.map(key => [key, t(`components.search.${key}`)]))}
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #7799 +/- ##
=======================================
Coverage 75.46% 75.46%
=======================================
Files 101 101
Lines 8309 8309
Branches 218 218
=======================================
Hits 6270 6270
Misses 2037 2037
Partials 2 2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Lighthouse Results
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for discovering this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
neat! small nit within
Co-authored-by: Brian Muenzenmeyer <brian.muenzenmeyer@gmail.com> Signed-off-by: Aviv Keller <me@aviv.sh>
In v0.8.0 of
@orama/react-components
, we can supply a custom dictionary, allowing us to translate the search box.