WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@Jayant-1
Copy link

Add RTL and Indic Script Support

fixes #1259
This PR adds comprehensive support for Right-to-Left (RTL) languages and proper rendering of Indic scripts in the Lingo.dev SDK.

Features

1. Script Configuration System

  • Added i18n-scripts.json with metadata for:
    • RTL/LTR direction settings
    • Script family identifiers
    • Font family configurations for optimal rendering

2. Utility Functions (scriptConfig.ts)

  • Script configuration loading and parsing
  • Direction detection and validation
  • Dynamic style generation based on language

3. React Integration

  • Added useScriptStyle hook for easy React integration
  • Automatic script and direction detection
  • Dynamic style application for different languages

4. New Components

  • LocalizedText: For rendering text with proper script styling
  • LocalizedContent: For rendering HTML content with script support

- Add Nepali translation in readme/ne.md
- Update i18n.json to include 'ne' in target languages
- Add Odia translation in readme/or.md
- Update i18n.json to include 'or' in target languages
- Add Marathi translation in readme/mr.md
- Update i18n.json to include 'mr' in target languages

Closes lingodotdev#1256
- Add Sinhala translation in readme/si.md
- Update i18n.json to include 'si' in target languages
- Use proper Sinhala script and terminology
- Add i18n-scripts.json configuration for script and direction metadata
- Add scriptConfig utility functions for handling RTL and script-specific styling
- Add React hook (useScriptStyle) for easy integration
- Add LocalizedText and LocalizedContent components
- Support for RTL languages (Arabic, Hebrew, Persian)
- Support for Indic scripts (Devanagari, Bengali, Sinhala)
- Add proper font family configurations
Copy link
Contributor

Copilot AI left a 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 adds comprehensive support for Right-to-Left (RTL) languages and Indic scripts to the Lingo.dev SDK, addressing issue #1259. The implementation includes a configuration system, utility functions, React hooks, and components for proper rendering of different scripts.

Key changes:

  • Script configuration system with direction, script family, and font family metadata
  • Utility functions and React hooks for automatic script detection and style application
  • New React components for rendering localized text and HTML content

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
config/i18n-scripts.json Defines script configurations (direction, font families) for RTL and Indic languages
i18n.json Extends target locale entries with script and direction metadata
packages/sdk/src/utils/scriptConfig.ts Utility functions for loading and applying script configurations
packages/sdk/src/hooks/useScriptStyle.ts React hooks for script style detection and application
packages/sdk/src/components/LocalizedText.tsx React components for rendering localized content with proper script styling
readme/si.md Sinhala translation of the README
readme/or.md Oriya/Odia translation of the README
readme/ne.md Nepali translation of the README
readme/mr.md Marathi translation of the README

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sumitsaurabh927
Copy link
Contributor

Hey @Jayant-1 please go through the comments and resolve the merge conflicts. Also ensure that you've read and are following the guidelines laid out in our contributor's guide.

Copy link
Author

@Jayant-1 Jayant-1 left a comment

Choose a reason for hiding this comment

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

Fix: MD file.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 1, 2025

Hey @Jayant-1! Just checking in - are you still working on this PR? We noticed there are some comments that may need addressing. If you need more time, no problem! Just let us know. If we don't hear back within a week, we'll close this to keep the repo tidy, but you can always reopen when ready.

@Jayant-1
Copy link
Author

Jayant-1 commented Dec 4, 2025

Thanks for the reminder! Yes, I’m still working on this PR.
I’ll address the pending comments and push the necessary updates shortly.
Please keep the PR open — I’ll complete the remaining fixes soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE REQUEST] RTL ( right to left) + Indic Script Auto-Detection for proper text rendering

2 participants