Skip to content
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

🌍 fix: Enhance i18n Support & Optimize Category Handling #5866

Merged
merged 5 commits into from
Feb 14, 2025

Conversation

rubentalstra
Copy link
Collaborator

@rubentalstra rubentalstra commented Feb 14, 2025

Summary

This PR improves internationalization (i18n) support by adding new translations and refining category management with localization-friendly keys.

Closes: #5846
Closes: #5858
Closes: #5865

Docs: LibreChat-AI/librechat.ai#235

🔍 Changes

  • 🌎 i18n Enhancements

    • Added Estonian (et-EE) language support across multiple files.
    • Standardized Chinese variants:
      • zh-Hans (Simplified)
      • zh-Hant (Traditional)
    • Improved fallback logic in i18n.ts for better language detection.
    • Updated UI category labels to use translation keys instead of hardcoded values.
  • 🏷️ Category Management

    • Refactored category values (Categories.js) to use com_ui_ prefixed keys.
    • Updated useCategories.tsx to use type-safe localization keys (TranslationKeys).
  • 🛠️ Refactoring & Optimization

    • 📌 Improved detection of unused translation keys in .github/workflows/i18n-unused-keys.yml, now scanning the api/ directory.
    • 🧹 Removed redundant memoizedLocalize function in useLocalize.ts for better maintainability.
  • 📦 Dependency Update

    • Added i18next-browser-languagedetector to package.json.

✅ Status

  • Ready for review 🚀

Change Type

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • This change requires a documentation update

Testing

Test Configuration:

  • Ensured i18n translations load correctly with new keys and fallback logic.
  • Verified unused key detection includes api/ directory in GitHub workflow.
  • Tested category labels reflect correct translations across the UI.

Checklist

  • My code adheres to this project's style guidelines.
  • I have performed a self-review of my own code.
  • I have commented in any complex areas of my code.
  • I have made pertinent documentation changes.
  • My changes do not introduce new warnings.
  • Local unit tests pass with my changes.
  • Any changes dependent on mine have been merged and published in downstream modules.
  • A pull request for updating the documentation has been submitted.

@rubentalstra rubentalstra self-assigned this Feb 14, 2025
@rubentalstra rubentalstra added 🌍 i18n Language 🔧 fix Bug fixes and code patches labels Feb 14, 2025
@rubentalstra rubentalstra added the 🔥 hotfix Urgent production fixes label Feb 14, 2025
@rubentalstra rubentalstra changed the title 🤖 fix: Enhance i18n Support & Optimize Category Handling 🌍 fix: Enhance i18n Support & Optimize Category Handling Feb 14, 2025
@rubentalstra rubentalstra marked this pull request as draft February 14, 2025 10:46
@rubentalstra rubentalstra removed the request for review from danny-avila February 14, 2025 10:49
@rubentalstra rubentalstra marked this pull request as ready for review February 14, 2025 11:08
@danny-avila danny-avila merged commit 04c2a5a into main Feb 14, 2025
7 checks passed
@danny-avila danny-avila deleted the fix/Translation-issues-added-Estonian branch February 14, 2025 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔧 fix Bug fixes and code patches 🔥 hotfix Urgent production fixes 🌍 i18n Language
Projects
None yet
2 participants