Skip to content

fix(localization): enforce the batch-localize confirmation in code - #82

Merged
ziyiunity merged 1 commit into
mainfrom
fix/localization-batch-confirm-in-code
Sep 24, 2026
Merged

ziyiunity merged 1 commit into
mainfrom
fix/localization-batch-confirm-in-code

Conversation

@ziyiunity

Copy link
Copy Markdown
Contributor

What

L10nBatchProcessor.LocalizeAll opens, modifies and saves every scene under Assets/. The only safeguard was a sentence in SKILL.md asking the agent to confirm with the user first, so an agent that skipped it, or a developer who called the template directly, would rewrite every scene and discard unsaved work in the open scene with no prompt.

Change

The safeguards now live in LocalizeAll itself:

  • Refuses to run in batch mode, where EditorUtility.DisplayDialog returns true without showing anything.
  • Calls EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo() first, so unsaved changes are saved or explicitly discarded; Cancel aborts.
  • Shows a blocking confirmation dialog listing the scenes it will rewrite; nothing is written unless the user clicks confirm. Cancelling throws OperationCanceledException.
  • Restores the user's original scene layout afterwards.

SKILL.md keeps the existing "ask before acting" step and now tells the agent the method enforces this itself, that the user confirms in the Editor, and that a cancellation must not be worked around.

Verification

The new LocalizeAll compiles against the Unity 6000.6 Editor assemblies, with the unchanged Localization/TMP-dependent helper stubbed. Not yet exercised end to end in a live Editor with the Localization package; worth a quick run by the skill owner before merge.

@ziyiunity
ziyiunity requested a review from a team as a code owner September 23, 2026 19:41
@ziyiunity
ziyiunity merged commit 62db54f into main Sep 24, 2026
4 checks passed
@ziyiunity
ziyiunity deleted the fix/localization-batch-confirm-in-code branch September 24, 2026 18:35
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.

2 participants