Skip to content

Adding or dropping a strings table is a binary change on Apple platforms - #7

Merged
janicduplessis merged 1 commit into
mainfrom
@janic/set-locale
Nov 15, 2026
Merged

janicduplessis merged 1 commit into
mainfrom
@janic/set-locale

Conversation

@janicduplessis

@janicduplessis janicduplessis commented Nov 15, 2026 •

Copy link
Copy Markdown

Description

On Apple platforms the strings tables become the bundle's localizations: localizationKeys writes CFBundleDevelopmentRegion and CFBundleLocalizations from reach.locales. That list is part of the signed Info.plist, but it was not in the compatibility id or in the plan's update requirements. So an update that adds or drops a table could reach a binary whose declared languages are stale: iOS would keep negotiating the app's language, and drawing its own controls, from the old list.

Solution

On iOS and macOS, an app with more than one table records localizations ({base, locales}) as a compatibility input, and the plan requires it the way grantPurposes is required:

  • Adding or dropping a language is a binary release.
  • Editing a translation's text is not, because only the table names are recorded, never the text, so it still ships as an update.
  • An app with one table, and every other platform, keeps the id it had, so existing cohorts don't move.

It runs after reach::derive in compat.rs, reading reach.locales, so the tables are not read twice. contract-for-agents says which edits need a new binary.

Not covered: changing the base of a one-table app (strings.base in app.json) moves CFBundleDevelopmentRegion without moving the id. Covering it would move every Apple app with a strings table into a new cohort, and the system's chrome falls back the same way either way.

Test plan

  • cargo test -p exact-bake: 127 pass. New tests:
    • the_plists_languages_are_in_the_id: the id moves when a language is added, and not for a translation edit, a single table, or the web. The input is the same on macOS.
    • a_plan_requires_the_localizations_its_inputs_carry.
  • bun scripts/caps.mjs (Bun 1.4.2): all budgets within cap.

@janicduplessis janicduplessis changed the title setLocale(tag) lets an app choose its strings table Adding or dropping a strings table is a binary change on Apple platforms Nov 15, 2026
@janicduplessis
janicduplessis merged commit 498be9c into main Nov 15, 2026
2 checks passed
ccheever added a commit to expo/exact that referenced this pull request Nov 15, 2026
The Apple bundle lists the strings tables as CFBundleLocalizations, and both
the system and SessionFacts.viewerLocale pick the app's table from that list.
The list was not a compatibility input, so an update that added a table could
reach a binary that never selects it, and one that dropped a table could reach
a binary that still offers it.

On iOS and macOS an app with more than one table now records
`localizations` ({base, locales}) in its compatibility inputs, and the plan
requires it as it requires grantPurposes. Adding or dropping a table is a
binary release; editing a translation still ships as an update. An app with
one table records nothing.

Apple apps that already ship more than one table move to a new cohort once;
no app in this repository does. Android and the other hosts declare no
language list in a native manifest: Android's localized notification channel
names already enter the id through androidChannels.

From appandflow#7 by Janic Duplessis.

Fixes #664

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant