From ae4940c10040db6e7467b4af5397465c5887ef76 Mon Sep 17 00:00:00 2001 From: Sergey Ignatov Date: Tue, 7 Jan 2020 15:22:13 +0300 Subject: [PATCH] i18n for java structure view remove replacing "Show" with "" GitOrigin-RevId: 6f947c605c177f72434aa668d8c85f25c133351e --- .../impl/java/JavaAnonymousClassesNodeProvider.java | 8 +++++--- .../impl/java/JavaLambdaNodeProvider.java | 11 ++++++----- .../src/com/intellij/ide/util/FileStructurePopup.java | 5 +++-- .../src/messages/IdeBundle.properties | 4 +++- plugins/yaml/resources/messages/YAMLBundle.properties | 2 +- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/java/java-structure-view/src/com/intellij/ide/structureView/impl/java/JavaAnonymousClassesNodeProvider.java b/java/java-structure-view/src/com/intellij/ide/structureView/impl/java/JavaAnonymousClassesNodeProvider.java index 840d88b3b49f..a9eea62b38a1 100644 --- a/java/java-structure-view/src/com/intellij/ide/structureView/impl/java/JavaAnonymousClassesNodeProvider.java +++ b/java/java-structure-view/src/com/intellij/ide/structureView/impl/java/JavaAnonymousClassesNodeProvider.java @@ -1,6 +1,7 @@ // Copyright 2000-2019 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.ide.structureView.impl.java; +import com.intellij.ide.IdeBundle; import com.intellij.ide.structureView.impl.common.PsiTreeElementBase; import com.intellij.ide.util.FileStructureNodeProvider; import com.intellij.ide.util.treeView.smartTree.ActionPresentation; @@ -15,6 +16,7 @@ import com.intellij.openapi.util.SystemInfo; import com.intellij.psi.PsiAnonymousClass; import com.intellij.psi.PsiElement; import com.intellij.util.PlatformIcons; +import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; @@ -27,8 +29,8 @@ import java.util.List; */ public class JavaAnonymousClassesNodeProvider implements FileStructureNodeProvider, PropertyOwner, DumbAware { - public static final String ID = "SHOW_ANONYMOUS"; - public static final String JAVA_ANONYMOUS_PROPERTY_NAME = "java.anonymous.provider"; + @NonNls public static final String ID = "SHOW_ANONYMOUS"; + @NonNls public static final String JAVA_ANONYMOUS_PROPERTY_NAME = "java.anonymous.provider"; @NotNull @Override @@ -54,7 +56,7 @@ public class JavaAnonymousClassesNodeProvider @NotNull @Override public String getCheckBoxText() { - return "Show Anonymous Classes"; + return IdeBundle.message("file.structure.toggle.show.anonymous.classes"); } @NotNull diff --git a/java/java-structure-view/src/com/intellij/ide/structureView/impl/java/JavaLambdaNodeProvider.java b/java/java-structure-view/src/com/intellij/ide/structureView/impl/java/JavaLambdaNodeProvider.java index dd412e37f472..9b4ff1040bae 100644 --- a/java/java-structure-view/src/com/intellij/ide/structureView/impl/java/JavaLambdaNodeProvider.java +++ b/java/java-structure-view/src/com/intellij/ide/structureView/impl/java/JavaLambdaNodeProvider.java @@ -2,6 +2,7 @@ package com.intellij.ide.structureView.impl.java; import com.intellij.icons.AllIcons; +import com.intellij.ide.IdeBundle; import com.intellij.ide.structureView.impl.common.PsiTreeElementBase; import com.intellij.ide.util.FileStructureNodeProvider; import com.intellij.ide.util.treeView.smartTree.ActionPresentation; @@ -16,15 +17,15 @@ import com.intellij.psi.PsiElement; import com.intellij.psi.PsiLambdaExpression; import com.intellij.psi.PsiMember; import com.intellij.psi.SyntaxTraverser; +import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import java.util.Collections; import java.util.List; -public class JavaLambdaNodeProvider - implements FileStructureNodeProvider, PropertyOwner, DumbAware { - public static final String ID = "SHOW_LAMBDA"; - public static final String JAVA_LAMBDA_PROPERTY_NAME = "java.lambda.provider"; +public class JavaLambdaNodeProvider implements FileStructureNodeProvider, PropertyOwner, DumbAware { + @NonNls public static final String ID = "SHOW_LAMBDA"; + @NonNls public static final String JAVA_LAMBDA_PROPERTY_NAME = "java.lambda.provider"; @NotNull @Override @@ -44,7 +45,7 @@ public class JavaLambdaNodeProvider @NotNull @Override public String getCheckBoxText() { - return "Show Lambdas"; + return IdeBundle.message("file.structure.toggle.show.collapse.show.lambdas"); } @NotNull diff --git a/platform/lang-impl/src/com/intellij/ide/util/FileStructurePopup.java b/platform/lang-impl/src/com/intellij/ide/util/FileStructurePopup.java index d137062925df..ed1d1f254f69 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/FileStructurePopup.java +++ b/platform/lang-impl/src/com/intellij/ide/util/FileStructurePopup.java @@ -1,6 +1,7 @@ // Copyright 2000-2019 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.ide.util; +import com.intellij.CommonBundle; import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer; import com.intellij.icons.AllIcons; import com.intellij.ide.*; @@ -292,7 +293,7 @@ public class FileStructurePopup implements Disposable, TreeActionsOwner { myTreeHasBuilt.setRejected(); } }); - myTree.getEmptyText().setText("Loading..."); + myTree.getEmptyText().setText(CommonBundle.getLoadingTreeNodeText()); myPopup.showCenteredInCurrentWindow(myProject); ((AbstractPopup)myPopup).setShowHints(true); @@ -793,7 +794,7 @@ public class FileStructurePopup implements Disposable, TreeActionsOwner { DumbAwareAction.create(e -> checkBox.doClick()) .registerCustomShortcutSet(new CustomShortcutSet(shortcuts), myTree); } - checkBox.setText(StringUtil.capitalize(StringUtil.trimStart(text.trim(), "Show "))); + checkBox.setText(text); panel.add(checkBox); myCheckBoxes.put(action.getClass(), checkBox); diff --git a/platform/platform-resources-en/src/messages/IdeBundle.properties b/platform/platform-resources-en/src/messages/IdeBundle.properties index 7bdb147d9e7e..57bacebff930 100644 --- a/platform/platform-resources-en/src/messages/IdeBundle.properties +++ b/platform/platform-resources-en/src/messages/IdeBundle.properties @@ -1150,7 +1150,9 @@ project.new.wizard.project.identification=project project.new.wizard.module.identification=module hierarchy.scope.test=Test -file.structure.toggle.show.inherited=&Show inherited members +file.structure.toggle.show.inherited=Inherited members +file.structure.toggle.show.anonymous.classes=Anonymous Classes +file.structure.toggle.show.collapse.show.lambdas=Lambdas fail.open.project.message=Unable to open project from ''{0}'' checkbox.show.icons.in.menu.items=Display icons in menu items custom.icon.validation.message=Icon is too big to appear in menu diff --git a/plugins/yaml/resources/messages/YAMLBundle.properties b/plugins/yaml/resources/messages/YAMLBundle.properties index 22a3c88fb3ec..1935835e5504 100644 --- a/plugins/yaml/resources/messages/YAMLBundle.properties +++ b/plugins/yaml/resources/messages/YAMLBundle.properties @@ -65,7 +65,7 @@ YAMLElementDescriptionProvider.type.anchor=Anchor YAMLAnchorRenameProcessor.lost.alias=Alias will refer to another anchor YAMLAnchorRenameProcessor.reuse=Anchor already has the same name -YAMLAliasResolveNodeProvider.action.name=Show aliased sub-trees +YAMLAliasResolveNodeProvider.action.name=Aliased sub-trees YAMLAliasResolveNodeProvider.action.description=Resolve aliases and show referenced values in the structure YAMLKeysSearchEverywhereContributor.group.name=Config keys