Skip to content

i18n: Replace the window's confirm() and alert(), whose OK and Cancel Electron draws in English #658

Closed

Description

@ryanwelcher

Related to #622 (i18n). Found in the en-XA walk.

Five places still use the window's confirm() and alert(). The message is ours and is translated, but Electron draws the dialog and its buttons, "OK" and "Cancel", in English whatever the language:

  • confirmAnd (src/renderer/index.jsx): discarding all changes, discarding the edits on trunk before a switch, and discarding before a trunk update (src/renderer/hooks/use-trunk-update.jsx).
  • alert for a path that could not be copied (src/renderer/index.jsx).
  • alert for starting the dev server before a build (src/renderer/hooks/use-dev-server.jsx).

The note above confirmAnd already marks moving these to the app's own dialog as a change of its own.

To reproduce

Run npx electron . --lang=en-XA from the repository root, open a site with an uncommitted edit, and discard all changes. The question is bracketed, the buttons are not. Check this by hand, because the journeys answer these dialogs before they are drawn.

Fix

Ask the three questions in the app's own dialog, as a site deletion already does, and say the two failures in the app's own notices. Then nothing is left for confirm() or alert(), and the no-alert exceptions go. Add en-XA journey checks for the new dialog.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions