-
Notifications
You must be signed in to change notification settings - Fork 0
Internationalization i18n #35
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
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 introduces internationalization (i18n) support to the GalacticView application by integrating the i18next library ecosystem. The implementation establishes the foundation for multi-language support by replacing hardcoded UI strings with translation keys sourced from centralized JSON files, starting with English translations.
Key Changes
- Added i18next libraries (
i18next,react-i18next,i18next-http-backend,i18next-browser-languagedetector) to enable translation functionality - Created i18n configuration in
src/i18n.jswith language detection and backend loading plugins - Updated 11 components to use the
useTranslationhook and translation keys instead of hardcoded strings
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
package.json |
Added i18next dependencies for internationalization support |
yarn.lock |
Added dependency entries for i18next packages and their transitive dependencies |
src/i18n.js |
Created i18n configuration with fallback language, debug mode, and plugin initialization |
src/main.tsx |
Imported i18n configuration to initialize translations at application startup |
public/locales/en/translation.json |
Added English translation resources with nested structure for organized key management |
src/components/FooterBar.tsx |
Replaced hardcoded footer text with translation keys |
src/components/NavigationBar.tsx |
Replaced navigation link labels with translation keys |
src/components/AgentChatWidget.tsx |
Internationalized chat widget welcome message and input placeholder |
src/components/epicdata/EpicDataCard.tsx |
Replaced card text with translation keys using string concatenation |
src/components/imageoftheday/ImageOfTheDay.tsx |
Internationalized image titles and error messages |
src/components/imageoftheday/ImageOfTheDayContainer.tsx |
Replaced loading and error messages with translation keys |
src/components/imageoftheday/ImageOfTheDayHistory.tsx |
Internationalized date picker form labels and button text |
src/components/search/SearchResults.tsx |
Replaced error message with translation key and updated comment capitalization |
src/pages/HomePage.tsx |
Internationalized month names while leaving day names and "LIVE" text hardcoded |
src/pages/SearchItemPage.tsx |
Replaced loading spinner text with translation key |
src/pages/EpicDataPostPage.tsx |
Internationalized all descriptive text and section headings for EPIC data |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request introduces internationalization (i18n) to the application, enabling support for multiple languages (starting with English) and replacing hardcoded UI text with translation keys. The main changes include integrating the
i18nextlibrary and related packages, adding translation files, and updating various UI components to use translated text.Internationalization Integration:
i18next,react-i18next,i18next-http-backend, andi18next-browser-languagedetectortopackage.jsondependencies to support translation and language detection.src/i18n.jsto initialize i18n with backend and language detector plugins.src/main.tsxto ensure translations are available throughout the app.public/locales/en/translation.json.Component Updates for Translations:
FooterBar,NavigationBar,AgentChatWidget,EpicDataCard,ImageOfTheDay,ImageOfTheDayContainer,ImageOfTheDayHistory, andSearchResultscomponents to useuseTranslationand translation keys instead of hardcoded strings. [1] [2] [3] [4] [5] [6] [7] [8]UI/UX Improvements:
These changes lay the groundwork for supporting multiple languages and improve maintainability by centralizing UI text.