Skip to content

feat(i18n): add language switcher and remove unused locales (Closes #89)#95

Merged
priyankarpal merged 4 commits into
reactplay:mainfrom
mdnm18:feat/89-language-switcher
Oct 23, 2025
Merged

feat(i18n): add language switcher and remove unused locales (Closes #89)#95
priyankarpal merged 4 commits into
reactplay:mainfrom
mdnm18:feat/89-language-switcher

Conversation

@mdnm18
Copy link
Copy Markdown
Contributor

@mdnm18 mdnm18 commented Oct 21, 2025

Resolves #89. Adds a new LanguageSwitcher component to the navbar. Updates i18n config to support only en, bn, and hi, removing fr.

Summary

This PR resolves Issue #89 by adding a new LanguageSwitcher component to the navbar. It also updates the i18n configuration to support only English, Bengali, and Hindi, removing French and Spanish as requested.

Changes

  • Created new LanguageSwitcher component in src/components/custom/language-switcher/index.tsx.

  • Added the required dropdown-menu component from shadcn/ui.

  • Updated src/config/i18n/navigation.ts to set locales to ["en", "bn", "hi"].

  • Added the LanguageSwitcher component to both the desktop and mobile views in src/components/common/navbar/index.tsx.

  • Deleted src/config/i18n/content/fr.json (and es.json if it existed) as it's no longer supported.

  • Added LanguageSwitcher translation keys to en.json, bn.json, and hi.json for accessibility.

Testing

I tested these changes locally by:

  1. Running npx shadcn@latest add dropdown-menu to install the required UI component.

  2. Running the project using docker-compose up.

  3. Verified the new globe icon is present in the navbar (both desktop and mobile).

  4. Clicked the icon and confirmed the dropdown shows only "English", "বাংলা", and "हिन्दी".

  5. Clicked each language and verified the site's language and URL updated correctly (e.g., to /bn).

  6. Manually navigated to http://localhost:3000/fr, which correctly resulted in a 404 Not Found page.

Related Issue

Resolves #89

Notes

No special notes. This completes the feature request and the i18n cleanup.

Resolves reactplay#89. Adds a new LanguageSwitcher component to the navbar. Updates i18n config to support only en, bn, and hi, removing fr.
@netlify
Copy link
Copy Markdown

netlify Bot commented Oct 21, 2025

Deploy Preview for reactkolkata ready!

Name Link
🔨 Latest commit 6207888
🔍 Latest deploy log https://app.netlify.com/projects/reactkolkata/deploys/68f920c08139e10008f290e6
😎 Deploy Preview https://deploy-preview-95--reactkolkata.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@priyankarpal
Copy link
Copy Markdown
Member

@mdnm18 there are some conflicts please fix

Copy link
Copy Markdown
Member

@priyankarpal priyankarpal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also need to fix these

Image

@mdnm18
Copy link
Copy Markdown
Contributor Author

mdnm18 commented Oct 22, 2025

@priyankarpal
I have fixed these in my last pr for solving the issue #90

@priyankarpal
Copy link
Copy Markdown
Member

but there are some conflicts @mdnm18 in this pr

@mdnm18
Copy link
Copy Markdown
Contributor Author

mdnm18 commented Oct 22, 2025

@priyankarpal , I have resolved all the merge conflicts. This PR should be ready to merge now.

Comment thread src/config/i18n/content/hi.json Outdated
Comment thread src/config/i18n/content/hi.json Outdated
@priyankarpal I've accepted the typo fixes. This should be all set!

Co-authored-by: Aditya Ray <96347576+adi-ray@users.noreply.github.com>
Signed-off-by: MD NAYAJ MONDAL <md.n.m.pius18@gmail.com>
@mdnm18
Copy link
Copy Markdown
Contributor Author

mdnm18 commented Oct 22, 2025

@priyankarpal I've resolved all the merge conflicts and accepted the typo suggestions from @adi-ray. And I think this PR should be ready to go now! If you have any suggestions please do let me know.

Copy link
Copy Markdown
Contributor

@adi-ray adi-ray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀🚀

Copy link
Copy Markdown
Member

@priyankarpal priyankarpal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@priyankarpal priyankarpal merged commit 9a37518 into reactplay:main Oct 23, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Add language switcher dropdown/icon for locale selection

3 participants