Skip to content

RTL empty states and notifications

Learn how to translate and lay out Arabic empty states, banners, and toasts, with direction-aware placement and tests for hidden states.

By , Founder of Ritla

Guide13 min read

A populated Arabic screen can look finished while its empty collection still says “No proofs yet,” its retry button remains English, and its upload notification appears outside the visible area. Those messages are separate rendering paths. Reviewing the normal screen does not exercise them.

Empty states and notifications also have different jobs. An empty state explains what occupies a missing content area and what to do next. A toast reports an event without replacing that area. A banner keeps an ongoing condition visible. Translating all three through a generic message component can conceal differences in actions, persistence, and announcement behavior.

Use a fictional printmaking proof library as the example. Its collection can be empty, filtered, unavailable, or still loading; uploads can succeed or partly fail. Each condition needs a deliberate Arabic fixture, not a screenshot captured whenever a notification happens to appear.

Establish why the content area is empty#

An empty array is not enough information to choose the message. The library might have no proofs, but it might also lack permission to read them or have failed to fetch them. Show the state the application actually knows.

StateWhat the message should establishSuitable recovery
Collection has never received a proofThere is no collection content yetAdd the first proof, if permitted.
Filters match nothingThe current query has no resultsClear or change those filters.
Collection request is pendingThe result is not known yetShow a loading state without claiming emptiness.
Request failedThe application could not load the collectionRetry while preserving useful context.
Access is deniedThe reader cannot access the collectionExplain the available access path.
Final proof was removedThe collection is now emptyOffer the appropriate creation or recovery action.

Do not flash a first-use message while a request is pending just because the initial items array is empty. Keep request status separate from the resolved result. Otherwise the Arabic interface briefly promises a creation path before replacing it with existing content or a permission error.

A no-results state should preserve the query and show how to change it. A first-use state should not offer “clear filters” when no filter caused the emptiness. An access-denied state should not invite an upload that the current account cannot perform.

Give each branch its own translation keys and preview fixture. A shared layout component can still render them, but the state machine should decide the message and actions before the component handles direction. Direction styling cannot repair an incorrect explanation of why the collection is empty.

Translate the action as well as the explanation#

This first-use state belongs to the proof collection. The heading names the condition, the paragraph explains it, and the link identifies the next action.

html
<section class="proof-empty" lang="ar" dir="rtl"  aria-labelledby="proof-empty-title">  <h2 id="proof-empty-title">لا توجد طبعات تجريبية بعد</h2>  <p>أضف أول طبعة تجريبية لمراجعة تفاصيلها ومشاركتها.</p>  <a href="/ar/proofs/new">إضافة طبعة تجريبية</a></section>

The URL represents the example application's creation route; substitute the actual localized route. For an action that opens an in-page upload picker instead, use a button with the application's handler. Keep the action's semantics aligned with what it does.

The section uses a normal heading rather than an alert role. An empty state present at page load is page content. If a user applies a filter and receives no matches, the resulting status may need an announcement, but that does not make every static empty-state paragraph an urgent alert.

Inspect the whole rendered branch: heading, explanatory text, action, tooltip, accessible name, and any illustration containing text. A translated heading above an English action is still an incomplete interaction. Check custom network-error messages too; a server's default English error is not automatically suitable interface copy.

Avoid embedding the only explanation inside artwork. Keep the message in text that can wrap and be translated. A decorative proof-sheet illustration does not need horizontal reflection simply because its caption is Arabic. If an illustration communicates a directional action, review that meaning separately from its placement.

Align text according to the component's design. A short centered first-use panel can remain centered; a detailed recovery explanation with several actions may read better at inline start. There is no requirement to force every empty-state sentence against the right edge.

Let the empty state fit its real container#

An empty-state preview on an otherwise blank page does not establish that it fits the collection panel. Render it with the actual navigation, filters, heading, and surrounding controls. Those elements determine the space left for its explanation and primary action.

Avoid a fixed-height text area sized from the English sentence. Give the heading and explanation their content height, then use spacing around them to achieve the intended composition. Check Arabic dots and marks at line boundaries, including after the selected font loads. Arabic text getting cut off covers clipping that a taller outer card alone will not repair.

If an illustration consumes most of a narrow viewport, reduce or remove that decorative space before hiding the explanation or action. A first-use panel can look balanced on desktop while placing its upload action below a mobile keyboard. Verify the complete panel within the workspace, including any scrolling needed to reach that action.

