localize "Debugger" hardcoded literals

GitOrigin-RevId: 422439ffc300a559d7d6a157444a91f6d18fa7e1
This commit is contained in:
Dmitry.Krasilschikov
2020-02-04 16:40:54 +02:00
committed by intellij-monorepo-bot
parent 197f0bd546
commit c7ef677d04
21 changed files with 72 additions and 30 deletions

View File

@@ -1,6 +1,7 @@
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.debugger.actions;
import com.intellij.debugger.DebuggerBundle;
import com.intellij.debugger.engine.DebugProcessImpl;
import com.intellij.debugger.engine.evaluation.EvaluateException;
import com.intellij.debugger.engine.events.DebuggerCommandImpl;
@@ -37,7 +38,7 @@ public class AddSteppingFilterAction extends DebuggerAction {
final Project project = e.getData(CommonDataKeys.PROJECT);
ApplicationManager.getApplication().invokeLater(() -> {
String filter = Messages.showInputDialog(project, "", "Add Stepping Filter", null, name, null);
String filter = Messages.showInputDialog(project, "", DebuggerBundle.message("add.stepping.filter"), null, name, null);
if (filter != null) {
ClassFilter[] newFilters = ArrayUtil.append(DebuggerSettings.getInstance().getSteppingFilters(), new ClassFilter(filter));
DebuggerSettings.getInstance().setSteppingFilters(newFilters);

View File

@@ -55,7 +55,7 @@ public class InterruptThreadAction extends DebuggerAction{
if (unsupported) {
final Project project = debugProcess.getProject();
XDebuggerManagerImpl.NOTIFICATION_GROUP
.createNotification("Thread operation 'interrupt' is not supported by VM", MessageType.INFO).notify(project);
.createNotification(DebuggerBundle.message("thread.operation.interrupt.is.not.supported.by.vm"), MessageType.INFO).notify(project);
}
}
});

View File

@@ -15,6 +15,7 @@
*/
package com.intellij.debugger.actions;
import com.intellij.debugger.DebuggerBundle;
import com.intellij.ide.util.PropertiesComponent;
import com.intellij.openapi.ui.ex.MultiLineLabel;
import com.intellij.xdebugger.impl.ui.tree.ValueMarkerPresentationDialogBase;
@@ -44,8 +45,7 @@ public class ObjectMarkupPropertiesDialog extends ValueMarkerPresentationDialogB
@NotNull Collection<ValueMarkup> markups) {
super(parent, defaultText, markups);
mySuggestAdditionalMarkup = suggestAdditionalMarkup;
myDescriptionLabel.setText("If the value is referenced by a constant field of an abstract class,\n" +
"IDEA could additionally mark all values referenced from this class with the names of referencing fields.");
myDescriptionLabel.setText(DebuggerBundle.message("if.the.value.is.referenced.by.a.constant.field"));
myCbMarkAdditionalFields.setSelected(PropertiesComponent.getInstance().getBoolean(MARK_ALL_REFERENCED_VALUES_KEY, MARK_ALL_REFERENCED_VALUES_DEFAULT_VALUE));
init();
}

View File

@@ -1,6 +1,7 @@
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.debugger.actions;
import com.intellij.CommonBundle;
import com.intellij.debugger.engine.DebuggerUtils;
import com.intellij.debugger.engine.JavaValue;
import com.intellij.idea.ActionsBundle;
@@ -93,8 +94,8 @@ public class ViewTextAction extends XFetchValueActionBase {
super(project, false);
myStringNode = stringNode;
setModal(false);
setCancelButtonText("Close");
setOKButtonText("Set");
setCancelButtonText(CommonBundle.message("close"));
setOKButtonText(CommonBundle.message("set"));
getOKAction().setEnabled(false);
setCrossClosesWindow(true);

View File

@@ -2,6 +2,7 @@
package com.intellij.debugger.impl;
import com.intellij.debugger.DebugEnvironment;
import com.intellij.debugger.DebuggerBundle;
import com.intellij.debugger.DebuggerManagerEx;
import com.intellij.debugger.NameMapper;
import com.intellij.debugger.engine.*;
@@ -211,7 +212,7 @@ public class DebuggerManagerImpl extends DebuggerManagerEx implements Persistent
ProgressManager.getInstance().runProcessWithProgressSynchronously(() -> {
ProgressManager.getInstance().getProgressIndicator().setIndeterminate(true);
debugProcess.waitFor(10000);
}, "Waiting For Debugger Response", false, debugProcess.getProject());
}, DebuggerBundle.message("waiting.for.debugger.response"), false, debugProcess.getProject());
}
else {
debugProcess.waitFor(10000);

View File

@@ -347,7 +347,7 @@ public abstract class DebuggerUtilsEx extends DebuggerUtils {
final Content content = ui.createContent(id + " " + myThreadDumpsCount, panel, id, null, null);
content.putUserData(RunnerContentUi.LIGHTWEIGHT_CONTENT_MARKER, Boolean.TRUE);
content.setCloseable(true);
content.setDescription("Thread Dump");
content.setDescription(DebuggerBundle.message("thread.dump"));
ui.addContent(content);
ui.selectAndFocus(content, true, true);
myThreadDumpsCount++;

View File

@@ -1,6 +1,7 @@
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.debugger.memory.action;
import com.intellij.debugger.DebuggerBundle;
import com.intellij.debugger.engine.evaluation.EvaluateException;
import com.intellij.debugger.engine.evaluation.EvaluationContextImpl;
import com.intellij.debugger.memory.agent.MemoryAgent;
@@ -20,7 +21,7 @@ public class CalculateRetainedSizeAction extends MemoryAgentActionBase {
MemoryAgent memoryAgent = MemoryAgent.get(evaluationContext.getDebugProcess());
long size = memoryAgent.estimateObjectSize(evaluationContext, reference);
ApplicationManager.getApplication().invokeLater(
() -> new MessageDialog(node.getTree().getProject(), String.valueOf(size), "Size of the Object",
() -> new MessageDialog(node.getTree().getProject(), String.valueOf(size), DebuggerBundle.message("size.of.the.object"),
ArrayUtilRt.EMPTY_STRING_ARRAY, 0, null, false)
.show());
}

View File

@@ -1,6 +1,7 @@
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.debugger.memory.action;
import com.intellij.debugger.DebuggerBundle;
import com.intellij.debugger.engine.DebugProcessImpl;
import com.intellij.debugger.engine.JavaDebugProcess;
import com.intellij.debugger.engine.SuspendContextImpl;
@@ -36,7 +37,7 @@ public abstract class MemoryAgentActionBase extends DebuggerTreeAction {
perform(evaluationContext, reference, node);
}
catch (EvaluateException ex) {
XDebuggerManagerImpl.NOTIFICATION_GROUP.createNotification("Action failed", NotificationType.ERROR);
XDebuggerManagerImpl.NOTIFICATION_GROUP.createNotification(DebuggerBundle.message("action.failed"), NotificationType.ERROR);
}
}

View File

@@ -2,6 +2,7 @@
package com.intellij.debugger.memory.ui;
import com.intellij.codeInsight.lookup.LookupManager;
import com.intellij.debugger.DebuggerBundle;
import com.intellij.debugger.engine.DebuggerUtils;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.actionSystem.AnAction;
@@ -36,7 +37,7 @@ class ExpressionEditorWithHistory extends XDebuggerExpressionEditor {
super(project, debuggerEditorsProvider, HISTORY_ID_PREFIX + className, null,
XExpressionImpl.EMPTY_EXPRESSION, false, true, true);
new AnAction("InstancesWindow.ShowHistory") {
new AnAction(DebuggerBundle.message("instances.window.show.history")) {
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
showHistory();

View File

@@ -1,6 +1,7 @@
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.debugger.memory.ui;
import com.intellij.CommonBundle;
import com.intellij.debugger.DebuggerManager;
import com.intellij.debugger.engine.DebugProcessImpl;
import com.intellij.debugger.engine.DebuggerUtils;
@@ -69,7 +70,7 @@ class InstancesView extends InstancesViewBase {
private final MyNodeManager myNodeManager;
private final Consumer<? super String> myWarningMessageConsumer;
private final JButton myFilterButton = new JButton("Filter");
private final JButton myFilterButton = new JButton(CommonBundle.message("filter"));
private final FilteringProgressView myProgress = new FilteringProgressView();
private final Object myFilteringTaskLock = new Object();

View File

@@ -1,6 +1,7 @@
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.debugger.memory.ui;
import com.intellij.CommonBundle;
import com.intellij.openapi.util.Disposer;
import com.intellij.util.ui.JBDimension;
import com.intellij.xdebugger.XDebugSession;
@@ -46,6 +47,6 @@ public class InstancesWindow extends InstancesWindowBase {
@Override
protected Action @NotNull [] createActions() {
return new Action[]{new DialogWrapperExitAction("Close", CLOSE_EXIT_CODE)};
return new Action[]{new DialogWrapperExitAction(CommonBundle.message("close"), CLOSE_EXIT_CODE)};
}
}

View File

@@ -15,6 +15,7 @@
*/
package com.intellij.debugger.memory.ui;
import com.intellij.debugger.DebuggerBundle;
import com.intellij.debugger.engine.DebugProcessImpl;
import com.intellij.debugger.memory.utils.StackFrameItem;
import com.intellij.openapi.ui.popup.JBPopup;
@@ -29,7 +30,7 @@ public class StackFramePopup {
StackFrameList list = new StackFrameList(debugProcess);
list.setFrameItems(stack, () -> DebuggerUIUtil.invokeLater(() -> {
JBPopup popup = JBPopupFactory.getInstance().createListPopupBuilder(list)
.setTitle("Select stack frame")
.setTitle(DebuggerBundle.message("select.stack.frame"))
.setAutoSelectIfEmpty(true)
.setResizable(false)
.setItemChoosenCallback(() -> list.navigateToSelectedValue(true))

View File

@@ -1,6 +1,7 @@
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.debugger.settings;
import com.intellij.CommonBundle;
import com.intellij.codeInsight.AnnotationsPanel;
import com.intellij.debugger.DebuggerBundle;
import com.intellij.debugger.engine.JVMNameUtil;
@@ -189,7 +190,7 @@ public class CaptureConfigurable implements SearchableConfigurable, NoScroll {
}
});
new DumbAwareAction("Toggle") {
new DumbAwareAction(CommonBundle.message("toggle")) {
@Override
public void update(@NotNull AnActionEvent e) {
e.getPresentation().setEnabled(table.getSelectedRowCount() == 1 && !table.isEditing());
@@ -219,8 +220,8 @@ public class CaptureConfigurable implements SearchableConfigurable, NoScroll {
return FileTypeRegistry.getInstance().isFileOfType(file, StdFileTypes.XML);
}
};
descriptor.setDescription("Please select a file to import.");
descriptor.setTitle("Import Capture Points");
descriptor.setDescription(DebuggerBundle.message("please.select.a.file.to.import"));
descriptor.setTitle(DebuggerBundle.message("import.capture.points"));
VirtualFile[] files = FileChooser.chooseFiles(descriptor, e.getProject(), null);
if (ArrayUtil.isEmpty(files)) return;
@@ -236,7 +237,8 @@ public class CaptureConfigurable implements SearchableConfigurable, NoScroll {
}
catch (Exception ex) {
final String msg = ex.getLocalizedMessage();
Messages.showErrorDialog(e.getProject(), msg != null && msg.length() > 0 ? msg : ex.toString(), "Export Failed");
Messages.showErrorDialog(e.getProject(), msg != null && msg.length() > 0 ? msg : ex.toString(),
DebuggerBundle.message("export.failed"));
}
}
}
@@ -247,7 +249,7 @@ public class CaptureConfigurable implements SearchableConfigurable, NoScroll {
@Override
public void actionPerformed(@NotNull final AnActionEvent e) {
VirtualFileWrapper wrapper = FileChooserFactory.getInstance()
.createSaveFileDialog(new FileSaverDescriptor("Export Selected Capture Points to File...", "", "xml"), e.getProject())
.createSaveFileDialog(new FileSaverDescriptor(DebuggerBundle.message("export.selected.capture.points.to.file"), "", "xml"), e.getProject())
.save(null, null);
if (wrapper == null) return;
@@ -267,7 +269,8 @@ public class CaptureConfigurable implements SearchableConfigurable, NoScroll {
}
catch (Exception ex) {
final String msg = ex.getLocalizedMessage();
Messages.showErrorDialog(e.getProject(), msg != null && msg.length() > 0 ? msg : ex.toString(), "Export Failed");
Messages.showErrorDialog(e.getProject(), msg != null && msg.length() > 0 ? msg : ex.toString(),
DebuggerBundle.message("export.failed"));
}
}

View File

@@ -97,7 +97,7 @@ public class RunHotswapDialog extends OptionsDialog {
label.setIcon(icon);
label.setIconTextGap(7);
if (myDisplayHangWarning) {
final JLabel warningLabel = new JLabel("WARNING! " + DebuggerBundle.message("hotswap.dialog.hang.warning"));
final JLabel warningLabel = new JLabel(DebuggerBundle.message("warning.0", DebuggerBundle.message("hotswap.dialog.hang.warning")));
warningLabel.setUI(new MultiLineLabelUI());
panel.add(warningLabel, BorderLayout.SOUTH);
}

View File

@@ -15,6 +15,7 @@
*/
package com.intellij.debugger.ui.breakpoints;
import com.intellij.debugger.DebuggerBundle;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.Messages;
@@ -31,18 +32,18 @@ public class AddWildcardBreakpointDialog extends DialogWrapper {
public AddWildcardBreakpointDialog(Project project) {
super(project, true);
setTitle("Add Method Breakpoint");
setTitle(DebuggerBundle.message("add.method.breakpoint"));
init();
}
@Override
protected void doOKAction() {
if (getClassPattern().length() == 0) {
Messages.showErrorDialog(myPanel, "Class pattern not specified");
Messages.showErrorDialog(myPanel, DebuggerBundle.message("class.pattern.not.specified"));
return;
}
if (getMethodName().length() == 0) {
Messages.showErrorDialog(myPanel, "Method name not specified");
Messages.showErrorDialog(myPanel, DebuggerBundle.message("method.name.not.specified"));
return;
}
super.doOKAction();

View File

@@ -2,6 +2,7 @@
package com.intellij.debugger.ui.breakpoints;
import com.intellij.debugger.DebuggerBundle;
import com.intellij.debugger.settings.TraceSettings;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
@@ -32,7 +33,7 @@ public class CallTracingPropertiesPanel extends XBreakpointCustomPropertiesPanel
public JComponent getComponent() {
myStartTracing = new JBCheckBox("Start");
myEndTracing = new JBCheckBox("Stop");
JButton filters = new JButton("Filters...");
JButton filters = new JButton(DebuggerBundle.message("filters"));
//DialogUtil.registerMnemonic(myStartTracing);
//DialogUtil.registerMnemonic(myEndTracing);
@@ -67,7 +68,7 @@ public class CallTracingPropertiesPanel extends XBreakpointCustomPropertiesPanel
EditClassFiltersDialog dialog = new EditClassFiltersDialog(myProject);
TraceSettings traceSettings = TraceSettings.getInstance();
dialog.setFilters(traceSettings.getClassFilters(), traceSettings.getClassExclusionFilters());
dialog.setTitle("Tracing Class Filters");
dialog.setTitle(DebuggerBundle.message("tracing.class.filters"));
dialog.show();
if (dialog.getExitCode() == DialogWrapper.OK_EXIT_CODE) {
traceSettings.setClassFilters(dialog.getFilters());

View File

@@ -134,7 +134,7 @@ public class MethodBreakpoint extends BreakpointWithHighlighter<JavaMethodBreakp
ApplicationManager.getApplication().invokeAndWait(
() -> {
ProgressWindow progress =
new ProgressWindow(true, false, debugProcess.getProject(), "Cancel emulation");
new ProgressWindow(true, false, debugProcess.getProject(), DebuggerBundle.message("cancel.emulation"));
progress.setDelayInMillis(2000);
indicatorRef.set(progress);
});

View File

@@ -1,6 +1,7 @@
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.debugger.ui.overhead;
import com.intellij.CommonBundle;
import com.intellij.debugger.engine.DebugProcessImpl;
import com.intellij.debugger.ui.breakpoints.Breakpoint;
import com.intellij.openapi.Disposable;
@@ -87,7 +88,7 @@ public class OverheadView extends BorderLayoutPanel implements Disposable, DataP
}
, process);
new DumbAwareAction("Toggle") {
new DumbAwareAction(CommonBundle.message("toggle")) {
@Override
public void update(@NotNull AnActionEvent e) {
e.getPresentation().setEnabled(myTable.getSelectedRowCount() == 1);

View File

@@ -1,6 +1,7 @@
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.debugger.ui.tree.render;
import com.intellij.CommonBundle;
import com.intellij.debugger.DebuggerBundle;
import com.intellij.debugger.engine.DebugProcess;
import com.intellij.debugger.engine.FullValueEvaluatorProvider;
@@ -48,7 +49,7 @@ class ImageObjectRenderer extends CompoundReferenceRenderer implements FullValue
}
static JComponent createIconViewer(@Nullable Icon icon) {
if (icon == null) return new JLabel("No data", SwingConstants.CENTER);
if (icon == null) return new JLabel(CommonBundle.message("no.data"), SwingConstants.CENTER);
final int w = icon.getIconWidth();
final int h = icon.getIconHeight();
final BufferedImage image = GraphicsEnvironment.getLocalGraphicsEnvironment()

View File

@@ -47,3 +47,9 @@ checkbox.remember.password=&Remember
vfs.broken.link=Broken link
dialog.options.do.not.show=Do not show this dialog in the future
dialog.options.do.not.ask=&Remember, don't ask again
toggle=Toggle
filter=Filter
no.data=No data
close=Close
set=Set

View File

@@ -538,3 +538,23 @@ action.AnActionButton.text.export=Export
action.AnActionButton.description.export=Export
action.TurnOffDfaAssist.text=Turn Off Data Flow Assist
action.TurnOffDfaAssist.description=Switch off data flow aided debugging for this session
warning.0=WARNING! {0}
instances.window.show.history=InstancesWindow.ShowHistory
select.stack.frame=Select stack frame
tracing.class.filters=Tracing Class Filters
filters=Filters...
export.failed=Export Failed
export.selected.capture.points.to.file=Export Selected Capture Points to File...
import.capture.points=Import Capture Points
please.select.a.file.to.import=Please select a file to import.
waiting.for.debugger.response=Waiting For Debugger Response
thread.dump=Thread Dump
cancel.emulation=Cancel emulation
thread.operation.interrupt.is.not.supported.by.vm=Thread operation 'interrupt' is not supported by VM
size.of.the.object=Size of the Object
add.stepping.filter=Add Stepping Filter
method.name.not.specified=Method name not specified
class.pattern.not.specified=Class pattern not specified
add.method.breakpoint=Add Method Breakpoint
if.the.value.is.referenced.by.a.constant.field=If the value is referenced by a constant field of an abstract class,\nIDEA could additionally mark all values referenced from this class with the names of referencing fields.
action.failed=Action failed