# gt-next: General Translation Next.js SDK: Right-to-Left Support URL: https://generaltranslation.com/en-US/docs/next/guides/rtl.mdx --- title: Right-to-Left Support description: Configure your Next.js app for Arabic, Hebrew, and other RTL languages --- Right-to-left (RTL) language support handles text direction and layout mirroring for languages like Arabic, Hebrew, Persian, and Urdu. GT provides automatic direction detection through the `useLocaleDirection` hook. **RTL languages:** Over 500 million people speak RTL languages including Arabic, Hebrew, Persian, and Urdu. ## Quick setup Use GT's built-in hooks to automatically detect and set text direction: {/* useLocale and useLocaleDirection work in server components as long as the component is not async */} ```tsx // app/[locale]/layout.tsx import { useLocale, useLocaleDirection, GTProvider } from 'gt-next'; export default function RootLayout({ children }) { const locale = useLocale(); // e.g. "ar" for Arabic const dir = useLocaleDirection(); // e.g. "rtl" for right-to-left return ( {children} ); } ``` That's it! GT automatically detects RTL languages and returns the correct direction. Compare with the [General Translation website](https://generaltranslation.com) in [English](https://generaltranslation.com/en-US/home) vs [Arabic](https://generaltranslation.com/ar/home) to see RTL in action.