From e5776f72b4990b34675b5a2b9245df6658cd7ea5 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Tue, 28 Nov 2023 15:14:32 +0100 Subject: [PATCH] [updater] preparing conflict resolution options for localization (IDEA-336163) GitOrigin-RevId: ea3aa7f3df24ab6ad0bcb0c5a5cebeb699913170 --- .../com/intellij/updater/SwingUpdaterUI.java | 17 ++++++++++++++++- updater/src/messages/UpdaterBundle.properties | 5 +++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/updater/src/com/intellij/updater/SwingUpdaterUI.java b/updater/src/com/intellij/updater/SwingUpdaterUI.java index a013644957b1..ebff5d9bb8be 100644 --- a/updater/src/com/intellij/updater/SwingUpdaterUI.java +++ b/updater/src/com/intellij/updater/SwingUpdaterUI.java @@ -289,7 +289,7 @@ public class SwingUpdaterUI implements UpdaterUI { case 2: return item.validationResult.message; case OPTIONS_COLUMN_INDEX: - return item.option; + return getOptionName(item.option); } return null; } @@ -307,6 +307,21 @@ public class SwingUpdaterUI implements UpdaterUI { } } + private static @Nls String getOptionName(ValidationResult.Option option) { + switch (option) { + case NONE: return "-"; + case IGNORE: return UpdaterUI.message("option.ignore"); + case KEEP: return UpdaterUI.message("option.keep"); + case REPLACE: return UpdaterUI.message("option.replace"); + case DELETE: return UpdaterUI.message("option.delete"); + case KILL_PROCESS: return UpdaterUI.message("option.kill.process"); + default: { + @SuppressWarnings("HardCodedStringLiteral") var name = option.toString(); + return name; + } + } + } + public ValidationResult.Kind getKind(int rowIndex) { return myItems.get(rowIndex).validationResult.kind; } diff --git a/updater/src/messages/UpdaterBundle.properties b/updater/src/messages/UpdaterBundle.properties index 09ed7d3f26e5..ae38dc1a4c46 100644 --- a/updater/src/messages/UpdaterBundle.properties +++ b/updater/src/messages/UpdaterBundle.properties @@ -26,6 +26,11 @@ action.create=Create action.update=Update action.delete=Delete action.validate=Validate +option.ignore=Ignore +option.keep=Keep +option.replace=Replace +option.delete=Delete +option.kill.process=Kill Process button.proceed=Proceed updating.x.to.y=Updating {0} to {1}