localize "Compiler" messages

GitOrigin-RevId: 9f8a074ffdf44a236859ef6396a8dc7a7d1dc1b6
This commit is contained in:
Dmitry.Krasilschikov
2020-02-09 18:17:27 +02:00
committed by intellij-monorepo-bot
parent 996a2c1baf
commit 99058cc6c6
20 changed files with 83 additions and 34 deletions

View File

@@ -22,6 +22,7 @@ import com.intellij.openapi.actionSystem.ActionPlaces;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonShortcuts;
import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.compiler.CompilerBundle;
import com.intellij.openapi.fileTypes.StdFileTypes;
import com.intellij.openapi.keymap.KeymapUtil;
import com.intellij.openapi.progress.ProgressIndicator;
@@ -200,13 +201,13 @@ public class BuildArtifactAction extends DumbAwareAction {
message = "The output directories of the following artifacts contains source roots:\n" +
info + "Do you want to continue and clear these directories?";
}
final int answer = Messages.showYesNoDialog(myProject, message, "Clean Artifacts", null);
final int answer = Messages.showYesNoDialog(myProject, message, CompilerBundle.message("clean.artifacts"), null);
if (answer != Messages.YES) {
return;
}
}
new Task.Backgroundable(myProject, "Cleaning Artifacts", true) {
new Task.Backgroundable(myProject, CompilerBundle.message("cleaning.artifacts"), true) {
@Override
public void run(@NotNull ProgressIndicator indicator) {
List<File> deleted = new ArrayList<>();
@@ -214,7 +215,8 @@ public class BuildArtifactAction extends DumbAwareAction {
indicator.checkCanceled();
File file = pair.getFirst();
if (!FileUtil.delete(file)) {
Holder.NOTIFICATION_GROUP.createNotification("Cannot clean '" + pair.getSecond().getName() + "' artifact", "cannot delete '" + file.getAbsolutePath() + "'", NotificationType.ERROR, null).notify(myProject);
Holder.NOTIFICATION_GROUP.createNotification(CompilerBundle.message("cannot.clean.0.artifact", pair.getSecond().getName()),
CompilerBundle.message("cannot.delete.0", file.getAbsolutePath()), NotificationType.ERROR, null).notify(myProject);
}
else {
deleted.add(file);

View File

@@ -457,8 +457,9 @@ public final class CompileDriver {
compileTask.start(compileWork, () -> {
if (isRebuild) {
final int rv = Messages.showOkCancelDialog(
myProject, "You are about to rebuild the whole project.\nRun 'Build Project' instead?", "Confirm Project Rebuild",
"Build", "Rebuild", Messages.getQuestionIcon()
myProject, CompilerBundle.message("you.are.about.to.rebuild.the.whole.project"),
CompilerBundle.message("confirm.project.rebuild"),
CommonBundle.message("button.build"), CompilerBundle.message("button.rebuild"), Messages.getQuestionIcon()
);
if (rv == Messages.OK /*yes, please, do run make*/) {
startup(scope, false, false, callback, null);
@@ -486,7 +487,7 @@ public final class CompileDriver {
Collection<String> affectedRoots = ContainerUtil.newHashSet(CompilerPaths.getOutputPaths(affectedModules));
if (!affectedRoots.isEmpty()) {
ProgressIndicator indicator = compileContext.getProgressIndicator();
indicator.setText("Synchronizing output directories...");
indicator.setText(CompilerBundle.message("synchronizing.output.directories"));
CompilerUtil.refreshOutputRoots(affectedRoots);
indicator.setText("");
}

View File

@@ -10,6 +10,7 @@ import com.intellij.ide.errorTreeView.GroupingElement;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.ModalityState;
import com.intellij.openapi.compiler.CompileScope;
import com.intellij.openapi.compiler.CompilerBundle;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.vfs.VirtualFile;

View File

@@ -3,6 +3,7 @@ package com.intellij.compiler.impl;
import com.intellij.ide.errorTreeView.NewErrorTreeViewPanel;
import com.intellij.openapi.actionSystem.DefaultActionGroup;
import com.intellij.openapi.compiler.CompilerBundle;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.NotNull;
@@ -10,7 +11,7 @@ public final class ProblemsViewPanel extends NewErrorTreeViewPanel {
public ProblemsViewPanel(@NotNull Project project) {
super(project, null, false, true, null);
myTree.getEmptyText().setText("No compilation problems found");
myTree.getEmptyText().setText(CompilerBundle.message("no.compilation.problems.found"));
setProgress("", 0.0f); // hack: this will pre-initialize progress UI
}

View File

@@ -38,7 +38,7 @@ public class EclipseCompilerConfigurable implements Configurable {
myAdditionalOptionsField.setDialogCaption(CompilerBundle.message("java.compiler.option.additional.command.line.parameters"));
myAdditionalOptionsField.setDescriptor(null, false);
myPathToEcjField.addBrowseFolderListener(
"Path to ecj compiler tool", null, project,
CompilerBundle.message("path.to.ecj.compiler.tool"), null, project,
new FileChooserDescriptor(true, false, true, true, false, false).withFileFilter(file -> FileTypeRegistry.getInstance().isFileOfType(file, ArchiveFileType.INSTANCE))
);
}

View File

@@ -15,6 +15,7 @@
*/
package com.intellij.compiler.inspection;
import com.intellij.CommonBundle;
import com.intellij.codeInsight.FileModificationService;
import com.intellij.codeInsight.daemon.GroupNames;
import com.intellij.codeInsight.intention.HighPriorityAction;
@@ -22,6 +23,7 @@ import com.intellij.codeInspection.LocalQuickFix;
import com.intellij.codeInspection.ProblemDescriptor;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.WriteAction;
import com.intellij.openapi.compiler.CompilerBundle;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.util.Pair;
@@ -203,8 +205,8 @@ public class ChangeSuperClassFix implements LocalQuickFix, HighPriorityAction {
DialogWrapper dlg = new DialogWrapper(project, false) {
{
setOKButtonText("Remove");
setTitle("Choose Members");
setOKButtonText(CommonBundle.message("button.without.mnemonic.remove"));
setTitle(CompilerBundle.message("choose.members"));
init();
}
@NotNull

View File

@@ -5,6 +5,7 @@ import com.intellij.codeInspection.*;
import com.intellij.compiler.CompilerReferenceService;
import com.intellij.compiler.backwardRefs.CompilerReferenceServiceEx;
import com.intellij.compiler.backwardRefs.ReferenceIndexUnavailableException;
import com.intellij.openapi.compiler.CompilerBundle;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.project.Project;
@@ -84,7 +85,7 @@ public class FrequentlyUsedInheritorInspection extends AbstractBaseJavaLocalInsp
return new ProblemDescriptor[]{manager
.createProblemDescriptor(highlightingElement,
"Class can have more common super class",
CompilerBundle.message("class.can.have.more.common.super.class"),
isOnTheFly,
topInheritorsQuickFix.toArray(LocalQuickFix.EMPTY_ARRAY),
ProblemHighlightType.GENERIC_ERROR_OR_WARNING)};

View File

@@ -19,6 +19,7 @@ import com.intellij.icons.AllIcons;
import com.intellij.openapi.actionSystem.ActionManager;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.ShortcutSet;
import com.intellij.openapi.compiler.CompilerBundle;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.project.Project;
@@ -147,7 +148,7 @@ public class AnnotationProcessorsPanel extends JPanel {
@Override
public TreePath addNode(TreePath parentOrNeighbour) {
final String newProfileName = Messages.showInputDialog(
myProject, "Profile name", "Create new profile", null, "",
myProject, CompilerBundle.message("dialog.message.profile.name"), CompilerBundle.message("title.create.new.profile"), null, "",
new InputValidatorEx() {
@Override
public boolean checkInput(String inputString) {
@@ -328,7 +329,7 @@ public class AnnotationProcessorsPanel extends JPanel {
private class MoveProfileAction extends AnActionButton {
MoveProfileAction() {
super("Move to", AllIcons.Actions.Forward);
super(CompilerBundle.message("action.text.move.to"), AllIcons.Actions.Forward);
}
@Override
@@ -342,7 +343,7 @@ public class AnnotationProcessorsPanel extends JPanel {
profiles.remove(nodeProfile);
final JBPopup popup = JBPopupFactory.getInstance()
.createPopupChooserBuilder(profiles)
.setTitle("Move to")
.setTitle(CompilerBundle.message("action.text.move.to"))
.setItemChosenCallback((chosenProfile) -> {
final Module toSelect = (Module)node.getUserObject();
if (selectedNodes != null) {

View File

@@ -172,11 +172,11 @@ public class CompilerUIConfigurable implements SearchableConfigurable, Configura
myResourcePatternsField.setText(patternsToString(configuration.getResourceFilePatterns()));
if (PowerSaveMode.isEnabled()) {
myEnableAutomakeLegendLabel.setText("(disabled in Power Save mode)");
myEnableAutomakeLegendLabel.setText(CompilerBundle.message("disabled.in.power.save.mode"));
myEnableAutomakeLegendLabel.setFont(myEnableAutomakeLegendLabel.getFont().deriveFont(Font.BOLD));
}
else {
myEnableAutomakeLegendLabel.setText("(only works while not running / debugging)");
myEnableAutomakeLegendLabel.setText(CompilerBundle.message("only.works.while.not.running.debugging"));
myEnableAutomakeLegendLabel.setFont(myEnableAutomakeLegendLabel.getFont().deriveFont(Font.PLAIN));
}
}

View File

@@ -145,7 +145,9 @@ public final class CompilerTask extends Task.Backgroundable {
@NotNull
@Override
public NotificationInfo getNotificationInfo() {
return new NotificationInfo(myErrorCount > 0? "Compiler (errors)" : "Compiler (success)", "Compilation Finished", myErrorCount + " Errors, " + myWarningCount + " Warnings", true);
return new NotificationInfo(myErrorCount > 0? "Compiler (errors)" : "Compiler (success)",
CompilerBundle.message("compilation.finished"),
CompilerBundle.message("0.errors.1.warnings", myErrorCount, myWarningCount), true);
}
private CloseListener myCloseListener;

View File

@@ -23,10 +23,7 @@ import com.intellij.ide.file.BatchFileChangeListener;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.application.*;
import com.intellij.openapi.compiler.CompilationStatusListener;
import com.intellij.openapi.compiler.CompileContext;
import com.intellij.openapi.compiler.CompilerPaths;
import com.intellij.openapi.compiler.CompilerTopics;
import com.intellij.openapi.compiler.*;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Document;

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.packaging.impl.artifacts;
import com.intellij.openapi.compiler.CompilerBundle;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleType;
import com.intellij.openapi.project.Project;
@@ -38,7 +39,7 @@ public class JarArtifactFromModulesDialog extends DialogWrapper {
public JarArtifactFromModulesDialog(PackagingElementResolvingContext context) {
super(context.getProject());
myContext = context;
setTitle("Create JAR from Modules");
setTitle(CompilerBundle.message("create.jar.from.modules"));
myMainClassLabel.setLabelFor(myMainClassField.getTextField());
myManifestDirLabel.setLabelFor(myManifestDirField.getTextField());
@@ -77,7 +78,7 @@ public class JarArtifactFromModulesDialog extends DialogWrapper {
}
myModuleComboBox.setRenderer(SimpleListCellRenderer.create((label, value, index) -> {
label.setIcon(value != null ? ModuleType.get(value).getIcon() : null);
label.setText(value != null ? value.getName() : "<All Modules>");
label.setText(value != null ? value.getName() : CompilerBundle.message("all.modules"));
}));
new ComboboxSpeedSearch(myModuleComboBox) {
@Override

View File

@@ -17,6 +17,7 @@ package com.intellij.packaging.impl.artifacts;
import com.intellij.CommonBundle;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.compiler.CompilerBundle;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.Project;
@@ -77,7 +78,7 @@ public class JarFromModulesTemplate extends ArtifactTemplate {
}
catch (IOException e) {
LOG.info(e);
Messages.showErrorDialog(project, "Cannot create directory '" + directoryForManifest + "': " + e.getMessage(),
Messages.showErrorDialog(project, CompilerBundle.message("cannot.create.directory.0.1", directoryForManifest, e.getMessage()),
CommonBundle.getErrorTitle());
return null;
}

View File

@@ -59,7 +59,8 @@ class ArchiveElementType extends CompositePackagingElementType<ArchivePackagingE
@Override
public CompositePackagingElement<?> createComposite(CompositePackagingElement<?> parent, @Nullable String baseName, @NotNull ArtifactEditorContext context) {
final String initialValue = PackagingElementFactoryImpl.suggestFileName(parent, baseName != null ? baseName : "archive", ".jar");
final String path = Messages.showInputDialog(context.getProject(), "Enter archive name: ", "New Archive", null, initialValue, new FilePathValidator());
final String path = Messages.showInputDialog(context.getProject(), CompilerBundle.message("enter.archive.name"),
CompilerBundle.message("title.new.archive"), null, initialValue, new FilePathValidator());
if (path == null) return null;
return PackagingElementFactoryImpl.createDirectoryOrArchiveWithParents(path, true);
}

View File

@@ -58,7 +58,8 @@ class DirectoryElementType extends CompositePackagingElementType<DirectoryPackag
@Override
public CompositePackagingElement<?> createComposite(CompositePackagingElement<?> parent, String baseName, @NotNull ArtifactEditorContext context) {
final String initialValue = PackagingElementFactoryImpl.suggestFileName(parent, baseName != null ? baseName : "folder", "");
String path = Messages.showInputDialog(context.getProject(), "Enter directory name: ", "New Directory", null, initialValue, new FilePathValidator());
String path = Messages.showInputDialog(context.getProject(), CompilerBundle.message("dialog.message.enter.directory.name"),
CompilerBundle.message("title.new.directory"), null, initialValue, new FilePathValidator());
if (path == null) return null;
return PackagingElementFactoryImpl.createDirectoryOrArchiveWithParents(path, false);
}

View File

@@ -8,6 +8,7 @@ import com.intellij.ide.util.TreeClassChooserFactory;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.ReadAction;
import com.intellij.openapi.application.WriteAction;
import com.intellij.openapi.compiler.CompilerBundle;
import com.intellij.openapi.compiler.make.ManifestBuilder;
import com.intellij.openapi.deployment.DeploymentUtil;
import com.intellij.openapi.diagnostic.Logger;
@@ -268,7 +269,7 @@ public class ManifestFileUtil {
public static FileChooserDescriptor createDescriptorForManifestDirectory() {
FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
descriptor.setTitle("Select Directory for META-INF/MANIFEST.MF file");
descriptor.setTitle(CompilerBundle.message("select.directory.for.meta.inf.manifest.mf.file"));
return descriptor;
}

View File

@@ -71,7 +71,7 @@ public class PackageFileWorker {
public static ActionCallback startPackagingFiles(final Project project, final List<? extends VirtualFile> files,
final Artifact[] artifacts, final boolean packIntoArchives) {
final ActionCallback callback = new ActionCallback();
ProgressManager.getInstance().run(new Task.Backgroundable(project, "Packaging Files") {
ProgressManager.getInstance().run(new Task.Backgroundable(project, CompilerBundle.message("packaging.files")) {
@Override
public void run(@NotNull ProgressIndicator indicator) {
try {
@@ -84,7 +84,7 @@ public class PackageFileWorker {
catch (IOException e) {
LOG.info(e);
String message = CompilerBundle.message("message.tect.package.file.io.error", e.toString());
Notifications.Bus.notify(new Notification("Package File", "Cannot package file", message, NotificationType.ERROR));
Notifications.Bus.notify(new Notification("Package File", CompilerBundle.message("cannot.package.file"), message, NotificationType.ERROR));
}
});
callback.setDone();

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.packaging.impl.ui.properties;
import com.intellij.openapi.compiler.CompilerBundle;
import com.intellij.openapi.fileChooser.FileChooser;
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
import com.intellij.openapi.ui.Messages;
@@ -48,7 +49,7 @@ public abstract class ElementWithManifestPropertiesPanel<E extends CompositeElem
myClasspathField.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Messages.showTextAreaDialog(myClasspathField.getTextField(), "Edit Classpath", "classpath-attribute-editor");
Messages.showTextAreaDialog(myClasspathField.getTextField(), CompilerBundle.message("edit.classpath"), "classpath-attribute-editor");
}
});
myClasspathField.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {
@@ -90,7 +91,7 @@ public abstract class ElementWithManifestPropertiesPanel<E extends CompositeElem
file.getName().equalsIgnoreCase(ManifestFileUtil.MANIFEST_FILE_NAME));
}
};
descriptor.setTitle("Specify Path to MANIFEST.MF File");
descriptor.setTitle(CompilerBundle.message("specify.path.to.manifest.mf.file"));
final VirtualFile file = FileChooser.chooseFile(descriptor, myContext.getProject(), null);
if (file == null) return;
@@ -119,8 +120,8 @@ public abstract class ElementWithManifestPropertiesPanel<E extends CompositeElem
@Override
public void reset() {
myTitleLabel.setText("'" + myElement.getName() + "' manifest properties:");
myManifestNotFoundLabel.setText("META-INF/MANIFEST.MF file not found in '" + myElement.getName() + "'");
myTitleLabel.setText(CompilerBundle.message("0.manifest.properties", myElement.getName()));
myManifestNotFoundLabel.setText(CompilerBundle.message("meta.inf.manifest.mf.file.not.found.in.0", myElement.getName()));
updateManifest();
}

View File

@@ -54,6 +54,7 @@ action.text.advanced.ellipsis=Advanced...
button.without.mnemonics.cancel=Cancel
button.without.mnemonic.close=Close
button.without.mnemonic.remove=Remove
action.text.toggle=Toggle
action.text.filter=Filter
@@ -69,6 +70,7 @@ button.set=Set
button.exclude=Exclude
button.overwrite=Overwrite
button.reuse=Reuse
button.build=Build
label.filter=Filter
label.no.data=No data

View File

@@ -192,4 +192,37 @@ settings.test.sources.directory=Test sources directory:
settings.processor.fq.name=Processor FQ Name
settings.validate.on.build=Validate on build
settings.exclude.from.validation=Exclude from validation:
settings.validators=Validators:
settings.validators=Validators:
no.compilation.problems.found=No compilation problems found
cannot.package.file=Cannot package file
packaging.files=Packaging Files
only.works.while.not.running.debugging=(only works while not running / debugging)
disabled.in.power.save.mode=(disabled in Power Save mode)
path.to.ecj.compiler.tool=Path to ecj compiler tool
choose.members=Choose Members
all.modules=<All Modules>
create.jar.from.modules=Create JAR from Modules
cannot.delete.0=cannot delete ''{0}''
cannot.clean.0.artifact=Cannot clean ''{0}'' artifact
cleaning.artifacts=Cleaning Artifacts
clean.artifacts=Clean Artifacts
0.errors.1.warnings={0} Errors, {1} Warnings
compilation.finished=Compilation Finished
meta.inf.manifest.mf.file.not.found.in.0=META-INF/MANIFEST.MF file not found in ''{0}''
0.manifest.properties=''{0}'' manifest properties:
specify.path.to.manifest.mf.file=Specify Path to MANIFEST.MF File
edit.classpath=Edit Classpath
synchronizing.output.directories=Synchronizing output directories...
button.rebuild=Rebuild
confirm.project.rebuild=Confirm Project Rebuild
you.are.about.to.rebuild.the.whole.project=You are about to rebuild the whole project.\nRun 'Build Project' instead?
class.can.have.more.common.super.class=Class can have more common super class
cannot.create.directory.0.1=Cannot create directory ''{0}'': {1}
select.directory.for.meta.inf.manifest.mf.file=Select Directory for META-INF/MANIFEST.MF file
title.new.archive=New Archive
enter.archive.name=Enter archive name:
action.text.move.to=Move to
title.create.new.profile=Create new profile
dialog.message.profile.name=Profile name
title.new.directory=New Directory
dialog.message.enter.directory.name=Enter directory name: