rtl-internationalization
БесплатноБез исполняемых скриптовНе проверенRight-to-left (RTL) layout and bidirectional text support for Hebrew, Arabic, Persian, and Urdu interfaces. Use when building UI that must support RTL…
от Mindrally★ 323 звезды на GitHubОб этом скилле
RTL (Right-to-Left) Internationalization
Supporting RTL languages such as Hebrew, Arabic, Persian, and Urdu requires building layouts with direction-agnostic CSS and treating text direction as a first-class, runtime-switchable property rather than a fixed assumption baked into left/right styles.
Workflow for Making a UI RTL-Safe
- Audit for physical properties — Search the codebase for
margin-left/right,padding-left/right,left/rightpositioning,text-align: left/right, and Tailwind classes likeml-*,mr-*,pl-*,pr-*,left-*,right-*. - Convert to logical properties — Replace each physical property/class with its logical equivalent (
margin-inline-start,ms-*, etc.) so the browser flips it automatically based ondir. - Set direction at the root — Apply
dir="rtl"(ordir="auto") on<html>or a top-level container, driven by the active locale, not hardcoded per component. - Handle mixed-script text — Wrap user-generated or interpolated strings that may differ in direction from the surrounding text with
<bdi>. - Audit icons and directional components — Mirror arrows, chevrons, and back/forward buttons; leave non-directional icons (search, settings, home) unmirrored; reverse carousels, sliders, and progress bars.
- Externalize all strings — Route every user-facing string through a translation function and use
IntlAPIs for numbers, currency, and dates instead of manual formatting. - Test in RTL — Render the app with
dir="rtl"and real RTL content (not just mirrored LTR placeholder text) and visually verify every screen.
Logical CSS Properties
Always use CSS logical properties instead of physical ones — logical properties resolve to the correct physical side automatically based on the element's direction and writing-mode, so the same stylesheet works for LTR and RTL without duplication.
| Physical (avoid) | Logical (use) |
|---|---|
margin-left |
margin-inline-start |
margin-right |
margin-inline-end |
padding-left |
padding-inline-start |
padding-right |
padding-inline-end |
left |
inset-inline-start |
right |
inset-inline-end |
border-left |
border-inline-start |
border-right |
border-inline-end |
text-align: left |
text-align: start |
text-align: right |
text-align: end |
/* Before: breaks in RTL */
.card {
margin-left: 1rem;
padding-right: 1.5rem;
border-left: 2px solid var(--border);
text-align: left;
}
/* After: direction-agnostic */
.card {
margin-inline-start: 1rem;
padding-inline-end: 1.5rem;
border-inline-start: 2px solid var(--border);
text-align: start;
}
Tailwind CSS Logical Classes
Use Tailwind's logical utilities instead of the directional (l/r) ones:
ms-4instead ofml-4(margin-inline-start)me-4instead ofmr-4(margin-inline-end)ps-4instead ofpl-4(padding-inline-start)pe-4instead ofpr-4(padding-inline-end)start-0instead ofleft-0(inset-inline-start)end-0instead ofright-0(inset-inline-end)text-startinstead oftext-lefttext-endinstead oftext-right
<!-- Before -->
<div class="ml-4 pr-6 text-left">...</div>
<!-- After -->
<div class="ms-4 pe-6 text-start">...</div>
React Native Logical Properties
React Native's Yoga layout engine also supports logical properties — use them instead of Left/Right variants:
paddingStart/paddingEndinstead ofpaddingLeft/paddingRightmarginStart/marginEndinstead ofmarginLeft/marginRightborderStartWidth/borderEndWidthinstead ofborderLeftWidth/borderRightWidthstart/endinstead ofleft/rightin absolute positioning
const styles = StyleSheet.create({
row: {
flexDirection: 'row',
paddingStart: 16,
paddingEnd: 16,
},
badge: {
position: 'absolute',
end: 8, // flips automatically with I18nManager.isRTL
top: 8,
},
})
Bidirectional Text Safety
Wrap text whose direction may differ from its surrounding context — usernames, product codes, file paths, or any user-generated content interpolated into a translated sentence — with <bdi> so the browser's bidi algorithm isolates it correctly.
<p>User <bdi>{userName}</bdi> posted a comment</p>
<p>Order number: <bdi>{orderCode}</bdi> has shipped</p>
Without <bdi>, a Latin-script username embedded in an Arabic sentence (or vice versa) can visually reorder surrounding punctuation and neighboring words.
Directional Icons and Components
- Mirror directional icons in RTL mode: arrows, chevrons, back/forward/next/previous buttons, and the "reply" icon in mail/chat UIs.
- Do not mirror non-directional icons: home, settings, search, print, trash, checkmarks, and icons of real-world objects (a clock face, a phone).
- Reverse the direction of carousels, sliders, and progress bars in RTL so "next" still corresponds to the reading direc
Установить rtl-internationalization в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл rtl-internationalization?
Right-to-left (RTL) layout and bidirectional text support for Hebrew, Arabic, Persian, and Urdu interfaces. Use when building UI that must support RTL languages, converting physical CSS/Tailwind properties to logical ones, handling mixed-direction (bidi) text, mirroring directional icons, or testing an app with dir="rtl".
Как установить скилл rtl-internationalization?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл rtl-internationalization запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic