-
Notifications
You must be signed in to change notification settings - Fork 23
feat: Add multi-language support (EN, KN) for UI and content #57
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
Open
mithun50
wants to merge
17
commits into
chandansgowda:main
Choose a base branch
from
mithun50:feat/i18n-multi-language-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: Add multi-language support (EN, KN) for UI and content #57
mithun50
wants to merge
17
commits into
chandansgowda:main
from
mithun50:feat/i18n-multi-language-support
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Implemented internationalization using i18next for UI strings and dynamic loading of localized JSON data for courses, course videos, and links. - Added Kannada (kn) and English (en) language options. - UI elements in Header, Footer, HomePage, CoursePage, and LinksPage are translated. - Course, video, and link content is loaded based on the selected language, with English as a fallback. - Created example translated content for Kannada. - Updated README.md with documentation for the i18n setup and contribution guidelines for translations. Known Issue: Localization for blog posts (titles, descriptions, and markdown content) is incomplete due to persistent technical difficulties in modifying `src/utils/blogUtils.ts`. The utility currently only loads default English blog content.
✅ Deploy Preview for engineeringinkannada ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Adjusted the dynamic import mechanism in HomePage, CoursePage, and LinksPage components.
The previous logic incorrectly attempted to load specific `.en.json` files as an intermediate fallback, causing a build failure when these files were not present.
The updated logic is now:
1. If the current language is non-default (e.g., 'kn'), attempt to load the language-specific JSON file (e.g., `courses.kn.json`).
2. If the language-specific file is not found OR if the current language is the default ('en'), directly load the base JSON file (e.g., `courses.json`).
This ensures that the application correctly falls back to the default English content without trying to resolve non-existent `.en.json` files, thus fixing the Netlify build error.
This commit significantly expands the internationalization features: - Added and verified `i18next-http-backend` version `^2.2.0` in `package.json`. - Translated static UI elements on the Leaderboard page. - Provided complete Kannada translations for all existing course data (`courses.kn.json`), all associated video titles (`src/data/videos/*.kn.json`), and all link page content (`links.kn.json`). - Corrected dynamic import fallback logic in `HomePage.tsx`, `CoursePage.tsx`, and `LinksPage.tsx` to prevent build errors and ensure proper fallback to default English content. - Updated `README.md` with comprehensive i18n documentation. All implemented UI translations and dynamic content loading for courses, videos, and links have been tested and function as expected with English and Kannada languages, including fallbacks. Known Issue: - Localization for blog posts (titles, descriptions, and markdown content) remains incomplete. Persistent technical difficulties were encountered while attempting to modify `src/utils/blogUtils.ts` to support loading localized blog files. Therefore, blog content will still only appear in English.
- Added a console warning in `services/github.ts` to alert developers if `VITE_GITHUB_TOKEN` is not set, which is crucial for leaderboard functionality. - Updated `README.md` to strongly emphasize the necessity of configuring `VITE_GITHUB_TOKEN` in the deployment environment for the leaderboard to load data correctly. This addresses the issue where the leaderboard might fail to load on deployed instances due to missing API token configuration, by making the requirement clearer and aiding developers in diagnosing the problem.
… updates This commit finalizes the internationalization effort and addresses leaderboard loading concerns. Key changes: - Ensured `i18next-http-backend` is correctly versioned in `package.json`. - Translated UI elements on the LeaderboardPage. - Provided complete Kannada translations for all existing course data, video titles, and link page content. - Corrected dynamic import fallback logic in page components to resolve potential build errors. - Provided code for manual update of `src/utils/blogUtils.ts` to enable blog post internationalization (loading of `metadata.[lang].json` and `content.[lang].md`). - Created translated metadata and content for the existing blog post (`blog-1.kn.json`, `blog-1.kn.md`). - Improved developer awareness for missing `VITE_GITHUB_TOKEN` for leaderboard via console warning. - Updated `README.md` with comprehensive i18n documentation and clearer instructions for `VITE_GITHUB_TOKEN`. With the manual update of `blogUtils.ts` by the user, the application now supports comprehensive English and Kannada translations across UI and content, including blogs.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implemented internationalization using i18next for UI strings and dynamic loading of localized JSON data for courses, course videos, and links.
Known Issue: Localization for blog posts (titles, descriptions, and markdown content) is incomplete due to persistent technical difficulties in modifying
src/utils/blogUtils.ts. The utility currently only loads default English blog content.