localize "Code Insight" hardcoded literals

GitOrigin-RevId: c91cc2515fe7c32a1babaf7f94eb1ea44277bebf
This commit is contained in:
Dmitry.Krasilschikov
2020-02-04 16:23:32 +02:00
committed by intellij-monorepo-bot
parent e9601ca666
commit f95ca036b8
14 changed files with 50 additions and 19 deletions

View File

@@ -15,6 +15,7 @@
*/
package com.intellij.codeInsight.daemon.impl.actions;
import com.intellij.codeInsight.CodeInsightBundle;
import com.intellij.codeInsight.daemon.HighlightDisplayKey;
import com.intellij.codeInspection.JavaSuppressionUtil;
import com.intellij.psi.PsiElement;
@@ -45,6 +46,6 @@ public class SuppressLocalWithCommentFix extends SuppressByJavaCommentFix {
@NotNull
@Override
public String getText() {
return "Suppress for statement with comment";
return CodeInsightBundle.message("suppress.for.statement.with.comment");
}
}

View File

@@ -15,6 +15,7 @@
*/
package com.intellij.codeInsight.daemon.impl.actions;
import com.intellij.codeInsight.CodeInsightBundle;
import com.intellij.codeInsight.daemon.HighlightDisplayKey;
import com.intellij.codeInspection.JavaSuppressionUtil;
import com.intellij.openapi.project.Project;
@@ -45,7 +46,7 @@ public class SuppressParameterFix extends AbstractBatchSuppressByNoInspectionCom
@Override
@NotNull
public String getText() {
return "Suppress for parameter";
return CodeInsightBundle.message("suppress.for.parameter");
}
@Nullable

View File

@@ -2,6 +2,7 @@
package com.intellij.codeInsight.daemon.impl.analysis;
import com.intellij.codeInsight.AnnotationTargetUtil;
import com.intellij.codeInsight.CodeInsightBundle;
import com.intellij.codeInsight.daemon.JavaErrorBundle;
import com.intellij.codeInsight.daemon.impl.HighlightInfo;
import com.intellij.codeInsight.daemon.impl.HighlightInfoType;
@@ -768,7 +769,7 @@ public class AnnotationsHighlightUtil {
@NotNull
@Override
public String getText() {
return "Remove";
return CodeInsightBundle.message("remove");
}
@NotNull

View File

@@ -15,6 +15,7 @@
*/
package com.intellij.codeInsight.daemon.impl.quickfix;
import com.intellij.codeInsight.CodeInsightBundle;
import com.intellij.codeInsight.daemon.impl.HighlightInfo;
import com.intellij.codeInsight.intention.IntentionAction;
import com.intellij.openapi.diagnostic.Logger;
@@ -45,7 +46,7 @@ public class AddTypeArgumentsConditionalFix implements IntentionAction {
@NotNull
@Override
public String getText() {
return "Add explicit type arguments";
return CodeInsightBundle.message("add.explicit.type.arguments");
}
@NotNull

View File

@@ -15,6 +15,7 @@
*/
package com.intellij.codeInsight.daemon.impl.quickfix;
import com.intellij.codeInsight.CodeInsightBundle;
import com.intellij.codeInsight.daemon.impl.HighlightInfo;
import com.intellij.codeInsight.intention.HighPriorityAction;
import com.intellij.codeInsight.intention.IntentionAction;
@@ -58,17 +59,17 @@ public class ChangeTypeArgumentsFix implements IntentionAction, HighPriorityActi
@NotNull
public String getText() {
final PsiSubstitutor substitutor = inferTypeArguments();
return "Change type arguments to <" + StringUtil.join(myPsiClass.getTypeParameters(), typeParameter -> {
return CodeInsightBundle.message("change.type.arguments.to.0", StringUtil.join(myPsiClass.getTypeParameters(), typeParameter -> {
final PsiType substituted = substitutor.substitute(typeParameter);
return substituted != null ? substituted.getPresentableText() : CommonClassNames.JAVA_LANG_OBJECT;
}, ", ") + ">";
}, ", "));
}
@Override
@NotNull
public String getFamilyName() {
return "Change type arguments";
return CodeInsightBundle.message("change.type.arguments");
}
@Override

View File

@@ -15,6 +15,7 @@
*/
package com.intellij.codeInsight.daemon.impl.quickfix;
import com.intellij.codeInsight.CodeInsightBundle;
import com.intellij.codeInsight.daemon.impl.HighlightInfo;
import com.intellij.codeInsight.intention.IntentionAction;
import com.intellij.codeInsight.intention.impl.BaseIntentionAction;
@@ -38,7 +39,7 @@ public class ConvertDoubleToFloatFix implements IntentionAction {
@NotNull
@Override
public String getText() {
return "Convert '" + myExpression.getText() + "' to float";
return CodeInsightBundle.message("convert.0.to.float", myExpression.getText());
}
@NotNull

View File

@@ -15,6 +15,7 @@
*/
package com.intellij.codeInsight.daemon.impl.quickfix;
import com.intellij.codeInsight.CodeInsightBundle;
import com.intellij.codeInsight.intention.IntentionAction;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
@@ -40,13 +41,13 @@ public class DeleteRepeatedInterfaceFix implements IntentionAction {
@NotNull
@Override
public String getText() {
return "Delete repeated '" + myConjunct.getText() + "'";
return CodeInsightBundle.message("delete.repeated.0", myConjunct.getText());
}
@NotNull
@Override
public String getFamilyName() {
return "Delete repeated interface";
return CodeInsightBundle.message("delete.repeated.interface");
}
@Override

View File

@@ -15,6 +15,7 @@
*/
package com.intellij.codeInsight.daemon.impl.quickfix;
import com.intellij.codeInsight.CodeInsightBundle;
import com.intellij.codeInsight.intention.IntentionAction;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Editor;
@@ -49,13 +50,13 @@ public class FlipIntersectionSidesFix implements IntentionAction {
@NotNull
@Override
public String getText() {
return "Move '" + myClassName + "' to the beginning";
return CodeInsightBundle.message("move.0.to.the.beginning", myClassName);
}
@NotNull
@Override
public String getFamilyName() {
return "Move to front";
return CodeInsightBundle.message("move.to.front");
}
@Override

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.codeInsight.daemon.impl.quickfix;
import com.intellij.codeInsight.CodeInsightBundle;
import com.intellij.codeInsight.ExceptionUtil;
import com.intellij.codeInsight.daemon.QuickFixBundle;
import com.intellij.codeInsight.javadoc.JavaDocUtil;
@@ -138,9 +139,10 @@ public abstract class MethodThrowsFix extends LocalQuickFixOnPsiElement {
}
}
return true;
}), "Processing Method Usages...", true, project);
}), CodeInsightBundle.message("processing.method.usages"), true, project);
if (breakSourceCode && Messages.showYesNoDialog(project, "Exception removal will break source code. Proceed anyway?", RefactoringBundle.getCannotRefactorMessage(null), null) == Messages.NO) {
if (breakSourceCode && Messages.showYesNoDialog(project, CodeInsightBundle
.message("exception.removal.will.break.source.code.proceed.anyway"), RefactoringBundle.getCannotRefactorMessage(null), null) == Messages.NO) {
return;
}
}