Check that responsive variants select the same underlying state. A compact card should not drop the no-results explanation and display a generic first-use message simply because its layout has fewer slots. Keep state selection independent from the visual variant.

Build a banner that grows with its Arabic message#

A partial upload needs more detail than a disappearing success toast. This banner names the remaining failure and keeps retry available. Its file name is an independent text run.

html
<section class="proof-notice" lang="ar" dir="rtl"  aria-labelledby="proof-notice-title">  <div class="proof-notice__body">    <h2 id="proof-notice-title">لم يكتمل رفع الطبعات التجريبية</h2>    <p>تعذّر رفع الملف <bdi>proof-strip.tif</bdi>. أعد المحاولة.</p>    <button type="button" data-action="retry-proof">إعادة المحاولة</button>  </div>  <button class="proof-notice__dismiss" type="button"    aria-label="إخفاء إشعار الرفع" data-action="dismiss-proof-notice">    <svg viewBox="0 0 24 24" width="24" height="24"      aria-hidden="true" focusable="false">      <path d="M6 6L18 18M18 6L6 18" fill="none"        stroke="currentColor" stroke-width="2" />    </svg>  </button></section>

The application binds the retry and dismiss actions. Dismissing the banner hides the message; it does not cancel the upload, clear a failed file, or retry it. Define those operations separately.

css
.proof-notice {  display: flex;  align-items: flex-start;  gap: 0.875rem;  padding: 1rem;  border: 1px solid currentColor;  border-radius: 0.625rem;} .proof-notice__body {  flex: 1 1 auto;  min-inline-size: 0;  text-align: start;} .proof-notice__body p {  overflow-wrap: anywhere;  line-height: 1.6;} .proof-notice__dismiss {  flex: none;  padding: 0.5rem;}

The body receives the available width and can shrink instead of forcing the close control outside the card. The paragraph wraps rather than relying on a fixed notification height. The close control follows the body in source order, placing it at the row's inline end: right in English and left in Arabic.

Keep the close symbol's shape unchanged. It is not an arrow indicating progression. If the banner has a leading status icon, place and space it according to its role without reflecting every SVG in the component.

Test a multi-line heading, a long file name, and the longest translated retry label. Check that the close control stays reachable and that neither it nor the retry action overlaps the text. Increasing the card's height is appropriate; clipping the recovery instructions to preserve a compact English height is not.

Give the notification host its own direction contract#

Toasts may be mounted under a shared application root or directly under the document body. In a framework, the notification's component owner and its actual DOM ancestor can be different. Inspect the rendered host before assuming it inherits the Arabic page section.

If Arabic is declared on the document root, descendants inherit that direction unless another boundary changes it. If only the workspace section is Arabic and the host lives outside it, configure the host's lang and dir explicitly. W3C's structural direction guidance describes these boundaries.

Pass the interface locale and direction to the host, not just to the toast body. Its placement, stack controls, accessible labels, and text alignment may all depend on that state. A translated message inside an English host can still have an English dismiss label or the wrong alignment.

Decide what should happen to visible notifications during a language switch. Store event codes and interpolation values when messages need to be translated again; a string formatted once in English cannot translate itself. Clear obsolete notifications when their task or workspace is no longer relevant.

For embedded workspaces, use the owning workspace's interface direction rather than guessing from the first character of a message. A file name at the beginning of a notification should not make the entire notification host LTR.

Choose the corner, then configure the entrance separately#

The notification corner is a product choice. A centered toast can remain centered. If the design specifies inline end, it means the right corner in English and the left corner in Arabic. Do not move a deliberately physical placement without first establishing its intended relationship to the workspace.

Problem: this host always stays on the right:

css
.proof-toast-stack {  position: fixed;  right: 1rem;  bottom: 1rem;}

Better: for the same design specified at inline end:

css
.proof-toast-stack {  position: fixed;  inset-inline-end: 1rem;  inset-block-end: 1rem;  inline-size: min(26rem, calc(100vw - 2rem));  max-block-size: calc(100dvh - 2rem);  overflow-y: auto;  display: flex;  flex-direction: column;  gap: 0.75rem;  --proof-enter-x: 1.25rem;} .proof-toast-stack:dir(rtl) {  --proof-enter-x: -1.25rem;} .proof-toast--entering {  animation: proof-toast-enter 180ms ease-out;} @keyframes proof-toast-enter {  from {    opacity: 0;    transform: translateX(var(--proof-enter-x));  }  to {    opacity: 1;    transform: none;  }} @media (prefers-reduced-motion: reduce) {  .proof-toast--entering {    animation: none;  }}

Apply the entering class to a newly inserted toast. This is an entrance example; the application still manages insertion, dismissal, and stack lifetime. The host must carry or inherit the current semantic direction.

The logical inset preserves the English position and changes its RTL counterpart. The animation needs its own sign because translateX() uses the physical horizontal axis. The toast begins slightly toward the relevant outer edge and ends at its normal position. Logical inline-end positioning and reduced-motion preferences are separate controls.

Inspect both the first frame and the resting position. Correct final placement does not establish a correct entrance. Include browser zoom, a mobile keyboard, and any transformed ancestor in the test; confirm the actual containing block and visible viewport instead of assuming fixed positioning solves every overlap.

Translate full messages and isolate inserted content#

Notification text includes success, failure, retry, cancellation, partial completion, and undo. Give those outcomes distinct messages. A partial upload must not announce full success while naming a failed file only in a detail view.

Use full translated messages with named values. Arabic word order and number agreement cannot be obtained by translating an English noun and attaching it to a count. Arabic plural rules include zero, one, two, few, many, and other; MDN's Intl.PluralRules reference explains category selection.

For batch notifications, exercise counts that reach each category and review the complete Arabic sentences. Keep digits consistent with the workspace's chosen numbering system. Do not let the toast library's formatter silently use a different convention from the collection summary.

The banner's <bdi> gives its inserted file name an isolated direction boundary. It is not evidence that the sample's Latin-leading file name would otherwise break. Use the boundary because file names are independent, variable content; test actual names that mix Arabic, digits, punctuation, and Latin text. W3C's inline bidi guidance explains this structure.

Use your translation renderer's supported rich placeholders for such elements. Do not assemble translator-authored HTML and arbitrary file names into a raw HTML string. A plain-text notification API cannot interpret <bdi> markup; confirm its supported rendering contract before choosing a bidi strategy. See bidi isolation for that decision.

Separate machine error codes from user-facing copy. Translate known error states through stable codes and provide a meaningful fallback for unknown failures. Avoid showing an unreviewed server response as the explanation or retry instruction.

Announce the result without moving focus#

A toast's position on screen does not make its message available to a screen reader. W3C's status-message guidance addresses updates that should be communicated without receiving focus. Routine completion messages generally suit a polite status announcement rather than an interruption.

Keep an announcement target mounted before the asynchronous result arrives. This small example leaves the visual notification and its actions in their own component. The status target is visible here so the example has no undeclared hiding utility.

html
<p id="proof-upload-status" role="status" lang="ar" dir="rtl"></p>
js
function announceProofUploadComplete() {  const target = document.querySelector('#proof-upload-status');  if (!target) throw new Error('Upload status target is not mounted');  target.textContent = 'اكتمل رفع الطبعة التجريبية.';}

Call this function after the application confirms completion, not when the upload merely starts. In a localized application, obtain the message from its translation layer. The function demonstrates updating an existing status target, not a complete upload implementation.

The status role has polite live-region behavior. Reserve assertive alerts for messages whose urgency justifies interrupting the current announcement. WAI's alert pattern distinguishes an alert from an alert dialog that interrupts work.

Do not place both the visible toast and a duplicate announcement target in live regions for the same event. Choose one announcement path. Keep interactive retry and undo controls outside the simple text-only target rather than expecting its announcement to provide interaction.

Test announcement behavior with the supported screen reader and browser combinations. MDN's live-region guidance explains why the region should exist before its content changes. Repeating the same string, replacing a whole region, or firing several updates quickly needs explicit testing; a correct role attribute alone does not verify what the reader hears.

Keep recovery available after the toast disappears#

Do not make a short-lived toast the only place where an unresolved failure can be understood or repaired. In the proof library, a failed upload can remain visible in its upload list while a banner provides retry. A notification can draw attention to that state without being its sole record.

For an undo action, decide how long the operation is reversible and where that action remains available. Reading speed cannot be inferred from the message's character count. Do not assign Arabic a shorter display duration because its text occupies fewer horizontal pixels.

