← Back to Pull requests

Add drafts of Arabic and Persian to the iOS app, and keep right-to-left text in order #562

Closed
unknown closed this pull request without merging on Nov 22, 2026 15:13 UTC
View on GitHub
unknown unknown commented on Nov 22, 2026 13:22 UTC
Author

This adds machine-drafted Arabic and Persian to the iOS app, the two languages Android has (#551) and iOS didn't, and fixes the places where right-to-left text came out wrong on iOS.

Most of the right-to-left work iOS does by itself. SwiftUI lays out from the right, the welcome's back chevron, route line and slide transition already follow the direction, and String(localized:) sets each name and number it puts into a sentence apart with Unicode isolates, so "12 Mile Rd" stays in order inside Arabic. Android needed isolated() for that; iOS gets it for every String(localized:). What went wrong was text put together some other way:

  • The status card shows the next stop's name beside "Next" as a separate Text, so in Arabic "12 Mile Rd" showed as "Mile Rd 12". The name is now isolated (bidiIsolated). BidiTextTests lays the line out with Core Text and shows the wrong order without it and the right one with it.

  • CarPlay's run list wrote "6:43 AM → Downtown" in code, so the arrow could never turn. It is now a string, runs.departure, which takes each language's own run board arrow: → in the 26 languages there now, ← in Arabic and Persian. A new test checks both arrows point the way each bundled language reads.

  • First trip done finds the count in its sentence to draw it large, and looked for it in Western digits. Arabic in Egypt and Saudi Arabia writes 142 as ١٤٢, and Persian as ۱۴۲, so the number was never drawn. It now looks for the count in the digits the sentence used. The new test fails for ar_EG and fa_IR with the old lookup.

  • The sign-out icon is now the forward arrow, so it mirrors like Android's.
  • The drafts follow #551's Android wording and the glossary. 222 Arabic and 206 Persian iOS strings take Android's translation of the same English, and "Next", "Recent" and "Matches" take the Android string for their own screen. The rest were drafted, then read again row by row. Arabic has all six plural forms, and its one and two say the count in the noun, as Android's do ("تقريران مُرسلان"); I checked that iOS fills such a form without moving the other values. Arabic names iOS's own settings as iOS does. iOS has no Persian, so Persian keeps the English names the phone shows. Everything is machine_translated until a fluent reviewer reads it.

    Checked with go run ./cmd/l10n check (0 errors, 0 warnings, every language 300 of 300 on iOS), ./sync-string-catalogs.sh --check and the app's tests on the iOS 27 simulator (593 pass).

    Part of #495

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    New Features
    Added Arabic and Persian translations across trip tracking, routes, schedules, sign-in, help, and location-related text.
    Added Arabic and Persian location permission descriptions.
    Updated route and vehicle picker headings, recent-route labels, and departure rows with clearer, localized wording.
    Improved right-to-left text display for mixed-language content.
    Bug Fixes
    Trip report counts now match locale-formatted digits in completion messages.
    Corrected the sign-out menu icon.

    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 402 lines (+301 / -101) across 5 files Reviewer: aaronbrethorst Review duration: 111m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 402 lines diff across 5 files
    0.45
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.359
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #562"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 44.7% (MEDIUM) · Higher = larger blast radius
    44.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.7% · Safe to merge
    17.7%