Automatically detects Arabic/Persian text in ChatGPT, Gemini, and Grok and applies Right-to-Left (RTL) formatting.
Auto RTL for AI Chatbots: The Fix for Persian & Arabic Reading right-to-left languages like Persian (Farsi) and Arabic in default left-to-right (LTR) AI chat interfaces is a broken experience. Punctuation lands on the wrong side, sentence structure visually collapses, and reading long responses becomes a chore.
This script automatically detects RTL characters in AI responses and instantly corrects the text direction and alignment, restoring natural readability.
Features Zero-Click Activation: Runs automatically in the background. If the AI replies in Persian or Arabic, the text instantly aligns to the right and switches to dir="rtl".
Smart Detection: Uses Unicode ranges to target paragraphs containing Arabic/Persian scripts without affecting English text.
Code-Block Safe: Explicitly ignores
and blocks so your programming outputs remain strictly LTR and correctly formatted.
High-Performance: Uses a lightweight MutationObserver to flip text chunks instantly as they stream onto the page, avoiding layout thrashing or browser lag.
Supported Platforms
ChatGPT (chatgpt.com)
Google Gemini (gemini.google.com)
Grok (x.com/i/grok)
Pro-Tip: Vazirmatn Font Integration
Proper localization isn't just about direction; it's about typography. The script includes a commented-out line to apply the Vazirmatn font. If you value clean Persian web typography, simply open the script in Tampermonkey and uncomment this line:
JavaScript
// el.style.fontFamily = 'Vazirmatn, Tahoma, Arial, sans-serif';
About the Author
Built by Amir Reza Tamandani (TMAN) to enforce proper RTL layout rules and better localization for the frontend web community.