Overview
When working with Right-to-Left (RTL) languages like Hebrew and Arabic in forms, mixing in Left-to-Right (LTR) content such as brand names, URLs, or punctuation can cause unexpected display issues. This guide explains how to properly handle mixed direction text to ensure correct display.
Common Display Issues
Text may appear in unexpected orders or orientations when:
- Mixing brand names (LTR) within RTL text
- Including URLs or links in RTL content
- Using hyphens or special characters
- Combining numbers with RTL text
Solution
Basic Implementation
When mixing LTR content into a RTL language, wrap any LTR text in a span element with the dir="ltr"
attribute:
שם החברה שלך: <span dir="ltr">Company Name</span>
Real-World Example
For opt-in text containing mixed content:
Original (problematic):
סמן את תיבות הסימון להלן אם אינך מעוניין לקבל מ-Company Name ומהשותפים המורשים שלה...
Corrected version:
סמן את תיבות הסימון להלן אם אינך מעוניין לקבל מ־<span dir="ltr">Company Name</span> ומ<a href="https://www.company-name.com" target="_blank">השותפים המורשים שלה</a>...
Best Practices
Always Mark as LTR:
- Company names in Western characters
- URLs and email addresses
- Product codes or model numbers
- Hyphens and special characters when used with LTR text
Handling Links
For links containing URLs within the display text:
<a href="https://www.company-name.com" dir="ltr">www.company-name.com</a>
Testing
Before deploying, verify:
- Text appears in the correct order
- Links and URLs are properly aligned
- Numbers and special characters display correctly
- Content looks correct in both desktop and mobile views
Troubleshooting
If text still appears incorrectly:
- Check that all LTR content is wrapped in
<span dir="ltr">
tags - Ensure special characters and hyphens are included within the LTR spans when appropriate
Need Help?
If you encounter issues with RTL/LTR text direction in your forms, our technical support team is here to help. Create a new support ticket and we'll assist you with ensuring your content displays correctly for all users, regardless of language requirements.