Repository navigation
Confirm localization saves, and keep localization mode across reloads - #1502
Merged
Merged
Conversation
…#1495) A contributor edited Roman Urdu tutorial bubbles, pressed the footer's project "saved" button, reloaded, and saw the edits gone. They were saved. But localization mode switched off on every reload, and drafts only show in it; and nothing ever confirmed a save (the ✓ even said "Submit"). - Localization mode is a device-local setting (in LocalesSetting.ts, which keeps Page.svelte's graph at its file count). The sign-out reset acts only on a known sign-out: it fired while the user was still unknown on reload. - Every save site (MarkupHTMLView, LocalizedText, TermsEditor, GlossaryFormsEditor, the /localize workspace) goes through commitLocaleEdit and shows LocaleEditStatus: a visible note and a `locale-edit` announcement naming the text, only after the write lands. A failed write rolls the optimistic store back and keeps the draft open. - The status is dynamically imported and renders outside localization mode's edit affordances. Page, home and projects byte budgets move by 0.01MB. - ✓ and ✏️ tips say "save on this device"; the localization header says where edits go. Translated in all 36 locales. - getTutorial and Progress dropped the script subtag, so Learn requested ur-PK and nan-TW, found nothing, and served English. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 tasks done
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.
Context
A contributor editing Roman Urdu tutorial bubbles in localization mode pressed the footer's saved button, reloaded, and saw their edits gone. The edits were saved to IndexedDB. Two things made them look lost:
A repro against the emulator in
ur-Latn-PKconfirmed both, and turned up a third bug: Learn served English to Roman Urdu readers.getTutorialandProgressbuilt the locale string without its script subtag, requestedur-PK, found nothing and fell back to English. So the reporter was actually editing English text. Taiwanese Hokkien (nan-Latn-TW) had the same bug.What changed
Localization mode is remembered on this device.
LocalizingSetting, kept inLocalesSetting.tssoPage.svelte's file count doesn't change.Settings.sveltenow acts only on a known sign-out ($user === null). It used to fire while the user was stillundefinedduring every reload, which is also what wiped the saved setting in my first attempt.Every save confirms itself.
MarkupHTMLView,LocalizedText,TermsEditor,GlossaryFormsEditorand the/localizeworkspace) go throughcommitLocaleEdit.LocaleEditStatus: a visible "✓ Saved on this device" note, plus alocale-editannouncement that names the saved text, so two saves in a row aren't heard as one.LocalizedTextcommits on every blur.durably), keeps the editor open with the draft, and is announced on theignoredlane. Before, the page showed the edit as saved, and a reload lost it.Wording.
Budgets: the Page, home and projects byte budgets each rise by 0.01MB. The reason is documented in
importGraph.test.ts. File counts are unchanged.Contact sheet with screenshots and wording. It's private to the author.
Related issues
Verification
npm run check:now,npm run test:run,npm run test:sweepandnpm run localesall pass, and drift againstmainis clear.commitLocaleEditreports nothing for unchanged text,savedfor a change andrevertedfor the official text;ur-Latn-PK.localize-glossary-forms.spec.tsnow checks the saved note, the announcement, and the mode and draft surviving a reload. All 15 localize e2e tests pass locally against a fresh build.ur-Latn-PK: edit a bubble, reload, and both the mode and the edit remain. The tutorial now loads in Urdu.Checklist
🤖 Generated with Claude Code