You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(i18n): print Arabic numbers in one set of digits and keep episode codes Latin - #3912
Related issue: #3188
Validation tasks: none (English and the non-Arabic languages are unchanged)
Stacked on #3911; the full stack order is in #3723.
On an Arabic-region browser, dates and Intl numbers used Arabic-Indic digits while message counts, years, relative times and the plural # stayed Latin, so one line mixed both. Episode codes then went the other way and read "S٠١E٠٥". This makes Arabic numbers consistent and keeps codes Latin.
Approach
In Arabic, every number on screen uses the digits of the locale the app formats with: Arabic-Indic on ar-EG and ar-SA, Latin on ar-AE, ar-MA or a plain ar choice. createAppIntl names those digits in the Arabic formatter's locale (ar-u-nu-arab), so the plural # follows them; message values, relative times, displayed years and year ranges, decades, season lists and the catalog filter count go through the same formatter.
Numbers pass to web messages as numbers, so the formatter applies the digits.
Displayed timecodes (the player clock, scrubber preview, chapter list, sleep timer, resume label and admin playback positions) take the same digits; the timeline and transport stay left to right. Values sent to the server, written to a URL, used for seeking, or typed into the marker editor stay in Latin digits.
Episode and season codes print ASCII digits in every language (codeNumber()), and phrases keep the screen's digits: the play button reads "البدء من الحلقة ١" and spoken labels "الموسم ١، الحلقة ٥".
Validation
Web tests, typecheck, ESLint, prettier, the size ratchet and the bidi check pass on this branch. New tests cover the digit rule per Arabic region and the code rule; each fails without its change.
English and the other six languages: unchanged on the compared screens.
Surface and build: web app, desktop and phone width; English on main and on a build of the whole stack, and Arabic (plain and Arabic-region browser) on that build.
Risks
None identified.
Checklist
I read and can explain the complete diff.
This pull request addresses one concern.
Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
The Evidence section shows every change a user can see, or says there is none.
Involvement: Fully AI-generated; human review pending
Adversarial review: code review by Claude (claude-opus-5-5); adversarial rounds by Codex (gpt-6.1-sol) on the branches it was built from, findings fixed. Background review by Codex (gpt-6.1-sol) on 0d7b5b9: F1 and F2 (a step total and season numbers kept Latin digits) fixed in 65c1be8; the Codex bot's schedule-minute finding fixed in ae5afac.
Localize web UI text, format numbers by app locale, and keep episode codes Latin
Adds a full i18n layer: an app/admin message-catalog loader (catalog.ts), a React Intl formatter (format.ts), useT/useAppLanguage hooks, and a LocaleProvider wrapped around the app shell in App.tsx.
Replaces hard-coded English strings across pages, components, hooks, and formatters with translation lookups; numbers, dates, durations, and file sizes now format through the app locale (numberFormat.ts, datetime.ts).
Season and episode numbers use a shared codeNumber formatter so episode codes stay Latin even when the UI uses a different numbering system, while Arabic output picks its numbering system from the format locale in createAppIntl.
Converts hundreds of physical left/right CSS utilities to logical start/end properties and adds RTL support: mirrored icons, direction-aware arrow-key handling (readingArrowKey in direction.ts), RTL carousel scroll handling, and bidi-text styling; code blocks and paths are pinned left-to-right.
Adds an ESLint rule (no-physical-direction) to autofix physical-side utilities, a catalogParts Vite plugin for app/admin catalog splitting, and a signed-out language picker on auth screens.
Risk: massive sweep touches many label-producing helpers; consumers relying on removed exports like MARKER_LABELS, SHELF_ORDER_LABELS, and the LANGUAGES array must use the new helpers (MARKER_LABEL_KEYS, shelfOrderLabel, languageOptions()). formatPlayMethod and settings-search normalization fix old bugs but change matching behavior for non-ASCII scripts.
We couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting @coderabbitai full review.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
Walkthrough
This change adds locale-aware number formatting for translated messages and standalone display values. It adds helpers for localized numbers and ASCII-digit codes, then updates web call sites to pass numeric interpolation values while retaining existing selection and calculation logic.
Changes: Locale-aware number formatting
Layer / File(s)
Summary
Formatter and locale setup web/src/i18n/*, web/src/hooks/useAppLocale.tsx, web/src/hooks/useAppLocale.test.tsx, web/src/lib/timeAgo.ts
The formatter uses the format locale’s numbering system for numeric message values. New helpers format standalone numbers and preserve ASCII digits in technical codes. Tests and documentation cover Arabic digits, English fallback text, and code formatting.
Components and query hooks web/src/components/*, web/src/hooks/queries/*
Components and query hooks pass numeric interpolation values to translations. Some standalone years and episode identifiers use numberText or codeNumber.
Shared library helpers web/src/lib/*
Library helpers pass numeric interpolation values to translations and use the formatting helpers for standalone numbers and episode codes.
Pages, settings, and player views web/src/pages/*, web/src/playback/*, web/src/player/*
Pages, settings, watch-together, playback, and player views pass numeric values to translations and use numberText or codeNumber where appropriate.
No merge-blocking risk is established for the locale-aware formatting change.
Security architecture risk: Low · up to 614af
The inspected changes affect displayed numbers without changing plugin validation decisions or administrative request actions. No introduced security issue was established, but coverage of the wider change remains incomplete.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
inferred — The demonstrated propagation spans browser presentation, including administrative validation errors, bulk-action result messages and playback clocks. In the inspected privileged consumers, localized values do not replace request identifiers, action parameters or validation comparisons. This bounds those consumers, not every changed screen.
Trust Boundaries and Controls
observed — The plugin-schema change alters interpolation of validation thresholds and counts, not required-field, pattern, length or numeric validation decisions. Its SchemaForm caller continues updating values independently through onChange; the validator returns errors rather than transformed submission values.
Resilience and Maintainability Implications
observed — The full-base comparison of useBulkRequestAction changes only translated result values. Request identity and dispatch, bounded concurrency, retry policy, per-request failure accounting, settlement invalidation and reset behavior remain unchanged. Consequently, no PR-introduced weakening of those transition or recovery behaviors was established.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 43.60% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title clearly identifies the main change: consistent Arabic number formatting while keeping episode codes in Latin digits.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description explains the Arabic number-formatting issue and the changes to localize displayed numbers while keeping episode codes in Latin digits. It matches the changeset.
Full details: Docstring Coverage
Explanation
Docstring coverage is 43.60% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 172 functions across 102 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches
Generate docstrings
Commit to this branch
Create a new PR
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
The Evidence section lists desktop captures, but the changed counts, years and episode labels also appear at phone width. Please add before-and-after mobile web captures showing the Arabic digit rule and Latin episode codes on the same screen and data, with the builds identified, or show why mobile is unaffected.
Added phone-width captures to the evidence page: the series episode list in English (before and after) and Arabic, and Home on an Arabic (Egypt) browser with Arabic-Indic digits.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
⚠️ Outside diff range comments (3)
Minor · Localize the short-duration fallback digits. · duration.ts:12
web/src/lib/audiobooks/duration.ts:12 Minor · Functional Correctness · Quick win
Localize the short-duration fallback digits.
In ar-EG or ar-SA, the changed positive-duration branches use Arabic-Indic digits. Zero-duration input still returns the string "0", and a positive duration that rounds below one minute still returns "1". Pass numbers in these two branches as well, so chapter and group duration labels use consistent digits.
Also applies to: 16-16
Minor · Localize the season metadata year. · mediaRequests.ts:332
web/src/lib/mediaRequests.ts:332 Minor · Functional Correctness · Quick win
Localize the season metadata year.
When formatRequestSeasonMeta displays an air date and an episode count in ar-EG or ar-SA, the changed episode count uses Arabic-Indic digits. The year from season.air_date.slice(0, 4) remains Latin digits on the same line. Format that year with numberText before adding it to parts.
Minor · Localize the desktop catalog result count. · Catalog.tsx:473
web/src/pages/Catalog.tsx:473 Minor · Functional Correctness · Quick win
Localize the desktop catalog result count.
In ar-EG or ar-SA, the changed translated resultCount uses Arabic-Indic digits on phone-width screens. The desktop branch still renders totalItems directly, so the same catalog count uses Latin digits there. Render numberText(totalItems) in the desktop branch.
The current provider test selects only ar. A provider that always passes ar to createAppIntl can pass this test, even if it ignores the selected region. Add explicit ar-EG and ar-AE cases with fixed expected locales.
Suggested test change
vi.mock("@/i18n", async (importOriginal) => ({
...(await importOriginal<typeof import("@/i18n")>()),
loadTranslations: vi.fn(),
}));
+vi.mock("@/lib/appLocale", async (importOriginal) => ({+ ...(await importOriginal<typeof import("@/lib/appLocale")>()),+ browserLocaleInputs: () => ({ navigatorLanguages: ["en-US"], runtimeLocale: "en-US" }),+}));+
afterEach(() => {
@@
name: "applies the language once its catalog loads",
load: "resolve",
+ choice: "ar",
lang: "ar",
@@
intlLocale: `ar-u-nu-${new Intl.NumberFormat("ar").resolvedOptions().numberingSystem}`,
},
+ {+ name: "uses Arabic-Indic digits for ar-EG",+ load: "resolve",+ choice: "ar-EG",+ lang: "ar",+ dir: "rtl",+ intlLocale: "ar-u-nu-arab",+ },+ {+ name: "uses Latin digits for ar-AE",+ load: "resolve",+ choice: "ar-AE",+ lang: "ar",+ dir: "rtl",+ intlLocale: "ar-u-nu-latn",+ },
{
name: "falls back to English when its catalog fails",
load: "reject",
+ choice: "ar",
lang: "en",
@@
- ] as const)("$name", async ({ load, lang, dir, intlLocale }) => {+ ] as const)("$name", async ({ load, choice, lang, dir, intlLocale }) => {
@@
- setSignedOutLanguage("ar");+ setSignedOutLanguage(choice);
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 9855f9c0-733b-44cf-9ec9-19ed8f678d05
Commits
Reviewing files that changed from the base of the PR and between b2f205f and 83482f8.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
On CodeRabbit's findings outside the diff (review of 83482f8), all fixed in 1c87693:
lib/audiobooks/duration.ts: the zero and under-a-minute fallbacks pass numbers.
lib/mediaRequests.ts: a season's year goes through numberText.
pages/Catalog.tsx: the desktop result count goes through numberText.
The suggested ar-EG/ar-AE cases for useAppLocale.test.tsx are not added: createAppIntl's numbering-system choice is already covered in format.test.ts, and the provider only passes the format locale through.
Message values that are numbers were passed as String(n), following a README
rule that a plain {n} groups digits. On the web a plain {n} prints String(n),
so the output is the same; passing the number lets the message helper know it
is a number (next commit). A TypeScript codemod changed only values whose type
is number, in calls to t, translate and formatWith.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
On an Arabic-region browser (ar-EG, ar-SA), dates and Intl numbers used
Arabic-Indic digits while message counts, the plural #, years and relative
times stayed Latin, so one line mixed both. In Arabic, every number now uses
the digits of the locale the app formats with: Arabic-Indic on ar-EG, Latin
on ar-AE or a plain `ar` choice.
- createAppIntl names those digits in the Arabic formatter's locale
(ar-u-nu-arab), so the plural # follows them.
- formatWith prints number values in them, only in the language's own
translation; strings are never changed, so titles, codes and typed text
keep their digits.
- numberText() does the same for numbers shown outside messages: detail and
card years, box set years, request years and season lists, episode codes,
hero slide numbers, the player subtitle and HUD.
- Relative times ("قبل ٣ دقائق") use the same digits.
English and the other languages keep their bytes.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The result total beside it now follows the Arabic format locale's digits; the
filter badge printed its count raw, so the toolbar mixed both on ar-EG.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Episode and season codes (S01E05, S1:E2, E5) are technical labels, so they
print ASCII digits in every language, including Arabic on an Arabic-Indic
format locale. Phrases ("Season 2, Episode 5") keep the screen's digits.
- codeNumber() formats a number inside a code, zero-padded where the code
pads. The episode cards, home hero, player HUD, Up Next, notifications,
calendar and Watch Together codes use it, as do the admin codes that
already passed String(n).
- Where the Arabic catalog spells a code out as a phrase (the Watch Together
pick, its spoiler warning, admin download titles), the call site passes
the number so the phrase follows the screen.
- Phrases that still passed String(n) now pass numbers: Continue Watching's
"Season 2 Episode 5", the episode cards' spoken labels, and the calendar's
"Season 2" (its episode codes stay Latin).
English and the other languages keep their bytes.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…gits
The step dialog passed its total and the season list its season numbers
as strings, so in Arabic on an ar-EG or ar-SA format locale they stayed
Latin beside localized digits. They pass as numbers now; the TMDB name
comparison keeps the plain number.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The schedule summary padded the minute as a plain string, so in Arabic
on an ar-EG or ar-SA format locale it stayed Latin beside a localized
hour. It formats through the app's number format now, still two digits.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The duration went to the message as a string, so Arabic on an Arabic-Indic
browser printed its age in Arabic-Indic digits and its duration in Latin.
A number prints the same in English and follows the screen's digits.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…'s digits
Audiobook and chapter durations passed their zero-padded minutes and
seconds as strings, and an impersonated audit entry passed the target
account ID as one, so Arabic on an Arabic-Indic browser mixed digit sets.
Padded parts go through numberText, as the hero banner's already do, and
the account ID is passed as a number.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Counts, positions and year bounds still went to messages as strings, and the
audiobook fallback durations, the catalog's desktop result count and a season's
year were printed without the screen's digits, so Arabic on an Arabic-Indic
browser mixed digit sets. A plain number prints the same in English.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The "every N hours" preset passed its step as written, as a string, so Arabic
on an Arabic-Indic browser showed "6" among Arabic-Indic times. The step keeps
its written form ("02" stays "02") and takes the screen's digits.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The overrides readout printed its total and per-profile counts as Latin text
beside a translated count in Arabic-Indic digits.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A rule whose year bounds match is named after that year. Showing it took the
screen's digits, but the name saved through englishText did too, so an
Arabic-Indic browser stored a name in Arabic-Indic digits. The year takes the
screen's digits only when shown.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… the screen's digits
The advisory age badge, the audiobook chapter position, policy generations,
collection copy warnings and node memory percentages went to messages as
strings, so Arabic on an Arabic-Indic browser printed them in Latin digits.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…screen's digits
The episodes-left badge and the pagination buttons spoke their numbers in the
screen's digits but showed them in Latin ones, and a chapter's start time sat
in Latin digits beside its localized duration.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s in the screen's digits
A sweep of every number still stringified into a message: job result counts,
plugin form bounds, profile age limits, bulk request failures, notification
and AI test durations, frame rates and the hero's year. Codes, IDs, version
tags and HTTP statuses stay in Latin digits.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The player clock, scrubber preview, chapter list, sleep timer, resume label,
Watch Together clock, extras durations, marker ranges and admin playback
positions printed Latin digits beside Arabic-Indic text on an Arabic-Indic
browser. Display timecodes now go through numberText; the marker editor's
input values, and anything sent, stored or used for seeking, stay plain.
The timeline and transport keep their left-to-right layout.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The clock row is left to right inside, so it also aligned itself left within
the metadata column; on a wide right-to-left screen it sat far from the
title. It now takes its place at the column's start, like the title.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bugSomething isn't workingevidence-requiredNeeds before-and-after evidence before the Evidence check passesimpact: polishAnnoyance, cosmetic, or nice-to-havepriority: P2Limited scope, workaround exists, or polishsize/XXL1000–2999 added + deleted lines (all files); change volume, not priority.stackedBase is another open PR; merge in stack order named in the body
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Related issue: #3188
Validation tasks: none (English and the non-Arabic languages are unchanged)
Stacked on #3911; the full stack order is in #3723.
On an Arabic-region browser, dates and
Intlnumbers used Arabic-Indic digits while message counts, years, relative times and the plural#stayed Latin, so one line mixed both. Episode codes then went the other way and read "S٠١E٠٥". This makes Arabic numbers consistent and keeps codes Latin.Approach
archoice.createAppIntlnames those digits in the Arabic formatter's locale (ar-u-nu-arab), so the plural#follows them; message values, relative times, displayed years and year ranges, decades, season lists and the catalog filter count go through the same formatter.codeNumber()), and phrases keep the screen's digits: the play button reads "البدء من الحلقة ١" and spoken labels "الموسم ١، الحلقة ٥".Validation
Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-3912/
Surface and build: web app, desktop and phone width; English on
mainand on a build of the whole stack, and Arabic (plain and Arabic-region browser) on that build.Risks
None identified.
Checklist
AI Disclosure
🤖 Generated with Claude Code
Note
Localize web UI text, format numbers by app locale, and keep episode codes Latin
useT/useAppLanguagehooks, and aLocaleProviderwrapped around the app shell in App.tsx.codeNumberformatter so episode codes stay Latin even when the UI uses a different numbering system, while Arabic output picks its numbering system from the format locale increateAppIntl.readingArrowKeyin direction.ts), RTL carousel scroll handling, and bidi-text styling; code blocks and paths are pinned left-to-right.no-physical-direction) to autofix physical-side utilities, acatalogPartsVite plugin for app/admin catalog splitting, and a signed-out language picker on auth screens.MARKER_LABELS,SHELF_ORDER_LABELS, and theLANGUAGESarray must use the new helpers (MARKER_LABEL_KEYS,shelfOrderLabel,languageOptions()).formatPlayMethodand settings-search normalization fix old bugs but change matching behavior for non-ASCII scripts.Macroscope summarized 1be6ece.