diff --git a/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeRenderer.java b/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeRenderer.java index f6b55da70f19..56500a7d24d8 100644 --- a/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeRenderer.java +++ b/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeRenderer.java @@ -15,10 +15,11 @@ */ package com.intellij.openapi.fileTypes.impl; -import com.intellij.ui.ListCellRendererWrapper; import com.intellij.openapi.fileTypes.FileType; import com.intellij.openapi.fileTypes.FileTypeManager; +import com.intellij.openapi.util.text.StringUtil; import com.intellij.ui.LayeredIcon; +import com.intellij.ui.ListCellRendererWrapper; import com.intellij.util.ui.EmptyIcon; import org.jetbrains.annotations.NotNull; @@ -67,12 +68,14 @@ public class FileTypeRenderer extends ListCellRendererWrapper { setIcon(layeredIcon); - if (isDuplicated(type.getDescription())) { - setText(type.getDescription() + " (" + type.getName() + ")"); + String description = type.getDescription(); + String trimmedDescription = StringUtil.capitalizeWords(description.replaceAll("(?i)\\s*file(?:s)?$", ""), true); + if (isDuplicated(description)) { + setText(trimmedDescription + " (" + type.getName() + ")"); } else { - setText(type.getDescription()); + setText(trimmedDescription); } } diff --git a/python/rest/src/com/jetbrains/rest/RestColorsPage.java b/python/rest/src/com/jetbrains/rest/RestColorsPage.java index 95401d4808ff..b3591e1cc50e 100644 --- a/python/rest/src/com/jetbrains/rest/RestColorsPage.java +++ b/python/rest/src/com/jetbrains/rest/RestColorsPage.java @@ -50,7 +50,7 @@ public class RestColorsPage implements ColorSettingsPage { @NotNull public String getDisplayName() { - return "ReST file"; + return "reStructuredText"; } public Icon getIcon() { diff --git a/python/rest/src/com/jetbrains/rest/RestFileType.java b/python/rest/src/com/jetbrains/rest/RestFileType.java index 67e2cd8aea0b..757be7cdf77a 100644 --- a/python/rest/src/com/jetbrains/rest/RestFileType.java +++ b/python/rest/src/com/jetbrains/rest/RestFileType.java @@ -31,8 +31,6 @@ import javax.swing.*; public class RestFileType extends LanguageFileType { public static final RestFileType INSTANCE = new RestFileType(); @NonNls public static final String DEFAULT_EXTENSION = "rst"; - @NonNls private static final String NAME = "ReST"; - @NonNls private static final String DESCRIPTION = "reStructuredText files"; private RestFileType() { super(RestLanguage.INSTANCE); @@ -40,12 +38,12 @@ public class RestFileType extends LanguageFileType { @NotNull public String getName() { - return NAME; + return "ReST"; } @NotNull public String getDescription() { - return DESCRIPTION; + return "reStructuredText files"; } @NotNull