From 7b7dd70435fc0620d5af7d23f5ba542e8dbc518e Mon Sep 17 00:00:00 2001 From: Anton Bragin Date: Wed, 13 May 2020 20:19:20 +0300 Subject: [PATCH] PY-40431 [i18n] PyInspectionsSuppressor fixes i18n GitOrigin-RevId: 49559b64b5899ffd09a0bad0688c04409e087bc9 --- .../resources/messages/PyPsiBundle.properties | 5 +++++ .../python/inspections/PyInspectionsSuppressor.java | 11 ++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/python/python-psi-impl/resources/messages/PyPsiBundle.properties b/python/python-psi-impl/resources/messages/PyPsiBundle.properties index 7f07197f72c8..b77bcde4eb1f 100644 --- a/python/python-psi-impl/resources/messages/PyPsiBundle.properties +++ b/python/python-psi-impl/resources/messages/PyPsiBundle.properties @@ -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= find.usages.keyword.argument=keyword argument find.usages.variable=variable diff --git a/python/python-psi-impl/src/com/jetbrains/python/inspections/PyInspectionsSuppressor.java b/python/python-psi-impl/src/com/jetbrains/python/inspections/PyInspectionsSuppressor.java index 40ccb8ada427..3aab889f8aa0 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/inspections/PyInspectionsSuppressor.java +++ b/python/python-psi-impl/src/com/jetbrains/python/inspections/PyInspectionsSuppressor.java @@ -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) }; } }