Overview
ShahiTranslate Pro provides comprehensive support for RTL (Right-to-Left) languages like Arabic, Hebrew, Persian, and Urdu. This includes automatic layout mirroring, text direction handling, and visual adjustments.
What is RTL?
RTL vs LTR
LTR (Left-to-Right):
- English, Spanish, French, German, most European languages
- Text flows left to right
- UI elements align left
- Arabic, Hebrew, Persian, Urdu, Yiddish
- Text flows right to left
- UI elements align right
- Entire layout mirrors
- Detects RTL language selection
- Adds
dir="rtl"attribute to HTML - Loads RTL-specific CSS
- Mirrors layout appropriately
- Adjusts text alignment
- Plugin loads
assets/css/rtl.cssfor RTL languages - Provides layout mirroring
- Adjusts text alignment
- Fixes common RTL issues
- ✅ Text alignment (left → right)
- ✅ Padding (left → right, right → left)
- ✅ Margin (left → right, right → left)
- ✅ Float (left → right, right → left)
- ✅ Navigation menus
- ✅ Sidebars
- ✅ Form fields
- ✅ Buttons
- ✅ Icons with directional meaning
- ⬜ Images (unless explicitly mirrored)
- ⬜ Videos
- ⬜ Logos (usually kept as-is)
- ⬜ Maps
- ⬜ Graphs and charts
- English words in Arabic sentences
- Numbers in RTL text
- URLs and emails
- Arabic numerals (0-9) maintain LTR direction
- Arabic-Indic numerals (٠-٩) flow RTL
- Plugin preserves number direction
- Opening: ”
- Closing: ”
- Opening: «
- Closing: »
- Default “top-right” becomes “top-left” in RTL
- Plugin automatically adjusts
- Can override if needed
- Flag images remain as-is
- Don’t flip flag graphics
- Position adjusts, image doesn’t
- LTR: Opens downward-right
- RTL: Opens downward-left (automatic)
- LTR: Label left of field
- RTL: Label right of field
- Product image gallery (left → right)
- Product info sidebar
- Add to Cart button
- Price alignment
- LTR: $100
- RTL (varies by locale): 100 ریال or ريال 100
- Elementor has built-in RTL support
- Plugin works seamlessly with Elementor
- Columns reverse automatically
- Text widgets align properly
- Good built-in RTL support
- Minor adjustments may be needed
- Divi has RTL support
- May need theme RTL stylesheet
- Limited built-in RTL support
- Requires custom CSS
- ✅ Text aligns right
- ✅ Layout mirrors correctly
- ✅ Navigation menu reversed
- ✅ Sidebar on correct side
- ✅ Forms align properly
- ✅ Buttons positioned correctly
- ✅ Images don’t overlap text
- ✅ Icons face correct direction
- Open DevTools (F12)
- Go to Elements tab
- Find
tag - Verify
dir="rtl"attribute - Check applied CSS rules
- Test on actual devices if possible
- Phones may render differently
- Tablets have unique considerations
- Check on various screen sizes
- iOS (Safari)
- Android (Chrome)
- Desktop browsers (Chrome, Firefox, Safari, Edge)
- RTL support not enabled
- Theme forces LTR direction
- Conflicting CSS
- Enable RTL in settings
- Check theme supports RTL:
- Add to functions.php:
- Clear all caches
- Theme CSS has high specificity
- Inline styles overriding
- Theme hardcodes sidebar position
- Flexbox/Grid not mirroring
- Icons are images (don’t auto-flip)
- Font icons need manual reversal
- BiDi algorithm confusion
- Formatting issues
- Code snippets in RTL page
- Technical content
- URLs and emails
- Amiri
- Cairo
- Tajawal
- Almarai
- Noto Sans Arabic
- Don’t wait until launch to test RTL
- Test with actual RTL speakers
- Check on multiple devices
- Prefer
start/endoverleft/right - Use modern CSS when possible
- Plan for future RTL support
- Not everything should flip
- Logos stay as-is
- Photos don’t mirror
- Data visualizations may not mirror
- Use appropriate fonts for RTL
- Ensure good readability
- Test font sizes
- Don’t just mirror layout
- Adapt content culturally
- Use local examples
- Respect cultural norms
- RTL Tester: Browser extensions to force RTL
- BiDi Checker: Validate BiDi implementation
- CSS Analyzer: Check RTL-ready CSS
- W3C BiDi Guidelines
- Unicode Bidirectional Algorithm
- CSS Writing Modes Specification
- RTL.CSS on GitHub
- Stack Overflow RTL tag
- WordPress RTL Forum
- Language Switcher Options
- Translation Methods
- Custom CSS Styling
- Theme Compatibility
RTL (Right-to-Left):
RTL Languages Supported
ShahiTranslate Pro automatically detects and handles:
| Language | Code | Native Name | Script |
|———-|——|————-|——–|
| Arabic | ar | العربية | Arabic |
| Hebrew | he | עברית | Hebrew |
| Persian | fa | فارسی | Persian |
| Urdu | ur | اردو | Arabic |
| Yiddish | yi | ייִדיש | Hebrew |
| Pashto | ps | پښتو | Arabic |
| Sindhi | sd | سنڌي | Arabic |
| Kurdish | ku | کوردی | Arabic |
| Uyghur | ug | ئۇيغۇرچە | Arabic |
Automatic RTL Detection
How It Works
Plugin automatically:
No Manual Configuration Required
HTML Changes
LTR Language (English):
`html
`RTL Language (Arabic):
`html
`CSS Loading
Automatic CSS Injection:
Enabling RTL Support
Basic Setup
Location: ShahiTranslate Pro → Settings → Languages → RTL Settings
`
✅ Enable RTL Support
RTL Languages: Automatically detected (ar, he, fa, ur)
✅ Auto-detect RTL direction
✅ Load RTL stylesheet
Save Changes
`
Manual RTL Configuration
If Auto-detection Doesn’t Work:
`
Settings → Languages → RTL Settings
Manual RTL Languages:
✅ Arabic (ar)
✅ Hebrew (he)
✅ Persian (fa)
✅ Urdu (ur)
Add custom: [language code]
`
What Gets Mirrored
Layout Elements
Automatically Mirrored:
Not Mirrored:
Text Direction
Text Alignment:
`css
/ LTR /
text-align: left;
/ RTL (automatically converted) /
text-align: right;
`
Reading Direction:
`css
/ LTR /
direction: ltr;
/ RTL /
direction: rtl;
`
Navigation
Menu Structure:
LTR Menu:
`
[Home] [About] [Services] [Contact]
`
RTL Menu (mirrored):
`
[Contact] [Services] [About] [Home]
`
Implementation: Automatic, no changes needed
Sidebar Position
LTR Layout:
`
+—————-+—–+
| | |
| Content | Bar |
| | |
+—————-+—–+
`
RTL Layout (mirrored):
`
+—–+—————-+
| | |
| Bar | Content |
| | |
+—–+—————-+
`
RTL CSS
Built-in RTL Styles
Plugin includes comprehensive RTL CSS (assets/css/rtl.css):
Example Styles:
`css
/ Body direction /
body.rtl {
direction: rtl;
text-align: right;
}
/ Float reversal /
.rtl .float-start {
float: right !important;
}
.rtl .float-end {
float: left !important;
}
/ Text alignment /
.rtl .text-start {
text-align: right !important;
}
.rtl .text-end {
text-align: left !important;
}
/ Margin and padding /
.rtl .ms-auto {
margin-right: auto !important;
margin-left: 0 !important;
}
.rtl .me-auto {
margin-left: auto !important;
margin-right: 0 !important;
}
`
Custom RTL CSS
Adding Your Own RTL Styles:
Location: ShahiTranslate Pro → Settings → Advanced → Custom RTL CSS
`css
/ Example: Fix header alignment /
.rtl #header .logo {
float: right;
margin-left: 20px;
margin-right: 0;
}
/ Example: Reverse icon direction /
.rtl .icon-arrow-right::before {
content: “←”;
}
.rtl .icon-arrow-left::before {
content: “→”;
}
/ Example: Breadcrumb separators /
.rtl .breadcrumb-separator::after {
content: “←”;
}
`
Theme-Specific RTL
If Theme Doesn’t Support RTL:
Many themes lack RTL support. Add fixes:
`css
/ Container adjustments /
.rtl .container {
direction: rtl;
}
/ Grid system fixes /
.rtl .row {
direction: rtl;
}
.rtl [class*=”col-“] {
float: right;
}
/ Navigation menu /
.rtl .menu {
text-align: right;
}
.rtl .menu-item {
float: right;
}
/ Forms /
.rtl input,
.rtl textarea,
.rtl select {
text-align: right;
}
/ Buttons /
.rtl .button-with-icon {
padding-right: 30px;
padding-left: 15px;
}
.rtl .button-with-icon .icon {
right: auto;
left: 10px;
}
`
Mixed Content Handling
LTR Text in RTL Context
The Problem:
Solution: Unicode Bidirectional Algorithm
Automatic Handling:
Plugin uses Unicode BiDi to correctly display mixed content:
Example:
`
Arabic text: مرحبا بكم في WordPress
Renders correctly with “WordPress” LTR within RTL text
`
Numbers and Dates
Numbers:
Dates:
`
LTR: January 15, 2024
RTL: ١٥ يناير ٢٠٢٤
`
Implementation:
`php
// Automatic date localization
Settings → Languages → Date Format
✅ Use localized date format
✅ Use native numerals for RTL languages
`
Quotes and Punctuation
English Quotes (LTR):
Arabic Quotes (RTL):
Plugin Handling:
`
Settings → Languages → RTL → Punctuation
✅ Localize quote marks
✅ Adjust punctuation spacing
`
Language Switcher in RTL
Switcher Position
RTL Considerations:
Configuration:
`
Settings → Switcher → Position
LTR Position: Top-right
RTL Position: Automatic mirror (top-left)
Or: Manual override → Top-right (if want same corner)
`
Flag Direction
Flags Don’t Mirror:
Dropdown Direction
Dropdown Opening:
Form Handling
Form Fields
Automatic Adjustments:
`html
`
Labels
Label Position:
Automatic Alignment
Placeholders
Placeholder Text:
`html
`
Text aligns automatically based on language
Checkboxes and Radio Buttons
Position Reversal:
`
LTR:
☐ Option 1
☐ Option 2
RTL:
Option 1 ☐
Option 2 ☐
`
CSS:
`css
.rtl input[type=”checkbox”],
.rtl input[type=”radio”] {
float: right;
margin-left: 10px;
margin-right: 0;
}
`
WooCommerce RTL
Product Pages
Automatic Adjustments:
CSS Provided:
`css
.rtl .woocommerce-product-gallery {
float: right;
}
.rtl .summary {
float: left;
}
.rtl .price {
text-align: right;
}
`
Cart and Checkout
Table Alignment:
`
LTR:
Product | Price | Quantity | Total
RTL:
Total | Quantity | Price | Product
`
Currency Symbol:
Configuration:
`
WooCommerce → Settings → General → Currency Options
Currency Position: Right (for RTL) or Left (for LTR)
Plugin adjusts automatically per language
`
Page Builder Support
Elementor
RTL Support:
Manual Adjustments:
`
Elementor → Section Settings → Advanced → Custom CSS
Add RTL-specific styles if needed
`
Beaver Builder
RTL Support:
Custom Module CSS:
`
Settings → Advanced → Custom RTL CSS for modules
`
Divi
RTL Support:
Configuration:
`
Divi → Theme Options → General → Enable Right to Left Language Support
✅ Enable
`
WPBakery
RTL Support:
Solution:
`css
/ WPBakery RTL fixes /
.rtl .vc_row {
direction: rtl;
}
.rtl .vccolumncontainer {
float: right;
}
.rtl .wpb_wrapper {
text-align: right;
}
`
Testing RTL Layout
Visual Inspection
Checklist:
Browser DevTools
Testing in Chrome:
Force RTL for Testing:
`javascript
// In browser console
document.documentElement.setAttribute(‘dir’, ‘rtl’);
document.body.classList.add(‘rtl’);
`
Real Device Testing
Important:
Test Devices:
Common RTL Issues
Issue: Layout Doesn’t Mirror
Symptom: RTL language selected but layout stays LTR
Causes:
Solutions:
`
– Look for rtl.css in theme
– May need to create one
addthemesupport(‘rtl’);
`
Issue: Text Aligns Left
Symptom: Text in RTL language aligns left instead of right
Causes:
Solutions:
`css
/ Force text alignment /
.rtl * {
text-align: right !important;
}
/ Or more specific /
.rtl p,
.rtl li,
.rtl div {
text-align: right !important;
}
`
Issue: Sidebar Wrong Side
Symptom: Sidebar stays on right in RTL layout
Causes:
Solutions:
`css
/ Float-based layouts /
.rtl #sidebar {
float: left;
}
.rtl #content {
float: right;
}
/ Flexbox layouts /
.rtl .container {
flex-direction: row-reverse;
}
/ Grid layouts /
.rtl .grid-container {
direction: rtl;
}
`
Issue: Icons Wrong Direction
Symptom: Arrows and directional icons don’t flip
Causes:
Solutions:
`css
/ Flip directional icons /
.rtl .icon-arrow-right {
transform: scaleX(-1);
}
/ Or use different icon /
.rtl .icon-arrow-right::before {
content: “\f053”; / fa-arrow-left /
}
`
Issue: Numbers Display Incorrectly
Symptom: Phone numbers, dates show reversed
Causes:
Solutions:
`html
+1-555-1234
`
Advanced RTL Features
Logical Properties
Modern CSS (works automatically):
`css
/ Instead of /
margin-left: 10px;
margin-right: 20px;
/ Use logical properties /
margin-inline-start: 10px;
margin-inline-end: 20px;
/ Automatically adjusts for RTL /
`
Browser Support: Modern browsers (IE11 not supported)
BiDi Override
When Needed:
Implementation:
`html
هذا نص عربي
code@example.com
نص عربي يستمر
`
Custom Fonts for RTL
Arabic Font Recommendations:
Loading Fonts:
`css
@import url(‘https://fonts.googleapis.com/css2?family=Tajawal&display=swap’);
.rtl body {
font-family: ‘Tajawal’, sans-serif;
}
`
Configuration:
`
Settings → Languages → RTL → Typography
Custom Font Family: Tajawal
Load Google Font: ✅ Yes
`
Best Practices
1. Test Early and Often
2. Use Logical CSS Properties
3. Don’t Over-Mirror
4. Consider Typography
5. Cultural Localization
RTL Resources
Tools
Documentation
Communities
Next Steps
Share this article
Still need help?
Our support team is ready to assist you with personalized guidance for your workspace.