View File

@@ -16,6 +16,7 @@
package com.intellij.codeInsight.daemon.impl.quickfix;
import com.intellij.codeInsight.CodeInsightBundle;
import com.intellij.codeInsight.intention.IntentionAction;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Editor;
@@ -64,7 +65,7 @@ public abstract class QualifyThisOrSuperArgumentFix implements IntentionAction {
@NotNull
@Override
public String getFamilyName() {
return "Qualify " + getQualifierText();
return CodeInsightBundle.message("qualify.0", getQualifierText());
}
@Override

View File

@@ -15,6 +15,7 @@
*/
package com.intellij.codeInsight.daemon.impl.quickfix;
import com.intellij.codeInsight.CodeInsightBundle;
import com.intellij.codeInsight.intention.IntentionAction;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
@@ -35,7 +36,7 @@ public class QualifyWithThisFix implements IntentionAction {
@NotNull
@Override
public String getText() {
return "Qualify with " + myContainingClass.getName() + ".this";
return CodeInsightBundle.message("qualify.with.0.this", myContainingClass.getName());
}
@NotNull

View File

@@ -15,6 +15,7 @@
*/
package com.intellij.codeInsight.daemon.impl.quickfix;
import com.intellij.codeInsight.CodeInsightBundle;
import com.intellij.codeInsight.intention.IntentionAction;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
@@ -45,7 +46,7 @@ public class ReplaceAssignmentFromVoidWithStatementIntentionAction implements In
@NotNull
@Override
public String getFamilyName() {
return "Remove left side of assignment";
return CodeInsightBundle.message("remove.left.side.of.assignment");
}
@Override

View File

@@ -3,6 +3,7 @@
*/
package com.intellij.codeInsight.daemon.impl.quickfix;
import com.intellij.codeInsight.CodeInsightBundle;
import com.intellij.codeInsight.daemon.impl.HighlightInfo;
import com.intellij.codeInsight.intention.HighPriorityAction;
import com.intellij.codeInspection.LocalQuickFixAndIntentionActionOnPsiElement;
@@ -58,7 +59,7 @@ public class ReplaceGetClassWithClassLiteralFix extends LocalQuickFixAndIntentio
@NotNull
@Override
public String getFamilyName() {
return "Replace getClass() with .class literal";
return CodeInsightBundle.message("replace.get.class.with.class.literal");
}
public static void registerFix(PsiMethodCallExpression callExpression, HighlightInfo errorResult) {

View File

@@ -697,4 +697,21 @@ action.AnActionButton.text.open.as.popup=Open as Popup
action.presentation.DocumentationComponent.text=Edit Source
action.presentation.LookupUi.text=action.presentation.LookupUi.text
action.presentation.QuickFixPreviewPanelFactory.text=Fix partially
action.presentation.QuickFixPreviewPanelFactory.text.suppress=Suppress
action.presentation.QuickFixPreviewPanelFactory.text.suppress=Suppress
convert.0.to.float=Convert ''{0}'' to float
suppress.for.parameter=Suppress for parameter
exception.removal.will.break.source.code.proceed.anyway=Exception removal will break source code. Proceed anyway?
processing.method.usages=Processing Method Usages...
add.explicit.type.arguments=Add explicit type arguments
qualify.0=Qualify {0}
move.to.front=Move to front
move.0.to.the.beginning=Move ''{0}'' to the beginning
delete.repeated.interface=Delete repeated interface
delete.repeated.0=Delete repeated ''{0}''
qualify.with.0.this=Qualify with {0}.this
remove=Remove
replace.get.class.with.class.literal=Replace getClass() with .class literal
suppress.for.statement.with.comment=Suppress for statement with comment
remove.left.side.of.assignment=Remove left side of assignment
change.type.arguments=Change type arguments
change.type.arguments.to.0=Change type arguments to <{0}>