Repository navigation
feat(app): one-command localization tool; fill missing memory-use labels and drop leftover ARB keys - #14314
Merged
Conversation
Agents were editing 49 ARB files by hand with jq; this writes every locale, validates ICU placeholders, regenerates, and formats in one step so a new string cannot land half-translated.
The memory edit sheet showed a hardcoded English snackbar; adding the string through the new l10n tool is the proof that one command writes every locale and regenerates cleanly.
Apostrophes are ICU quotes only when Flutter's use-escaping is true.
This repo leaves it unset (false), so What's New in {version} still
declares {version}. The old parser always quoted, so check flagged
every locale that used the placeholder and add refused a matching
translation.
Failure-Class: none
Co-authored-by: Cursor <[email protected]>
Generating into a temp output-dir rewrites the import comment in app_localizations.dart and formats at 80 columns, so check could never exit 0 on a clean tree. Re-run gen-l10n in the real output-dir, compare, then restore. Failure-Class: none Co-authored-by: Cursor <[email protected]>
memoryAllowUse and memoryDontUse were English-only. Extra keys English
no longer has (wantDifferentName, leftover model/onboarding strings)
were unreferenced in app/lib and are removed. Italian selectedCount
had a fake {s} placeholder that leaked into the generated signature.
Failure-Class: none
Co-authored-by: Cursor <[email protected]>
Git-on-my-level
force-pushed
the
task/msd-ui-c6-l10n-tool
branch
from
September 17, 2026 11:41
e66a635 to
44a461a
Compare
kodjima33
approved these changes
Sep 17, 2026
kodjima33
left a comment
Collaborator
There was a problem hiding this comment.
Feature (one-command localization tool), app area -- approve-only per policy for non-desktop features regardless of diff size. Flagged author elevated scrutiny -- diff reviewed, no abuse signals (no workflows/secrets/eval).
Co-authored-by: Cursor <[email protected]>
# Conflicts: # .github/scripts/check_agents_md_lean.py # app/test.sh
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What changed and why
Agents were adding user-facing strings by hand across 49 ARB files with
jq, then regenerating.python3 app/scripts/l10n.pyis now the one command that writes every locale, validates ICU placeholders, regenerates, and formats, so a key cannot land half-translated. A follow-up commit proves it on the memory-edit-sheet baseline-status snackbar (failedToUpdateBaselineStatus).Review found that the ICU parser treated every apostrophe as an ICU quote, so
l10n checkfalse-failed ~420 keys whose English source containsWhat's/Omi's/Here'sbefore a placeholder (Flutter only quotes apostrophes whenuse-escapingis true;app/l10n.yamlleaves it unset/false). The parser now reads that setting. After that,checkwas used to fix the real corpus:memoryAllowUse/memoryDontUsetranslated into all 48 non-English locales, leftover extra keys English no longer has removed, and ItalianselectedCount{s}(which had leaked into the generatedselectedCount(int count, Object s)signature) corrected.Before / after (the manual steps this replaces)
Before
jq --indent 4the new key (and@keymetadata) intoapp_en.arbonly, or runapp/scripts/add-l10n-key.sh(English-only; apostrophes in other locales were a known footgun).app_*.arbfiles by hand or via a translation skill, hoping no locale was skipped.cd app && flutter gen-l10nand read stderr for"xx": N untranslated message(s).untranslated-messages-file:tol10n.yamlto see which keys were missing, then revert that yaml edit.dart format --line-length 120on generated Dart.After
set/removefollow the same shape. Validation failures write nothing. An identical re-run is a no-op. Apostrophes in English (What's New in {version}) are literal unlessl10n.yamlsetsuse-escaping: true.Product invariants affected
Path glob
app/lib/pages/memories/**matchesmemory_edit_sheet.dart. The change is a snackbar string swap (context.l10n.failedToUpdateBaselineStatus); it does not add a memory tier, collection, or default-access path.How it was verified
bash app/test/shell/l10n_tool_test.sh— all cases passed, including apostrophe-before-placeholder, two apostrophes around a placeholder,use-escaping: truerefuse/accept, and the existing refusals / byte-exact add.python3 app/scripts/l10n.py checkon this tree: exit 0, 8.62s real (user 7.78s). Ready for a pre-push hook; not wired.set memoryAllowUse,set memoryDontUse, 59removes of extra keys,set selectedCountfor the Italian{s}fake placeholder. Extra keys had nocontext.l10n.<key>references underapp/lib(excluding generated Dart). Call sitemerge_action_bar.dartupdated fromselectedCount(count, '')toselectedCount(count).cd app && flutter gen-l10n && git diff --exit-code -- lib/l10n— clean.dart run build_runner build --delete-conflicting-outputs && git diff --exit-code -- lib— clean (0 changed, 13s).bash app/test.sh— l10n shell tests passed; Dart suite+2013 ~5 -1. The failure isapp/test/unit/search_rank_grouping_test.dart(Bad state: Too many elements); that file is unchanged vsorigin/main(git diff origin/main -- app/test/unit/search_rank_grouping_test.dartis empty). Pre-existing on main, not this PR.OMI_PR_BODY_FILE=.local/pr-body-c6.md make preflight— passed, 16 checks in 25.37s.mobile-verifyjourneys: the demo is a snackbar string on a leaf sheet, not a navigable screen change. Did not exercise the snackbar or memory-use buttons on a device/simulator.Tests
app/test/shell/l10n_tool_test.sh— add, template, check, remove, identical re-run, byte-exact append on two real ARB copies; apostrophe / use-escaping accept paths.{version};use-escaping: truerefuses a translation that keeps{version}/ unquoted{name}against a quoted English source. Each refusal asserts no ARB writes.Failure class (fixes)
Failure-Class: none
Scoped cleanups (optional)
app/scripts/add-l10n-key.shnow exits 2 and points atscripts/l10n.pyso the English-only jq path cannot be used by muscle memory.app/AGENTS.mdlocalization section replaced the jq/skill instructions; budget ratcheted down to 167 lines / 11466 bytes.l10n.yamluse-escaping(repo default false). Found in review as a check false-positive class; fixed with regressions.l10n checkfreshness re-runs gen-l10n in the real output-dir and restores; a tempoutput-dirrewrote the import comment inapp_localizations.dartand formatted at 80 columns, so check could not exit 0.memoryAllowUse/memoryDontUse; removed 59 extra keys English no longer has; fixed ItalianselectedCount.Part of the mobile self-driving program (App UI lane, package C6). Implemented by Cursor
cursor-grok-4.6-high. Coordinator verification on the head commit:bash app/test/shell/l10n_tool_test.shpassed;python3 app/scripts/l10n.py checkexits 0 (49 locales, 3071 keys);bash app/scripts/analyze_ratchet.shpassed; both new memory-use labels are present and translated (not English copies) in all 48 non-English locales. The first review round rejectedcheckfor an ICU-apostrophe false positive (423 bogus findings); that is fixed here with regression tests.🤖 Generated with Claude Code