[java-i18n] compiler

GitOrigin-RevId: 61a024f269d8f7fe5339748a5c2759cc882904e1
This commit is contained in:
Ilyas Selimov
2020-08-10 22:12:24 +07:00
committed by intellij-monorepo-bot
parent 2dc643d86f
commit c2511e3a9f
16 changed files with 60 additions and 31 deletions

View File

@@ -2,6 +2,7 @@
package com.intellij.compiler.actions;
import com.intellij.ide.highlighter.JavaFileType;
import com.intellij.idea.ActionsBundle;
import com.intellij.lang.IdeLanguageCustomization;
import com.intellij.notification.NotificationGroup;
import com.intellij.notification.NotificationType;
@@ -177,15 +178,15 @@ public class BuildArtifactAction extends DumbAwareAction {
if (outputPathContainingSourceRoots.size() == 1 && outputPathContainingSourceRoots.values().size() == 1) {
final String name = ContainerUtil.getFirstItem(outputPathContainingSourceRoots.keySet());
final String output = outputPathContainingSourceRoots.get(name);
message = "The output directory '" + output + "' of '" + name + "' artifact contains source roots of the project. Do you want to continue and clear it?";
message = JavaCompilerBundle.message("dialog.message.output.dir.contains.source.roots", output, name);
}
else {
StringBuilder info = new StringBuilder();
for (String name : outputPathContainingSourceRoots.keySet()) {
info.append(" '").append(name).append("' artifact ('").append(outputPathContainingSourceRoots.get(name)).append("')\n");
info.append(JavaCompilerBundle.message("dialog.message.output.dir.artifact", name, outputPathContainingSourceRoots.get(name)))
.append("\n");
}
message = "The output directories of the following artifacts contains source roots:\n" +
info + "Do you want to continue and clear these directories?";
message = JavaCompilerBundle.message("dialog.message.output.dirs.contain.source.roots", info);
}
final int answer = Messages.showYesNoDialog(myProject, message, JavaCompilerBundle.message("clean.artifacts"), null);
if (answer != Messages.YES) {
@@ -293,7 +294,7 @@ public class BuildArtifactAction extends DumbAwareAction {
ChooseArtifactStep(List<ArtifactPopupItem> artifacts,
Artifact first,
Project project, final ArtifactAwareProjectSettingsService settingsService) {
super("Build Artifact", artifacts);
super(ActionsBundle.message("group.BuildArtifactsGroup.text"), artifacts);
myFirst = first;
myProject = project;
mySettingsService = settingsService;
@@ -337,7 +338,8 @@ public class BuildArtifactAction extends DumbAwareAction {
if (mySettingsService != null) {
actions.add(new EditArtifactItem(selectedValues, myProject, mySettingsService));
}
return new BaseListPopupStep<ArtifactActionItem>(selectedValues.size() == 1 ? "Action" : "Action for " + selectedValues.size() + " artifacts", actions) {
String title = JavaCompilerBundle.message("popup.title.chosen.artifact.action", selectedValues.size());
return new BaseListPopupStep<ArtifactActionItem>(title, actions) {
@NotNull
@Override
public String getTextFor(ArtifactActionItem value) {

View File

@@ -15,6 +15,7 @@
*/
package com.intellij.compiler.backwardRefs.view;
import com.intellij.ide.IdeBundle;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.DataProvider;
import com.intellij.openapi.fileEditor.OpenFileDescriptor;
@@ -67,8 +68,7 @@ public class InternalCompilerRefServiceView extends JPanel implements DataProvid
append((String)userObject, SimpleTextAttributes.GRAY_ATTRIBUTES);
}
else if (userObject instanceof VirtualFile) {
append(((VirtualFile)userObject).getName());
append(" in ");
append(IdeBundle.message("x.in.y", ((VirtualFile)userObject).getName(), ""));
append(((VirtualFile)userObject).getParent().getPath(), SimpleTextAttributes.GRAY_ATTRIBUTES);
} else if (userObject instanceof PsiFunctionalExpression) {
append(ClassPresentationUtil.getFunctionalExpressionPresentation((PsiFunctionalExpression)userObject, true));

View File

@@ -3,6 +3,7 @@ package com.intellij.compiler.backwardRefs.view;
import com.intellij.compiler.CompilerReferenceService;
import com.intellij.compiler.backwardRefs.CompilerReferenceServiceImpl;
import com.intellij.openapi.compiler.JavaCompilerBundle;
import com.intellij.psi.PsiClass;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiField;
@@ -11,7 +12,7 @@ import org.jetbrains.annotations.NotNull;
public final class TestCompilerRefFindUsagesAction extends TestCompilerReferenceServiceAction {
public TestCompilerRefFindUsagesAction() {
super("Compiler Reference Find Usages");
super(JavaCompilerBundle.message("action.compiler.reference.find.usages.text"));
}
@Override

View File

@@ -3,6 +3,7 @@ package com.intellij.compiler.backwardRefs.view;
import com.intellij.compiler.backwardRefs.CompilerReferenceServiceImpl;
import com.intellij.ide.highlighter.JavaFileType;
import com.intellij.openapi.compiler.JavaCompilerBundle;
import com.intellij.psi.LambdaUtil;
import com.intellij.psi.PsiClass;
import com.intellij.psi.PsiElement;
@@ -13,7 +14,7 @@ import org.jetbrains.annotations.Nullable;
public final class TestCompilerRefFunctionalExpressionSearchAction extends TestCompilerHierarchyBaseAction {
public TestCompilerRefFunctionalExpressionSearchAction() {
super("Compiler Reference Functional Expression Search");
super(JavaCompilerBundle.message("action.compiler.reference.functional.expression.search.text"));
}
@Nullable

View File

@@ -3,6 +3,7 @@ package com.intellij.compiler.backwardRefs.view;
import com.intellij.compiler.backwardRefs.CompilerReferenceServiceImpl;
import com.intellij.ide.highlighter.JavaFileType;
import com.intellij.openapi.compiler.JavaCompilerBundle;
import com.intellij.psi.PsiClass;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiNamedElement;
@@ -12,7 +13,7 @@ import org.jetbrains.annotations.Nullable;
public class TestCompilerRefInheritanceAction extends TestCompilerHierarchyBaseAction {
public TestCompilerRefInheritanceAction() {
super("Compiler Reference Direct Inheritor Search");
super(JavaCompilerBundle.message("action.compiler.reference.direct.inheritor.search.text"));
}
@Override

View File

@@ -415,7 +415,7 @@ public final class CompileDriver {
compileContext.addMessage(message);
}
if (isRebuild) {
CompilerUtil.runInContext(compileContext, "Clearing build system data...",
CompilerUtil.runInContext(compileContext, JavaCompilerBundle.message("progress.text.clearing.build.system.data"),
(ThrowableRunnable<Throwable>)() -> compilerCacheManager
.clearCaches(compileContext));
}

View File

@@ -190,7 +190,7 @@ public class ChangeSuperClassFix implements LocalQuickFix, HighPriorityAction {
return ContainerUtil.map(candidates, c -> (PsiMethod)c.getMember());
}
MemberSelectionPanel panel =
new MemberSelectionPanel("<html>Choose members to delete since they are already defined in <b>" + newClassName + "</b>",
new MemberSelectionPanel(JavaCompilerBundle.message("separator.choose.members.to.delete", newClassName),
candidates,
null);
DialogWrapper dlg = new DialogWrapper(project, false) {

View File

@@ -160,8 +160,8 @@ public class AnnotationProcessorsPanel extends JPanel {
return null;
}
return StringUtil.isEmpty(inputString)
? "Profile name shouldn't be empty"
: "Profile " + inputString + " already exists";
? JavaCompilerBundle.message("text.empty.profile")
: JavaCompilerBundle.message("text.profile.exists", inputString);
}
});
if (newProfileName != null) {

View File

@@ -73,12 +73,7 @@ public class CompilerUIConfigurable implements SearchableConfigurable, Configura
public CompilerUIConfigurable(@NotNull final Project project) {
myProject = project;
myPatternLegendLabel.setText(XmlStringUtil.wrapInHtml(
"Use <b>;</b> to separate patterns and <b>!</b> to negate a pattern. " +
"Accepted wildcards: <b>?</b> &mdash; exactly one symbol; <b>*</b> &mdash; zero or more symbols; " +
"<b>/</b> &mdash; path separator; <b>/**/</b> &mdash; any number of directories; " +
"<i>&lt;dir_name&gt;</i>:<i>&lt;pattern&gt;</i> &mdash; restrict to source roots with the specified name"
));
myPatternLegendLabel.setText(XmlStringUtil.wrapInHtml(JavaCompilerBundle.message("compiler.ui.pattern.legend.text")));
/*"All source files located in the generated sources output directory WILL BE EXCLUDED from annotation processing. " +*/
myWarningLabel.setText(JavaCompilerBundle.message("settings.warning"));

View File

@@ -141,7 +141,7 @@ class AutoMakeMessageHandler extends DefaultMessageHandler {
if (descr == null) {
descr = failure.hasStacktrace()? failure.getStacktrace() : "";
}
final String msg = "Auto build failure: " + descr;
final String msg = JavaCompilerBundle.message("notification.compiler.auto.build.failure", descr);
CompilerManager.NOTIFICATION_GROUP.createNotification(msg, MessageType.INFO);
ProblemsView.getInstance(myProject).addMessage(new CompilerMessageImpl(myProject, CompilerMessageCategory.ERROR, msg), sessionId);
}
@@ -157,7 +157,7 @@ class AutoMakeMessageHandler extends DefaultMessageHandler {
//statusMessage = "All files are up-to-date";
break;
case ERRORS:
statusMessage = "Auto build completed with errors";
statusMessage = JavaCompilerBundle.message("notification.compiler.auto.build.completed.with.errors");
break;
case CANCELED:
//statusMessage = "Auto make has been canceled";

View File

@@ -288,7 +288,8 @@ public final class ManifestFileUtil {
final GlobalSearchScope searchScope = GlobalSearchScope.allScope(project);
final PsiClass aClass = initialClassName != null ? JavaPsiFacade.getInstance(project).findClass(initialClassName, searchScope) : null;
final TreeClassChooser chooser =
chooserFactory.createWithInnerClassesScopeChooser("Select Main Class", searchScope, new MainClassFilter(), aClass);
chooserFactory.createWithInnerClassesScopeChooser(JavaCompilerBundle.message("dialog.title.manifest.select.main.class"),
searchScope, new MainClassFilter(), aClass);
chooser.showDialog();
return chooser.getSelected();
}

View File

@@ -17,6 +17,7 @@ package com.intellij.packaging.impl.ui;
import com.intellij.icons.AllIcons;
import com.intellij.ide.projectView.PresentationData;
import com.intellij.openapi.compiler.JavaCompilerBundle;
import com.intellij.openapi.util.NlsContexts;
import com.intellij.packaging.artifacts.Artifact;
import com.intellij.packaging.artifacts.ArtifactPointer;
@@ -40,7 +41,8 @@ public class ArtifactElementPresentation extends TreeNodePresentation {
@Override
public @NlsContexts.Label String getPresentableName() {
return myArtifactPointer != null ? myArtifactPointer.getArtifactName(myContext.getArtifactModel()) : "<unknown>";
return myArtifactPointer != null ? myArtifactPointer.getArtifactName(myContext.getArtifactModel()) :
JavaCompilerBundle.message("label.unknown.value");
}
@Override

View File

@@ -17,7 +17,7 @@ package com.intellij.packaging.impl.ui;
import com.intellij.icons.AllIcons;
import com.intellij.ide.projectView.PresentationData;
import com.intellij.openapi.util.NlsSafe;
import com.intellij.openapi.compiler.JavaCompilerBundle;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.packaging.impl.elements.ExtractedDirectoryPackagingElement;
@@ -54,7 +54,7 @@ public class ExtractedDirectoryPresentation extends PackagingElementPresentation
commentAttributes = SimpleTextAttributes.ERROR_ATTRIBUTES;
}
}
presentationData.addText("Extracted '" + getPresentableName() + "'", mainAttributes);
presentationData.addText(JavaCompilerBundle.message("label.extracted.dir.presentation", getPresentableName()), mainAttributes);
presentationData.addText(" (" + parentPath + ")", commentAttributes);
}

View File

@@ -16,6 +16,7 @@
package com.intellij.packaging.impl.ui;
import com.intellij.ide.projectView.PresentationData;
import com.intellij.openapi.compiler.JavaCompilerBundle;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.roots.impl.ModuleLibraryTableBase;
import com.intellij.openapi.roots.impl.libraries.LibraryEx;
@@ -70,8 +71,9 @@ public class LibraryElementPresentation extends PackagingElementPresentation {
presentationData.addText(getLibraryTableComment(myLibrary), commentAttributes);
}
else {
presentationData.addText(getPresentableName() + " (" + (myModuleName != null ? "module '" + myModuleName + "'" : myLevel) + ")",
SimpleTextAttributes.ERROR_ATTRIBUTES);
presentationData.addText(getPresentableName() + " (" + (myModuleName != null ?
JavaCompilerBundle.message("label.library.element.module", myModuleName)
: myLevel) + ")", SimpleTextAttributes.ERROR_ATTRIBUTES);
}
}

View File

@@ -205,4 +205,27 @@ progress.title.cancelling.auto.make.builds=Cancelling Auto-Make Builds
intention.name.make.implements=Make implements ''{0}''
intention.name.make.extends=Make extends ''{0}''
classes.up.to.date.check=Classes up-to-Date Check
action.run.all.affected.tests.text=Run All Affected Tests
action.run.all.affected.tests.text=Run All Affected Tests
popup.title.chosen.artifact.action=Action{0,choice,0# For {0} Artifacts|1#|2# For {0} Artifacts}
dialog.message.output.dir.contains.source.roots=The output directory ''{0}'' of ''{1}'' artifact contains source roots of the project.\
Do you want to continue and clear it?
dialog.message.output.dir.artifact= ''{0}'' artifact (''{1}'')
dialog.message.output.dirs.contain.source.roots=The output directories of the following artifacts contains source roots:\n\
{0}Do you want to continue and clear these directories?
action.compiler.reference.find.usages.text=Compiler Reference Find Usages
action.compiler.reference.functional.expression.search.text=Compiler Reference Functional Expression Search
action.compiler.reference.direct.inheritor.search.text=Compiler Reference Direct Inheritor Search
progress.text.clearing.build.system.data=Clearing build system data...
separator.choose.members.to.delete=<html>Choose Members To Delete Since They Are Already Defined In <b>{0}</b>
text.empty.profile=Profile name shouldn't be empty
text.profile.exists=Profile {0} already exists
compiler.ui.pattern.legend.text=Use <b>;</b> to separate patterns and <b>!</b> to negate a pattern. \
Accepted wildcards: <b>?</b> \\&mdash; exactly one symbol; <b>*</b> \\&mdash; zero or more symbols; \
<b>/</b> \\&mdash; path separator; <b>/**/</b> \\&mdash; any number of directories; \
<i>\\&lt;dir_name\\&gt;</i>:<i>\\&lt;pattern\\&gt;</i> \\&mdash; restrict to source roots with the specified name
notification.compiler.auto.build.failure=Auto build failure: {0}
notification.compiler.auto.build.completed.with.errors=Auto build completed with errors
dialog.title.manifest.select.main.class=Select Main Class
label.unknown.value=<unknown>
label.extracted.dir.presentation=Extracted ''{0}''
label.library.element.module=module ''{0}''

View File

@@ -2282,4 +2282,5 @@ link.install.required.plugins=Install required plugins
link.enable.required.plugins=Enable required plugins
link.enable.required.plugin=Enable {0}
x.and.y={0} and {1}
x.and.y={0} and {1}
x.in.y={0} in {1}