If a notification sets a time limit on reading or performing an action, review it against W3C's Timing Adjustable guidance. Pausing while the pointer hovers is not a complete strategy for keyboard, touch, or screen reader users. Keeping actionable recovery persistent can avoid the disappearing-action problem.

Dismissal needs a focus decision. If the reader activated the banner's close button, removing that focused button should leave a useful next focus location. If the notification appeared without taking focus, closing it should not send focus to the page heading automatically. Test both paths, including dismissing one notification from a stack.

Do not tie cleanup exclusively to an animation-end event. The reduced-motion example removes the animation, so that event cannot be the only path that makes dismissal finish. The application's state should determine whether the message exists; motion should present that change.

Preserve meaning when events arrive together#

A batch can produce several completion events in quick succession. Decide whether to group them, update an existing notification, or present separate messages. Do not let the visual stack imply one outcome while the announcement target describes another.

Use operation identifiers to associate updates with the correct upload or retry. A late failure from an earlier attempt must not overwrite a newer confirmed success. Likewise, changing workspace or filters should not let an old collection response replace the current empty state.

Keep event order separate from horizontal direction. RTL does not require reversing the chronological order of a notification list. Define whether newest entries appear at the top or bottom, then keep that relationship consistent with reading and keyboard access.

Limit what remains visible without hiding the only recovery action. A scrollable stack can contain notifications taller than a compact toast, but check that its close buttons, retry controls, and focused item can be reached. Multiple individually correct cards can still cover the workspace's upload control or one another.

If a modal upload flow is open, inspect how notifications relate to it. A message visually behind the modal is not useful recovery. Decide whether the result belongs inside the modal, in the underlying workspace after dismissal, or in another persistent surface, and verify that the chosen actions can actually be reached.

Make temporary states reproducible without live failures#

Provide a development fixture or test harness that can hold each state long enough to inspect it. For loading, delay resolution instead of repeatedly refreshing until a skeleton happens to appear. For a request failure, stub the relevant collection request with the application's expected error shape. Blocking every network request also breaks fonts and translation resources, which confounds the result.

Exercise access denial with a dedicated permission fixture or suitable test account. Hiding collection records while retaining upload permission does not reproduce a genuine restricted workspace. The reviewer needs to see the same permitted actions the application would offer in that state.

For partial upload, let one fixture file succeed and another fail. Confirm that retry targets the failed file and that the next message reports its new outcome. Replacing the whole batch with a generic error cannot establish whether partial-result copy and recovery are correct.

Provide a way to keep notifications visible during layout review, then restore production timing for interaction tests. A frozen toast demonstrates geometry, not dismissal behavior or reading time. Likewise, manually inserting a pretranslated Arabic sentence tests a layout but does not establish that the application's event selects the right translation key.

Record the locale, direction, operation state, and fixture alongside the screenshot. This lets another reviewer recreate the same branch after a translation or component change. Include the original trigger in an automated regression when practical, so the test still covers the path that produces the notification rather than only an isolated card.

Trigger the states deliberately during Arabic QA#

Give reviewers deterministic fixtures instead of relying on a particular account to happen to be empty. Start with a resolved empty collection, a no-match query, a pending request, an access failure, and a network failure. Confirm that each selects the intended Arabic message and action.

For notifications, trigger a single success, a partial batch failure, a retry, and a recovery success. Preserve the failed file name so the retry can be checked against the same operation. Include repeated identical results and several overlapping operations to exercise announcement and stack behavior.

Review each state at the actual component width. Include an open sidebar, browser zoom, long Arabic text, and mixed-direction file names. Watch the entrance and dismissal, then inspect the resting layout. A screenshot taken after the animation cannot reveal an off-screen first frame.

Use the keyboard to reach retry and close, and check focus after dismissal. Listen to announcements separately from inspecting the visible text. Switch language while a notification remains visible and while a request is pending; verify the final message, actions, host direction, and relevant workspace agree.

A free Ritla scan can report Visible Latin-script body text above thresholds on an Arabic page R010 and Untranslated interactive labels (buttons, nav/footer links, menu items, tabs) R011 when reviewing these rendered states; trigger each branch for inspection rather than relying on the populated collection. For related failures, see Arabic text overflow and how to handle dynamic text direction.

Checks in this guide

See what your Arabic pages are hiding

Paste a URL. Ritla renders the page on desktop and mobile, runs every check, and shows the top issues with screenshot evidence.

Scan a page freeBrowse the checks