Closed MaiCVCR closed 1 month ago
The changes introduce internationalization (i18n) support to the application by adding a new configuration file, next-i18next.config.js
, which sets up locales and disables automatic locale detection. The main configuration file, next.config.js
, is updated to merge these i18n settings. New dependencies for i18next
and react-i18next
are added to package.json
. Localization JSON files for English, Spanish, and Portuguese are created, providing translations for various UI strings. Components are modified to utilize the useTranslation
hook, allowing dynamic text translation based on user-selected languages.
File | Change Summary |
---|---|
apps/web/next-i18next.config.js |
Added configuration for i18n with default locale "en" and supported locales ["en", "es", "pt"]. |
apps/web/next.config.js |
Updated to import and merge nextI18NextConfig into the main configuration object. |
apps/web/package.json |
Added dependencies: i18next (version ^23.15.1 ) and react-i18next (version ^15.0.2 ). |
apps/web/public/locales/en/common.json |
Created English localization file with key-value pairs for UI strings. |
apps/web/public/locales/es/common.json |
Created Spanish localization file with key-value pairs for UI strings. |
apps/web/public/locales/pt/common.json |
Created Portuguese localization file with key-value pairs for UI strings. |
apps/web/src/app/marketplace/page.tsx |
Integrated useTranslation hook and replaced static carouselData with localized data using t function. |
apps/web/src/app/page.tsx |
Integrated useTranslation hook and replaced hardcoded strings with translatable keys. |
apps/web/src/i18n.ts |
Introduced i18n functionality, initializing i18next with language settings and loading translation resources. |
packages/ui/src/pageHeader.tsx |
Integrated useTranslation hook and replaced static "Logout" text with translatable string. |
sequenceDiagram
participant User
participant App
participant i18n
User->>App: Select Language
App->>i18n: Load Translations
i18n-->>App: Provide Translations
App->>User: Display Translated UI
🐰 "In the land of code where we play,
New translations brighten the day.
With locales set, and texts to share,
Coffee lovers rejoice with flair!
From English to Spanish, Portuguese too,
Our app speaks your language, just for you!" ☕✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Description
This Pull Request adds the initial configuration for i18n to enable multi-language support in the application.
Key features
Type of Change
Testing
Manual Testing
Summary by CodeRabbit
Release Notes
New Features
Improvements
Dependencies
i18next
andreact-i18next
for improved internationalization capabilities.