PY-40431 [i18n] PyInspectionsSuppressor fixes i18n

GitOrigin-RevId: 49559b64b5899ffd09a0bad0688c04409e087bc9
This commit is contained in:
Anton Bragin
2020-05-13 17:28:26 +00:00
committed by intellij-monorepo-bot
parent 7739ed4aab
commit 7b7dd70435
2 changed files with 11 additions and 5 deletions
@@ -772,6 +772,11 @@ INSP.python.trailing.suffix.not.support=Python does not support a trailing ''{0}
# PyInterpreterInspection
python.sdk.no.interpreter.configured.owner=No Python interpreter configured for the {0}
# PyInspectionsSuppressor
INSP.python.suppressor.suppress.for.function=Suppress for function
INSP.python.suppressor.suppress.for.class=Suppress for class
INSP.python.suppressor.suppress.for.statement=Suppress for statement
find.usages.unnamed=<unnamed>
find.usages.keyword.argument=keyword argument
find.usages.variable=variable
@@ -7,6 +7,7 @@ import com.intellij.psi.PsiComment;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiWhiteSpace;
import com.intellij.psi.util.PsiTreeUtil;
import com.jetbrains.python.PyPsiBundle;
import com.jetbrains.python.codeInsight.controlflow.ScopeOwner;
import com.jetbrains.python.inspections.quickfix.PySuppressInspectionFix;
import com.jetbrains.python.psi.*;
@@ -25,13 +26,13 @@ public class PyInspectionsSuppressor implements InspectionSuppressor {
public SuppressQuickFix @NotNull [] getSuppressActions(@Nullable PsiElement element, @NotNull String toolId) {
if (PY_INCORRECT_DOCSTRING_INSPECTION_ID.equals(toolId) || PY_MISSING_OR_EMPTY_DOCSTRING_INSPECTION_ID.equals(toolId)) {
return new SuppressQuickFix[]{
new PySuppressInspectionFix(toolId, "Suppress for function", PyFunction.class),
new PySuppressInspectionFix(toolId, "Suppress for class", PyClass.class)
new PySuppressInspectionFix(toolId, PyPsiBundle.message("INSP.python.suppressor.suppress.for.function"), PyFunction.class),
new PySuppressInspectionFix(toolId, PyPsiBundle.message("INSP.python.suppressor.suppress.for.class"), PyClass.class)
};
}
else {
return new SuppressQuickFix[]{
new PySuppressInspectionFix(toolId, "Suppress for statement", PyStatement.class) {
new PySuppressInspectionFix(toolId, PyPsiBundle.message("INSP.python.suppressor.suppress.for.statement"), PyStatement.class) {
@Override
public PsiElement getContainer(PsiElement context) {
if (PsiTreeUtil.getParentOfType(context, PyStatementList.class, false, ScopeOwner.class) != null ||
@@ -41,8 +42,8 @@ public class PyInspectionsSuppressor implements InspectionSuppressor {
return null;
}
},
new PySuppressInspectionFix(toolId, "Suppress for function", PyFunction.class),
new PySuppressInspectionFix(toolId, "Suppress for class", PyClass.class)
new PySuppressInspectionFix(toolId, PyPsiBundle.message("INSP.python.suppressor.suppress.for.function"), PyFunction.class),
new PySuppressInspectionFix(toolId, PyPsiBundle.message("INSP.python.suppressor.suppress.for.class"), PyClass.class)
};
}
}