Course outline

iOS / Swift / Accessible systems and target evidence / Lesson 13

Accessibility, Arabic, and localization

Preserve task meaning through VoiceOver, Dynamic Type, plural messages, and bidirectional layout.

About 5 min readContent reviewed
On this page

Lesson goals

  • Begin with the action and its information
  • Use whole localized messages and stable resources
  • Expose an action through a labeled standard control

Begin with the action and its information

An accessible control communicates what it does, whether it is available, and what changed after activation. A familiar icon to one sighted user may be ambiguous to another user or to VoiceOver. Prefer standard SwiftUI controls with clear labels before adding custom gestures and traits. Avoid attaching a second identical accessibility label without checking whether it duplicates spoken content. Inspect the accessibility tree, then exercise the actual task with VoiceOver on the supported target. A plausible label in source code cannot establish reading order, focus recovery, or useful announcements after asynchronous changes.

Use whole localized messages and stable resources

A string catalog or other reviewed localization resource should represent a complete message with meaningful placeholders. Arabic has plural distinctions that do not fit a simple English singular/plural branch, and translated word order may move a count to another position. Give translators context and units rather than concatenating isolated fragments around a number. Keep resource identifiers stable across languages and test the required plural variations. Technical record identifiers can remain Latin while the surrounding explanation is Arabic; mixed-direction content needs explicit review so punctuation and reading order remain understandable.

Expose an action through a labeled standard control

The first fragment gives an icon-style refresh button a text-bearing Label. The visible style can hide the title while the semantic action remains named. The literal message is a localization resource candidate in an actual configured app. A disabled state is controlled by the optional callback, and a real model should coordinate that state with its pending-command policy. Do not use an accessibility label to pretend a decorative image has an action if no usable control exists. Verify keyboard and assistive activation as well as visual appearance.

swift Illustrative Swift or SwiftUI fragment; requires the declared toolchain host.
struct RefreshAction: View {
    let refresh: (() -> Void)?
    var body: some View {
        Button {
            refresh?()
        } label: {
            Label("Refresh workshops", systemImage: "arrow.clockwise")
        }
        .labelStyle(.iconOnly)
        .disabled(refresh == nil)
    }
}
Expected output
The icon button remains named Refresh workshops and is disabled when no action is supplied.

Requires SwiftUI. Actual spoken output and focus behavior require an Apple-hosted accessibility check, which was not performed.

Let text and direction reshape the layout

The second fragment uses leading alignment and leading padding instead of absolute left geometry. It allows the title to wrap vertically rather than forcing it into a fixed-height row. In an Arabic environment, leading follows right-to-left layout. This does not mean every symbol or number should be mirrored: a directional navigation arrow and a brand mark have different semantics. Test a long translated title beside an identifier and at accessibility text sizes. A localized label that becomes clipped or unreachable has not preserved the workflow even when its translation is linguistically correct.

swift Illustrative Swift or SwiftUI fragment; requires the declared toolchain host.
struct WorkshopHeading: View {
    let title: String
    let identifier: String
    var body: some View {
        VStack(alignment: .leading, spacing: 8) {
            Text(title).font(.headline).fixedSize(horizontal: false, vertical: true)
            Text(identifier).font(.caption)
        }
        .padding(.leading, 16)
        .frame(maxWidth: .infinity, alignment: .leading)
    }
}
Expected output
The heading can grow vertically and follows the environment’s leading direction.

The caller supplies localized title text. No device-specific line count, pixel measurement, or VoiceOver order is asserted.

Announce state changes at meaningful boundaries

A save failure, a completed operation, or a changed result count may deserve an announcement. Every body evaluation or typed character usually does not. Coordinate announcements with the actual accepted state so an obsolete task cannot announce an old error after a newer success. Keep field errors associated with their field and avoid stealing focus after every refresh. Respect reduced-motion and other accessibility preferences in presentation choices. Automated accessibility audits can expose some defects, while manual exploration is still needed for context, comprehension, and recovery from failure.

Verify the localized task rather than isolated strings

A useful matrix includes Arabic and English, mixed identifiers, long titles, accessibility text sizes, VoiceOver navigation, disabled actions, and a failure followed by correction. Check that primary actions remain reachable and that focus returns to a meaningful place after dismissing a sheet. Resource tests can detect missing keys or plural variants; they cannot establish actual spoken interaction. Record the target OS, locale, text size, and assistive settings for executed checks. This course performs no VoiceOver, simulator, or device validation and keeps every interface example marked unexecuted.

Common errors and fixes

An icon has no useful spoken action

Why it happens
Visual recognition replaced a semantic control label.
How to fix it
Use a labeled standard button and inspect resulting semantics.
Prevent it next time
Test the task with VoiceOver rather than source inspection alone.

Arabic layout assumes left is always leading

Why it happens
Absolute geometry ignored reading direction.
How to fix it
Use logical leading/trailing structure where meaning follows direction.
Prevent it next time
Review mixed-direction content in both locales.

Plural messages are assembled from word fragments

Why it happens
English grammar was treated as a universal template.
How to fix it
Localize whole messages with supported count variations.
Prevent it next time
Test Arabic plural categories with translator context.

Check your understanding

1. Why should large text be tested before fixing a card height?

Show worked solution

Text height depends on content, language, and accessibility size. Fixing height first can make a correct translation disappear or overlap controls. Start from the task’s essential information, allow growth or responsive composition, and verify action reachability at the required sizes.

2. Does a valid string catalog prove Arabic VoiceOver behavior?

Show worked solution

No. It establishes resource availability and message formatting under tested cases. Reading order, focus, pronunciation, and error recovery need actual assistive interaction on a supported target. Report those boundaries separately instead of turning a resource test into device certification.

Key takeaways

  • Begin with the action and its information
  • Verify the localized task rather than isolated strings

Official references