Migrate to simplified collection: i18n

This commit is contained in:
Tagir Valeev
2017-02-27 16:34:09 +07:00
parent 5459f1f931
commit 05a2a29300
2 changed files with 11 additions and 8 deletions
@@ -15,10 +15,7 @@
*/
package com.intellij.codeInspection.java19api;
import com.intellij.codeInspection.LocalQuickFix;
import com.intellij.codeInspection.ProblemDescriptor;
import com.intellij.codeInspection.ProblemHighlightType;
import com.intellij.codeInspection.ProblemsHolder;
import com.intellij.codeInspection.*;
import com.intellij.codeInspection.ex.BaseLocalInspectionTool;
import com.intellij.codeInspection.ui.SingleCheckboxOptionsPanel;
import com.intellij.openapi.project.Project;
@@ -73,7 +70,8 @@ public class Java9CollectionFactoryInspection extends BaseLocalInspectionTool {
@Nullable
@Override
public JComponent createOptionsPanel() {
return new SingleCheckboxOptionsPanel("Do not warn when content is non-constant", this, "IGNORE_NON_CONSTANT");
return new SingleCheckboxOptionsPanel(InspectionsBundle.message("inspection.collection.factories.option.ignore.non.constant"), this,
"IGNORE_NON_CONSTANT");
}
@NotNull
@@ -96,7 +94,7 @@ public class Java9CollectionFactoryInspection extends BaseLocalInspectionTool {
InspectionProjectProfileManager.isInformationLevel(getShortName(), call));
PsiElement element = wholeStatement ? call : call.getMethodExpression().getReferenceNameElement();
if(element != null) {
holder.registerProblem(element, "Can be replaced with '" + model.myType + ".of' call", type,
holder.registerProblem(element, InspectionsBundle.message("inspection.collection.factories.message", model.myType), type,
new ReplaceWithCollectionFactoryFix(model.myType));
}
}
@@ -283,14 +281,14 @@ public class Java9CollectionFactoryInspection extends BaseLocalInspectionTool {
@NotNull
@Override
public String getName() {
return "Replace with '"+myType+".of' call";
return InspectionsBundle.message("inspection.collection.factories.fix.name", myType);
}
@Nls
@NotNull
@Override
public String getFamilyName() {
return "Replace with collection factory call";
return InspectionsBundle.message("inspection.collection.factories.fix.family.name");
}
@Override
@@ -784,3 +784,8 @@ inspection.redundant.stream.optional.call.option.streamboxing=Report useless box
inspection.map.foreach.message=Can be replaced with 'Map.forEach'
inspection.map.foreach.fix.name=Replace with Map.forEach
inspection.map.foreach.option.no.loops=Do not report loops
inspection.collection.factories.message=Can be replaced with ''{0}.of'' call
inspection.collection.factories.option.ignore.non.constant=Do not warn when content is non-constant
inspection.collection.factories.fix.family.name=Replace with collection factory call
inspection.collection.factories.fix.name=Replace with ''{0}.of'' call