chore: Add built-in internationalization to button dropdown filtering - #4884
Conversation
There was a problem hiding this comment.
Pull request overview
Adds internal i18n support for ButtonDropdown filtering-related strings by wiring the component to useInternalI18n and introducing new message keys across the supported locales.
Changes:
- Introduces new
button-dropdownmessage keys (filteringResultsText,noMatch, andi18nStrings.filteringItemAriaDescription) across locale catalogs. - Updates ButtonDropdown to resolve
filteringResultsTextandfilteringItemAriaDescriptionvia the internal i18n hook. - Adds unit tests validating i18n-provider fallback vs prop override behavior for the new strings.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/i18n/messages/all.en.json | Adds button-dropdown i18n strings (EN). |
| src/i18n/messages/all.en-GB.json | Adds button-dropdown i18n strings (EN-GB). |
| src/i18n/messages/all.de.json | Adds button-dropdown i18n strings (DE). |
| src/i18n/messages/all.es.json | Adds button-dropdown i18n strings (ES). |
| src/i18n/messages/all.fr.json | Adds button-dropdown i18n strings (FR). |
| src/i18n/messages/all.it.json | Adds button-dropdown i18n strings (IT). |
| src/i18n/messages/all.pt-BR.json | Adds button-dropdown i18n strings (PT-BR). |
| src/i18n/messages/all.tr.json | Adds button-dropdown i18n strings (TR). |
| src/i18n/messages/all.id.json | Adds button-dropdown i18n strings (ID). |
| src/i18n/messages/all.ko.json | Adds button-dropdown i18n strings (KO). |
| src/i18n/messages/all.ja.json | Adds button-dropdown i18n strings (JA). |
| src/i18n/messages/all.zh-CN.json | Adds button-dropdown i18n strings (ZH-CN). |
| src/i18n/messages/all.zh-TW.json | Adds button-dropdown i18n strings (ZH-TW). |
| src/i18n/messages/all.ar.json | Adds button-dropdown i18n strings (AR). |
| src/i18n/messages-types.ts | Adds button-dropdown namespace typing for new message keys/format args. |
| src/button-dropdown/index.tsx | Resolves filtering strings through useInternalI18n. |
| src/button-dropdown/tests/button-dropdown-i18n.test.tsx | Adds tests for i18n-provider fallback and prop precedence. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| filteringResultsText, | ||
| format => (matchesCount, totalCount) => format({ matchesCount, totalCount }) | ||
| )} | ||
| noMatch={noMatch} |
There was a problem hiding this comment.
Fine for now; thinking about having the string accept a react node as fallback but that can come in a different PR.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4884 +/- ##
=======================================
Coverage 97.64% 97.64%
=======================================
Files 958 958
Lines 31238 31250 +12
Branches 11530 11537 +7
=======================================
+ Hits 30501 30513 +12
- Misses 690 730 +40
+ Partials 47 7 -40 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Description
The translations were around for a while, just forgot to integrate it into the components.
Related links, issue #, if available: n/a
How has this been tested?
Unit tests.
Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md.CONTRIBUTING.md.Security
checkSafeUrlfunction.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.