Conversation
ccbd398 to
402bcca
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds internationalization (i18n) support by introducing a translations feature that allows customization of UI text strings throughout the component library.
Changes:
- Added a
Translationstype andtranslatehelper function to support optional translation overrides with English fallbacks - Integrated translations into all user-facing UI components including filters, sort controls, product cards, and zero results displays
- Created comprehensive test coverage and Storybook documentation demonstrating Spanish translations
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/types.ts | Defines the Translations type with all translatable UI string keys and adds translations prop to context/provider interfaces |
| src/utils/helpers.ts | Implements the translate function that handles translation lookups with fallback to English defaults |
| src/utils/index.ts | Exports the new helpers module |
| src/hooks/useCioPlpProvider.ts | Integrates translations into the provider context |
| src/components/Sort/Sort.tsx | Applies translations to sort-related UI strings |
| src/components/ProductCard/ProductCard.tsx | Translates "Add to Cart" button text |
| src/components/Groups/Groups.tsx | Applies translations to category-related strings |
| src/components/Filters/FilterRangeSlider.tsx | Translates range filter labels ("from"/"to") |
| src/components/Filters/FilterOptionsList.tsx | Translates "Show All"/"Show Less" buttons |
| src/components/CioPlpGrid/ZeroResults/ZeroResults.tsx | Applies translations to all zero results messaging |
| src/components/CioPlpGrid/CioPlpGrid.tsx | Translates results count and filter button text |
| src/stories/components/CioPlp/Translations.stories.tsx | Provides Spanish translation example in Storybook |
| src/stories/components/CioPlp/Translations Code Examples.mdx | Documents translation feature usage and available keys |
| src/constants.ts | Adds documentation constant for translations feature |
| spec/utils/helpers.test.ts | Comprehensive unit tests for the translate function |
| cspell.json | Adds Spanish and French words to spell checker dictionary |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Sort: 'Ordenar', | ||
| from: 'desde', | ||
| to: 'hasta', | ||
| Categories: 'Categorias', |
There was a problem hiding this comment.
Corrected spelling of 'Categorias' to 'Categorías' (missing accent).
| Categories: 'Categorias', | |
| Categories: 'Categorías', |
| Sort: 'Ordenar', | ||
| from: 'desde', | ||
| to: 'hasta', | ||
| Categories: 'Categorias', |
There was a problem hiding this comment.
Corrected spelling of 'Categorias' to 'Categorías' (missing accent).
| Categories: 'Categorias', | |
| Categories: 'Categorías', |
| "Sorry, we didn't find:": 'Lo sentimos, no encontramos:', | ||
| 'Sorry, we were unable to find what you were looking for.': | ||
| 'Lo sentimos, no pudimos encontrar lo que buscabas.', | ||
| 'Check for typos': 'Revisa errores tipograficos', |
There was a problem hiding this comment.
Corrected spelling of 'tipograficos' to 'tipográficos' (missing accent).
| 'Check for typos': 'Revisa errores tipograficos', | |
| 'Check for typos': 'Revisa errores tipográficos', |
| 'Lo sentimos, no pudimos encontrar lo que buscabas.', | ||
| 'Check for typos': 'Revisa errores tipograficos', | ||
| 'Use fewer keywords': 'Usa menos palabras clave', | ||
| 'Broaden your search terms': 'Amplia tus terminos de busqueda', |
There was a problem hiding this comment.
Corrected spelling of 'terminos' to 'términos' (missing accent).
| 'Broaden your search terms': 'Amplia tus terminos de busqueda', | |
| 'Broaden your search terms': 'Amplia tus términos de busqueda', |
| 'Lo sentimos, no pudimos encontrar lo que buscabas.', | ||
| 'Check for typos': 'Revisa errores tipograficos', | ||
| 'Use fewer keywords': 'Usa menos palabras clave', | ||
| 'Broaden your search terms': 'Amplia tus terminos de busqueda', |
There was a problem hiding this comment.
Corrected spelling of 'busqueda' to 'búsqueda' (missing accent).
| 'Broaden your search terms': 'Amplia tus terminos de busqueda', | |
| 'Broaden your search terms': 'Amplia tus terminos de búsqueda', |
| Sort: 'Ordenar', | ||
| from: 'desde', | ||
| to: 'hasta', | ||
| Categories: 'Categorias', |
There was a problem hiding this comment.
Corrected spelling of 'Categorias' to 'Categorías' (missing accent).
| Categories: 'Categorias', | |
| Categories: 'Categorías', |
| "Sorry, we didn't find:": 'Lo sentimos, no encontramos:', | ||
| 'Sorry, we were unable to find what you were looking for.': | ||
| 'Lo sentimos, no pudimos encontrar lo que buscabas.', | ||
| 'Check for typos': 'Revisa errores tipograficos', |
There was a problem hiding this comment.
Corrected spelling of 'tipograficos' to 'tipográficos' (missing accent).
| 'Check for typos': 'Revisa errores tipograficos', | |
| 'Check for typos': 'Revisa errores tipográficos', |
| 'Lo sentimos, no pudimos encontrar lo que buscabas.', | ||
| 'Check for typos': 'Revisa errores tipograficos', | ||
| 'Use fewer keywords': 'Usa menos palabras clave', | ||
| 'Broaden your search terms': 'Amplia tus terminos de busqueda', |
There was a problem hiding this comment.
Corrected spelling of 'terminos' to 'términos' (missing accent).
| 'Broaden your search terms': 'Amplia tus terminos de busqueda', | |
| 'Broaden your search terms': 'Amplia tus términos de busqueda', |
| 'Lo sentimos, no pudimos encontrar lo que buscabas.', | ||
| 'Check for typos': 'Revisa errores tipograficos', | ||
| 'Use fewer keywords': 'Usa menos palabras clave', | ||
| 'Broaden your search terms': 'Amplia tus terminos de busqueda', |
There was a problem hiding this comment.
Corrected spelling of 'busqueda' to 'búsqueda' (missing accent).
| 'Broaden your search terms': 'Amplia tus terminos de busqueda', | |
| 'Broaden your search terms': 'Amplia tus terminos de búsqueda', |
Code Review Results✅ StrengthsWell-structured translation feature with comprehensive test coverage, clean implementation, and excellent documentation including Storybook examples. 🚨 Critical IssuesNone found.
|
Pull Request Checklist
Before you submit a pull request, please make sure you have to following:
PR Type
What kind of change does this PR introduce?