[i18n] extract messages related to 'project' concept to a separate bundle
authornik <Nikolay.Chashnikov@jetbrains.com>
Fri, 21 Feb 2020 15:00:33 +0000 (18:00 +0300)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Fri, 21 Feb 2020 17:31:28 +0000 (17:31 +0000)
So implementors of IdeUICustomization::projectMessage may know which keys they need to support. Also usages of IdeUICustomization::getProjectConceptName are replaced by projectMessage calls to avoid problems with localizing messages where 'project' term is inserted in the middle of a sentence.

GitOrigin-RevId: d1f7d5ad7f4075df126d6b6dece337ef4f43b636

31 files changed:
java/idea-ui/resources/messages/JavaUiBundle.properties
java/idea-ui/src/com/intellij/ide/actions/TemplateProjectStructureAction.java
platform/lang-impl/src/com/intellij/ide/actions/SearchEverywhereAction.java
platform/lang-impl/src/com/intellij/ide/actions/searcheverywhere/ClassSearchEverywhereContributor.java
platform/lang-impl/src/com/intellij/ide/actions/searcheverywhere/FileSearchEverywhereContributor.java
platform/lang-impl/src/com/intellij/ide/actions/searcheverywhere/SearchEverywhereUI.java
platform/lang-impl/src/com/intellij/ide/actions/searcheverywhere/SymbolSearchEverywhereContributor.java
platform/lang-impl/src/com/intellij/ide/impl/ProjectViewSelectInGroupTarget.java
platform/lang-impl/src/com/intellij/ide/todo/TodoView.java
platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoClassModel2.java
platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoFileModel.java
platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoSymbolModel2.java
platform/lang-impl/src/com/intellij/psi/search/scope/NonProjectFilesScope.java
platform/platform-api/resources/messages/IdeBundle.properties
platform/platform-api/resources/messages/OptionsBundle.properties
platform/platform-api/resources/messages/ProjectBundle.properties
platform/platform-api/resources/messages/ProjectConceptBundle.properties [new file with mode: 0644]
platform/platform-api/src/com/intellij/openapi/ui/Banner.java
platform/platform-api/src/com/intellij/ui/IdeUICustomization.java
platform/platform-api/src/com/intellij/ui/ProjectConceptBundle.java [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/GeneralSettingsConfigurable.kt
platform/platform-impl/src/com/intellij/ide/actions/CloseProjectAction.java
platform/platform-impl/src/com/intellij/ide/actions/TemplateProjectPropertiesAction.java
platform/platform-impl/src/com/intellij/openapi/options/ex/SingleConfigurableEditor.java
platform/platform-impl/src/com/intellij/openapi/options/newEditor/Banner.java
platform/platform-impl/src/com/intellij/openapi/options/newEditor/SettingsDialog.java
platform/platform-impl/src/com/intellij/openapi/options/newEditor/SettingsTreeView.java
platform/platform-impl/src/com/intellij/openapi/project/impl/ProjectManagerImpl.java
platform/platform-impl/src/com/intellij/platform/PlatformProjectOpenProcessor.kt
platform/platform-impl/src/com/intellij/platform/ProjectFrameAllocator.kt
platform/platform-resources-en/src/messages/ActionsBundle.properties

index 85006cd4560875b52420fd63b679f83119451b57..50a6c0c78a23340a5519ccf22338a4d40822cdc5 100644 (file)
@@ -1,3 +1,5 @@
+action.TemplateProjectStructure.text=Structure for New Projects...
+action.TemplateProjectStructure.description=Configure default structure for all new projects
 build.script.found.notification={0} build {1,choice,1#script|1<scripts} found
 build.script.found.notification.import=Import
 build.script.found.notification.import.all=Import All
index f545c16a3672e58a923eb2bf9f7081c0832c9f8f..996066052f7bed7135dac534e68049276e689e41 100644 (file)
@@ -1,19 +1,17 @@
 // Copyright 2000-2018 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.actions;
 
-import com.intellij.idea.ActionsBundle;
+import com.intellij.ide.JavaUiBundle;
 import com.intellij.openapi.actionSystem.ActionPlaces;
 import com.intellij.openapi.actionSystem.AnActionEvent;
 import com.intellij.openapi.project.ProjectManager;
 import com.intellij.openapi.util.text.StringUtil;
-import com.intellij.ui.IdeUICustomization;
 import org.jetbrains.annotations.NotNull;
 
 public class TemplateProjectStructureAction extends ShowStructureSettingsAction {
   public TemplateProjectStructureAction() {
-    String projectConceptName = StringUtil.capitalize(IdeUICustomization.getInstance().getProjectConceptName());
-    getTemplatePresentation().setText(ActionsBundle.lazyMessage("action.TemplateProjectStructure.text.template", projectConceptName));
-    getTemplatePresentation().setDescription(ActionsBundle.lazyMessage("action.TemplateProjectStructure.description.template", projectConceptName));
+    getTemplatePresentation().setText(JavaUiBundle.lazyMessage("action.TemplateProjectStructure.text"));
+    getTemplatePresentation().setDescription(JavaUiBundle.lazyMessage("action.TemplateProjectStructure.description"));
   }
 
   @Override
index bad7c11954ee238e0092b6dc9c8e2165d66a6d61..5c5fe00ac9a04265e0aff647cd973d40f8513819 100644 (file)
@@ -709,7 +709,7 @@ public class SearchEverywhereAction extends AnAction implements CustomComponentA
                             UIManager.getColor("SearchEverywhere.shortcutForeground") : foregroundColor;
 
       StringBuilder cbText = new StringBuilder("<html>");
-      cbText.append(IdeBundle.message("checkbox.include.non.project.items", IdeUICustomization.getInstance().getProjectConceptName()));
+      cbText.append(IdeUICustomization.getInstance().projectMessage("checkbox.include.non.project.items"));
       cbText.append(" ");
       if (!UIUtil.isUnderWin10LookAndFeel()) cbText.append("<b>");
       cbText.append("<font color=#").append(ColorUtil.toHex(shortcutColor)).append(">").append(getShortcut()).append("</font>");
index cee835fc8e38ac5e1a1b424397dab42aca89f936..e043e6df212a70bef11ac2f4b061a59685c7d476 100644 (file)
@@ -2,7 +2,6 @@
 package com.intellij.ide.actions.searcheverywhere;
 
 import com.intellij.codeInsight.navigation.NavigationUtil;
-import com.intellij.ide.IdeBundle;
 import com.intellij.ide.actions.GotoClassAction;
 import com.intellij.ide.actions.GotoClassPresentationUpdater;
 import com.intellij.ide.util.gotoByName.FilteringGotoByModel;
@@ -59,7 +58,7 @@ public class ClassSearchEverywhereContributor extends AbstractGotoSEContributor
 
   @NotNull
   public String includeNonProjectItemsText() {
-    return IdeBundle.message("checkbox.include.non.project.classes", IdeUICustomization.getInstance().getProjectConceptName());
+    return IdeUICustomization.getInstance().projectMessage("checkbox.include.non.project.items");
   }
 
   @Override
index eb9fd6ab0eff9f8418f007a522aa0740491887d4..58bffc1a78acc3fd6353feb1231447ef3cc6532b 100644 (file)
@@ -48,7 +48,7 @@ public class FileSearchEverywhereContributor extends AbstractGotoSEContributor {
   }
 
   public String includeNonProjectItemsText() {
-    return IdeBundle.message("checkbox.include.non.project.files", IdeUICustomization.getInstance().getProjectConceptName());
+    return IdeUICustomization.getInstance().projectMessage("checkbox.include.non.project.files");
   }
 
   @Override
index 2bc07545cb78613a5fd68abc0f26ffc43595d3f6..395a97d90bc8410de080f564434bd273d2bae2ff 100644 (file)
@@ -461,8 +461,8 @@ public class SearchEverywhereUI extends BigPopupUI implements DataProvider, Quic
         rebuildList();
       };
       if (contributor == null) {
-        actions = Arrays.asList(new CheckBoxSearchEverywhereToggleAction(
-          IdeBundle.message("checkbox.include.non.project.items", IdeUICustomization.getInstance().getProjectConceptName())) {
+        String actionText = IdeUICustomization.getInstance().projectMessage("checkbox.include.non.project.items");
+        actions = Arrays.asList(new CheckBoxSearchEverywhereToggleAction(actionText) {
           final SearchEverywhereManagerImpl seManager = (SearchEverywhereManagerImpl)SearchEverywhereManager.getInstance(myProject);
           @Override
           public boolean isEverywhere() {
index cff57e9cc78eb2bc5d3595a457f8b4b22515693d..603be197ff541fc337a34ece1a5ebe94274c3b7b 100644 (file)
@@ -34,7 +34,7 @@ public class SymbolSearchEverywhereContributor extends AbstractGotoSEContributor
 
   @NotNull
   public String includeNonProjectItemsText() {
-    return IdeBundle.message("checkbox.include.non.project.symbols", IdeUICustomization.getInstance().getProjectConceptName());
+    return IdeUICustomization.getInstance().projectMessage("checkbox.include.non.project.symbols");
   }
 
   @Override
index a3738e45dfacb845d9e00d0b906ed3cd159edd76..447acd7564b5b938b9ee70332666e313581f0807 100644 (file)
@@ -65,6 +65,6 @@ public class ProjectViewSelectInGroupTarget implements CompositeSelectInTarget,
 
   @Override
   public String toString() {
-    return IdeUICustomization.getInstance().getProjectViewSelectInTitle();
+    return IdeUICustomization.getInstance().projectMessage("select.in.item.project.view");
   }
 }
index 5c273cfe9a5e7042c124588558343a7ba38ae1ea..adea1ae4678026c9f3280444bcabdb468ed4aa61 100644 (file)
@@ -143,7 +143,7 @@ public class TodoView implements PersistentStateComponent<TodoView.State>, Dispo
   public void initToolWindow(@NotNull ToolWindow toolWindow) {
     // Create panels
     ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
-    Content allTodosContent = contentFactory.createContent(null, IdeUICustomization.getInstance().getProjectDisplayName(), false);
+    Content allTodosContent = contentFactory.createContent(null, IdeUICustomization.getInstance().projectMessage("tab.title.project"), false);
     toolWindow.setHelpId("find.todoList");
     myAllTodos = new TodoPanel(myProject, state.all, false, allTodosContent) {
       @Override
index c704578a9adc367a473663e46e527df3be5c0397..1f84c63587dea256b74fb1021cd3f5769d8e6f1b 100644 (file)
@@ -60,13 +60,13 @@ public class GotoClassModel2 extends FilteringGotoByModel<Language> {
 
   @Override
   public String getCheckBoxName() {
-    return IdeBundle.message("checkbox.include.non.project.classes", IdeUICustomization.getInstance().getProjectConceptName());
+    return IdeUICustomization.getInstance().projectMessage("checkbox.include.non.project.items");
   }
 
   @NotNull
   @Override
   public String getNotInMessage() {
-    return IdeBundle.message("label.no.matches.found.in.project", IdeUICustomization.getInstance().getProjectConceptName());
+    return IdeUICustomization.getInstance().projectMessage("label.no.matches.found.in.project");
   }
 
   @NotNull
index ae8b36d2dae4457badf733d4aa50ab672eba62d9..dc1cc6690f4d3520d5e33d0ac8b4f73aa2036fe1 100644 (file)
@@ -91,10 +91,9 @@ public class GotoFileModel extends FilteringGotoByModel<FileType> implements Dum
     if (NonProjectScopeDisablerEP.isSearchInNonProjectDisabled()) {
       return null;
     }
-    return IdeBundle.message("checkbox.include.non.project.files", IdeUICustomization.getInstance().getProjectConceptName());
+    return IdeUICustomization.getInstance().projectMessage("checkbox.include.non.project.files");
   }
 
-
   @NotNull
   @Override
   public String getNotInMessage() {
index 61a2ab0296dc0ab793eeb7909e6a0d826779a545..fb1f6fbfbe01aa24738264ea60ea4d4eec125479 100644 (file)
@@ -72,13 +72,13 @@ public class GotoSymbolModel2 extends FilteringGotoByModel<Language> {
 
   @Override
   public String getCheckBoxName() {
-    return IdeBundle.message("checkbox.include.non.project.symbols", IdeUICustomization.getInstance().getProjectConceptName());
+    return IdeUICustomization.getInstance().projectMessage("checkbox.include.non.project.symbols");
   }
 
   @NotNull
   @Override
   public String getNotInMessage() {
-    return IdeBundle.message("label.no.matches.found.in.project", IdeUICustomization.getInstance().getProjectConceptName());
+    return IdeUICustomization.getInstance().projectMessage("label.no.matches.found.in.project");
   }
 
   @NotNull
index 520af0eee316093d05d9ef6d9415aaf8122dd865..3d3599c8354f4c2a15bdf981e9d02382f453915d 100644 (file)
@@ -15,7 +15,7 @@ import org.jetbrains.annotations.NotNull;
  * @author Konstantin Bulenkov
  */
 public final class NonProjectFilesScope extends NamedScope {
-  public static final String NAME = IdeUICustomization.getInstance().getNonProjectFilesScopeTitle();
+  public static final String NAME = IdeUICustomization.getInstance().projectMessage("scope.name.non.project.files");
   public static final NonProjectFilesScope INSTANCE = new NonProjectFilesScope();
 
   private NonProjectFilesScope() {
index a7916c7f308197d37eea59993a95d989476fda65..ed8215928e4fcd2247a78eda261e0ca80b4abf59 100644 (file)
@@ -58,7 +58,6 @@ search.in.the.background=Search in the background
 checkbox.save.files.automatically=Save files automatically if application is idle for
 checkbox.save.files.on.frame.deactivation=Save files on frame deactivation
 checkbox.synchronize.files.on.frame.activation=Synchronize files on frame or editor tab activation
-checkbox.reopen.last.project.on.startup=Reopen last {0} on startup
 title.accessibility=Accessibility
 checkbox.support.screen.readers=Support screen readers (requires restart)
 checkbox.acessibility.contrast.scrollbars=Use contrast scrollbars
@@ -274,14 +273,8 @@ title.open.file.or.project=Open File or Project
 button.cancel=&Cancel
 error.cannot.load.project=Cannot load project: {0}
 title.cannot.load.project=Cannot Load Project
-action.close.project=Close Pro_ject
 action.close.projects.in.current.window=Close Pro_jects in Current Window
 
-border.title.project.opening={0} Opening
-radio.button.open.project.in.the.same.window=Open {0} in the same window
-radio.button.confirm.window.to.open.project.in=Confirm window to open {0} in
-radio.button.open.project.in.the.new.window=Open {0} in new window
-
 title.cannot.convert.project=Cannot Convert Project
 dialog.title.convert.project=Convert Project
 conversion.dialog.text.1=The project ''{0}'' has an older format and will be converted. You may not be able to open the project with earlier versions of {1}.
@@ -699,7 +692,6 @@ title.customizations=Menus and Toolbars
 label.choosebyname.no.matches.found=No matches found
 label.choosebyname.searching=Searching...
 prompt.gotoclass.enter.class.name=Enter {0} name:
-checkbox.include.non.project.classes=Include &non-&&{0} items
 label.no.matches.found.in.project=No matches found in {0}
 label.no.matches.found=no matches found
 prompt.gotofile.enter.file.name=Enter file name:
@@ -710,8 +702,6 @@ label.no.enabled.actions.found=No enabled actions found
 label.no.files.found=No files found
 label.no.actions.found=No actions found
 prompt.gotosymbol.enter.symbol.name=Enter symbol name:
-checkbox.include.non.project.symbols=Include &non-&&{0} symbols
-checkbox.include.non.project.items=Include &non-&&{0} items
 error.failed.to.create.directory=Failed to create directory \"{0}\"
 label.select.compiler.output.path=Select c&ompiler output path:
 title.select.compiler.output.path=Select compiler output path
index 761305fa649aee68bebba840395a46de4a1b977f..30113ddc1ba78d4a5b47e15f37bfd83bbabb3391 100644 (file)
@@ -253,7 +253,6 @@ stylesheet.code.style.group.settings.description=Configure the code style used i
 # suppress inspection "UnusedProperty" - for generating list of inner configurables, see ConfigurableEditor#createDefaultContent
 sql.code.style.group.settings.description=Configure the code style used in SQL dialects.
 
-configurable.default.project.tooltip=For new {0}s
 configurable.current.project.tooltip=For current {0}
 
 control.panel.classic.view.button=Classic &View
@@ -355,8 +354,6 @@ exportable.JavaCodeFoldingSettings.presentable.name=Code Folding Settings
 exportable.PostfixTemplatesSettings.presentable.name=Postfix Completion
 exportable.UpdatesConfigurable.presentable.name=Updates
 
-title.for.new.projects={0} for New {1}s
-
 #
 # Descriptions of common code style properties.
 # Properties have no direct links in code, property names are generated programmatically
index 3975da8a024b6c5993253a05ce1cd695f321ebc3..d2d9586b31cb31fcaaecc1664a9e07ea60536342 100644 (file)
@@ -12,13 +12,8 @@ project.load.undefined.path.variables.message=There are undefined path variables
 project.load.undefined.path.variables.all.needed=All path variables should be defined
 project.load.undefined.path.variables.title=Path Variables Not Defined
 project.load.default.error=Error Loading Default Project
-project.load.progress=Loading Project
-project.loading.name=Loading {0} Project
-project.unsaved=Unsaved Project
-project.cannot.save=Could not save project
 project.loading.components=Loading components...
 project.preparing.workspace=Preparing workspace...
-project.checking.configuration=Checking project configuration...
 project.load.waiting.watcher=Scanning project directories...
 project.reload.write.failed=Error writing to file ''{0}''. Project may reload incorrectly.
 project.reload.write.failed.title=Write Error
diff --git a/platform/platform-api/resources/messages/ProjectConceptBundle.properties b/platform/platform-api/resources/messages/ProjectConceptBundle.properties
new file mode 100644 (file)
index 0000000..9bfadc4
--- /dev/null
@@ -0,0 +1,32 @@
+# This message bundle contains strings which somehow mention 'project' concept. Other IDEs may use a different term for that (e.g. Rider
+#  uses 'solution'), so they change these messages accordingly.
+tab.title.project=Project
+action.close.project.text=Close Pro_ject
+select.in.item.project.view=Project View
+scope.name.non.project.files=Non-Project Files
+toolwindow.title.project.view=Project
+
+progress.text.project.checking.configuration=Checking project configuration...
+progress.title.project.loading.name=Loading {0} Project
+progress.title.loading.project=Loading Project
+dialog.title.unsaved.project=Unsaved Project
+notification.title.cannot.save.project=Could not save project
+
+configurable.default.project.tooltip=For new projects
+configurable.current.project.tooltip=For current project
+title.for.new.projects={0} for New Projects
+action.TemplateProjectProperties.text.template={0} for New Projects...
+action.TemplateProjectProperties.description.template=Configure default settings for all new projects
+
+#these 3 strings are used only in the old implementation of Go To Class/File/Symbol popups which is now available via Registry key only
+checkbox.include.non.project.items=Include &non-project items
+checkbox.include.non.project.files=Include &non-project files
+checkbox.include.non.project.symbols=Include &non-project symbols
+
+label.no.matches.found.in.project=No matches found in project
+
+checkbox.reopen.last.project.on.startup=Reopen last project on startup
+border.title.project.opening=Project Opening
+radio.button.open.project.in.the.same.window=Open project in the same window
+radio.button.confirm.window.to.open.project.in=Confirm window to open project in
+radio.button.open.project.in.the.new.window=Open project in new window
index 597237162b5e25fba35e17f73e9c9f3307392ccc..cea1f49644cc1c6d15a36c1181c0dac280ef66df 100644 (file)
@@ -2,7 +2,6 @@
 package com.intellij.openapi.ui;
 
 import com.intellij.icons.AllIcons;
-import com.intellij.openapi.options.OptionsBundle;
 import com.intellij.openapi.project.Project;
 import com.intellij.ui.IdeUICustomization;
 import com.intellij.ui.RelativeFont;
@@ -109,10 +108,9 @@ class Banner extends NonOpaquePanel implements PropertyChangeListener{
   public void forProject(Project project) {
     if (project != null) {
       myProjectIcon.setVisible(true);
-      String projectConceptName = IdeUICustomization.getInstance().getProjectConceptName();
       myProjectIcon.setText(project.isDefault()
-                            ? OptionsBundle.message("configurable.default.project.tooltip", projectConceptName)
-                            : OptionsBundle.message("configurable.current.project.tooltip", projectConceptName));
+                            ? IdeUICustomization.getInstance().projectMessage("configurable.default.project.tooltip")
+                            : IdeUICustomization.getInstance().projectMessage("configurable.current.project.tooltip"));
     } else {
       myProjectIcon.setVisible(false);
     }
index db537c5c2e998cf2469d3e57914f2940402d7874..4c969f0b53a05efc09d1e6c99915714d04060349 100644 (file)
@@ -3,8 +3,6 @@ package com.intellij.ui;
 
 import com.intellij.ide.IdeBundle;
 import com.intellij.openapi.components.ServiceManager;
-import com.intellij.openapi.project.ProjectBundle;
-import com.intellij.openapi.util.text.StringUtil;
 import org.jetbrains.annotations.Nls;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
@@ -19,33 +17,39 @@ public class IdeUICustomization {
   }
 
   /**
-   * Returns the name to be displayed in the UI for the "project" concept (Rider changes this to "solution").
+   * @deprecated it's hard to properly localize 'project' term in the middle of a sentence; if you need to use a 'project' term,
+   * put the whole message to ProjectConceptBundle.properties and refer to it via {@link #projectMessage} instead
    */
-  @Nls(capitalization = Nls.Capitalization.Title)
+  @Deprecated
   @NotNull
   public String getProjectConceptName() {
     return "project";
   }
 
+  /**
+   * Returns a message which mentions 'project' concept. 
+   */
   @NotNull
-  public String projectMessage(@NotNull @PropertyKey(resourceBundle = ProjectBundle.BUNDLE) String key, Object @NotNull ... params) {
-    return ProjectBundle.message(key, params);
+  public String projectMessage(@NotNull @PropertyKey(resourceBundle = ProjectConceptBundle.BUNDLE) String key, Object @NotNull ... params) {
+    return ProjectConceptBundle.message(key, params);
   }
 
   /**
-   * Returns the name to be displayed in the UI for the "Project" concept (Rider changes this to "Solution").
+   * @deprecated use {@code projectMessage("tab.title.project")} instead
    */
+  @Deprecated
   @Nls(capitalization = Nls.Capitalization.Title)
   public String getProjectDisplayName() {
-    return StringUtil.capitalize(getProjectConceptName());
+    return projectMessage("tab.title.project");
   }
 
   /**
-   * Returns the name of the "Close Project" action (with mnemonic if needed).
+   * @deprecated use {@code projectMessage("action.close.project.text")} instead
    */
+  @Deprecated
   @Nls
   public String getCloseProjectActionText() {
-    return IdeBundle.message("action.close.project");
+    return projectMessage("action.close.project.text");
   }
 
   /**
@@ -53,20 +57,23 @@ public class IdeUICustomization {
    */
   @Nls
   public String getProjectViewTitle() {
-    return StringUtil.capitalize(getProjectConceptName());
+    return projectMessage("toolwindow.title.project.view");
   }
 
   /**
-   * Returns the title of the Project view Select In target.
+   * @deprecated use {@code projectMessage("select.in.item.project.view")} instead
    */
+  @Deprecated
   public String getProjectViewSelectInTitle() {
-    return getProjectViewTitle() + " View";
+    return projectMessage("select.in.item.project.view");
   }
+
   /**
-   * Returns the title of the "Non-Project Files" scope.
+   * @deprecated use {@code projectMessage("scope.name.non.project.files")} instead
    */
+  @Deprecated
   public String getNonProjectFilesScopeTitle() {
-    return "Non-" + StringUtil.capitalize(getProjectConceptName()) + " Files";
+    return projectMessage("scope.name.non.project.files");
   }
 
   public String getSelectAutopopupByCharsText() {
diff --git a/platform/platform-api/src/com/intellij/ui/ProjectConceptBundle.java b/platform/platform-api/src/com/intellij/ui/ProjectConceptBundle.java
new file mode 100644 (file)
index 0000000..2f39708
--- /dev/null
@@ -0,0 +1,25 @@
+// Copyright 2000-2020 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.ui;
+
+import com.intellij.DynamicBundle;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.PropertyKey;
+
+/**
+ * This message bundle contains strings which somehow mention 'project' concept. Other IDEs may use a different term for that (e.g. Rider
+ * use 'solution'). Don't use this class directly, use {@link IdeUICustomization#projectMessage} instead.
+ */
+class ProjectConceptBundle extends DynamicBundle {
+  @NonNls public static final String BUNDLE = "messages.ProjectConceptBundle";
+  private static final ProjectConceptBundle INSTANCE = new ProjectConceptBundle();
+
+  private ProjectConceptBundle() {
+    super(BUNDLE);
+  }
+
+  @NotNull
+  static String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, Object @NotNull ... params) {
+    return INSTANCE.getMessage(key, params);
+  }
+}
index fdb2524849ff7807da802833eccaf628e16a4cb6..aaf2b65c093ac39c5e9d6abf1695d7c82db05a03 100644 (file)
@@ -17,7 +17,7 @@ import com.intellij.util.PlatformUtils
 
 // @formatter:off
 private val model = GeneralSettings.getInstance()
-private val myChkReopenLastProject                get() = CheckboxDescriptor(IdeBundle.message("checkbox.reopen.last.project.on.startup", IdeUICustomization.getInstance().projectConceptName), PropertyBinding(model::isReopenLastProject, model::setReopenLastProject))
+private val myChkReopenLastProject                get() = CheckboxDescriptor(IdeUICustomization.getInstance().projectMessage("checkbox.reopen.last.project.on.startup"), PropertyBinding(model::isReopenLastProject, model::setReopenLastProject))
 private val myConfirmExit                         get() = CheckboxDescriptor(IdeBundle.message("checkbox.confirm.application.exit"), PropertyBinding(model::isConfirmExit, model::setConfirmExit))
 private val myShowWelcomeScreen                   get() = CheckboxDescriptor(IdeBundle.message("checkbox.show.welcome.screen"), PropertyBinding(model::isShowWelcomeScreen, model::setShowWelcomeScreen))
 private val myChkSyncOnFrameActivation            get() = CheckboxDescriptor(IdeBundle.message("checkbox.synchronize.files.on.frame.activation"), PropertyBinding(model::isSyncOnFrameActivation, model::setSyncOnFrameActivation))
@@ -51,8 +51,6 @@ class GeneralSettingsConfigurable: BoundCompositeSearchableConfigurable<Searchab
   private val model = GeneralSettings.getInstance()
 
   override fun createPanel(): DialogPanel {
-    val projectConceptName = IdeUICustomization.getInstance().projectConceptName
-
     return panel {
       titledRow("Startup/Shutdown") {
         row {
@@ -68,7 +66,7 @@ class GeneralSettingsConfigurable: BoundCompositeSearchableConfigurable<Searchab
           }
         }
       }
-      titledRow(IdeBundle.message("border.title.project.opening", projectConceptName.capitalize())) {
+      titledRow(IdeUICustomization.getInstance().projectMessage("border.title.project.opening")) {
         row(IdeBundle.message("settings.general.default.directory")) {
           textFieldWithBrowseButton(model::getDefaultProjectDirectory, model::setDefaultProjectDirectory,
                                     fileChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor()
@@ -78,13 +76,13 @@ class GeneralSettingsConfigurable: BoundCompositeSearchableConfigurable<Searchab
         }
         buttonGroup(model::getConfirmOpenNewProject, model::setConfirmOpenNewProject) {
           row {
-            radioButton(IdeBundle.message("radio.button.open.project.in.the.new.window", projectConceptName), GeneralSettings.OPEN_PROJECT_NEW_WINDOW)
+            radioButton(IdeUICustomization.getInstance().projectMessage("radio.button.open.project.in.the.new.window"), GeneralSettings.OPEN_PROJECT_NEW_WINDOW)
           }
           row {
-            radioButton(IdeBundle.message("radio.button.open.project.in.the.same.window", projectConceptName), GeneralSettings.OPEN_PROJECT_SAME_WINDOW)
+            radioButton(IdeUICustomization.getInstance().projectMessage("radio.button.open.project.in.the.same.window"), GeneralSettings.OPEN_PROJECT_SAME_WINDOW)
           }
           row {
-            radioButton(IdeBundle.message("radio.button.confirm.window.to.open.project.in", projectConceptName), GeneralSettings.OPEN_PROJECT_ASK)
+            radioButton(IdeUICustomization.getInstance().projectMessage("radio.button.confirm.window.to.open.project.in"), GeneralSettings.OPEN_PROJECT_ASK)
           }
         }
       }
index 2391c2816b98586500ac577852796851b1ab253e..91181230834283f3917a2be3b799a2dc15bd5d3c 100644 (file)
@@ -19,7 +19,7 @@ import org.jetbrains.annotations.NotNull;
 
 public final class CloseProjectAction extends AnAction implements DumbAware {
   public CloseProjectAction() {
-    getTemplatePresentation().setText(IdeUICustomization.getInstance().getCloseProjectActionText());
+    getTemplatePresentation().setText(IdeUICustomization.getInstance().projectMessage("action.close.project.text"));
   }
 
   @Override
@@ -46,7 +46,7 @@ public final class CloseProjectAction extends AnAction implements DumbAware {
       presentation.setText(IdeBundle.lazyMessage("action.close.projects.in.current.window"));
     }
     else {
-      presentation.setText(IdeUICustomization.getInstance().getCloseProjectActionText());
+      presentation.setText(IdeUICustomization.getInstance().projectMessage("action.close.project.text"));
     }
   }
 }
index cb09f240ca37245df1bf9b591eba501fda408f66..d9f6b5e3b16225287524102ed5a6a41968c754d5 100644 (file)
@@ -2,22 +2,19 @@
 package com.intellij.ide.actions;
 
 import com.intellij.CommonBundle;
-import com.intellij.idea.ActionsBundle;
 import com.intellij.openapi.actionSystem.AnAction;
 import com.intellij.openapi.actionSystem.AnActionEvent;
 import com.intellij.openapi.options.ShowSettingsUtil;
 import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.project.ex.ProjectManagerEx;
-import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.ui.IdeUICustomization;
 import org.jetbrains.annotations.NotNull;
 
 public class TemplateProjectPropertiesAction extends AnAction implements DumbAware {
   public TemplateProjectPropertiesAction() {
-    String projectConceptName = StringUtil.capitalize(IdeUICustomization.getInstance().getProjectConceptName());
-    getTemplatePresentation().setText(ActionsBundle.lazyMessage("action.TemplateProjectProperties.text.template", CommonBundle.settingsTitle(), projectConceptName));
-    getTemplatePresentation().setDescription(ActionsBundle.lazyMessage("action.TemplateProjectProperties.description.template", projectConceptName));
+    getTemplatePresentation().setText(() -> IdeUICustomization.getInstance().projectMessage("action.TemplateProjectProperties.text.template", CommonBundle.settingsTitle()));
+    getTemplatePresentation().setDescription(() -> IdeUICustomization.getInstance().projectMessage("action.TemplateProjectProperties.description.template"));
   }
 
   @Override
index a3c873945e152f0b683562e6201df9e25c0c03a4..df53aecbc9da16557b07c6fa7b43a2e8962919c9 100644 (file)
@@ -8,12 +8,10 @@ import com.intellij.openapi.application.ModalityState;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.options.Configurable;
 import com.intellij.openapi.options.ConfigurationException;
-import com.intellij.openapi.options.OptionsBundle;
 import com.intellij.openapi.project.IndexNotReadyException;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.ui.DialogWrapper;
 import com.intellij.openapi.ui.Messages;
-import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.openapi.wm.ex.IdeFocusTraversalPolicy;
 import com.intellij.ui.IdeUICustomization;
 import com.intellij.util.Alarm;
@@ -46,8 +44,7 @@ public class SingleConfigurableEditor extends DialogWrapper {
     myShowApplyButton = showApplyButton;
     String title = createTitleString(configurable);
     if (project != null && project.isDefault()) {
-      title = OptionsBundle.message("title.for.new.projects",
-                                    title, StringUtil.capitalize(IdeUICustomization.getInstance().getProjectConceptName()));
+      title = IdeUICustomization.getInstance().projectMessage("title.for.new.projects", title);
     }
 
     setTitle(title);
index 86cdaca386d071c0998f2ff6405ded365fe36320..0055ed390e6bf63bf34a752836881375c8db5c8c 100644 (file)
@@ -2,7 +2,6 @@
 package com.intellij.openapi.options.newEditor;
 
 import com.intellij.icons.AllIcons;
-import com.intellij.openapi.options.OptionsBundle;
 import com.intellij.openapi.project.Project;
 import com.intellij.ui.IdeUICustomization;
 import com.intellij.ui.RelativeFont;
@@ -54,10 +53,9 @@ final class Banner extends SimpleBanner {
     }
     else {
       myProjectIcon.setVisible(true);
-      String projectConceptName = IdeUICustomization.getInstance().getProjectConceptName();
       myProjectIcon.setText(project.isDefault()
-                            ? OptionsBundle.message("configurable.default.project.tooltip", projectConceptName)
-                            : OptionsBundle.message("configurable.current.project.tooltip", projectConceptName));
+                            ? IdeUICustomization.getInstance().projectMessage("configurable.default.project.tooltip")
+                            : IdeUICustomization.getInstance().projectMessage("configurable.current.project.tooltip"));
     }
   }
 
index 5989f07e2620fd34dc4ddd2bf3985bc550b42807..92e2a2988f1c9803b9213a00e5d5a2194f9c5d07 100644 (file)
@@ -11,11 +11,9 @@ import com.intellij.openapi.actionSystem.DataProvider;
 import com.intellij.openapi.actionSystem.ShortcutSet;
 import com.intellij.openapi.options.Configurable;
 import com.intellij.openapi.options.ConfigurableGroup;
-import com.intellij.openapi.options.OptionsBundle;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.ui.DialogWrapper;
 import com.intellij.openapi.util.registry.Registry;
-import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.ui.IdeUICustomization;
 import com.intellij.ui.SearchTextField.FindAction;
 import com.intellij.util.ui.JBDimension;
@@ -84,8 +82,7 @@ public class SettingsDialog extends DialogWrapper implements DataProvider {
     String name = configurable == null ? null : configurable.getDisplayName();
     String title = CommonBundle.settingsTitle();
     if (project != null && project.isDefault()) {
-      title = OptionsBundle.message("title.for.new.projects",
-                                    title, StringUtil.capitalize(IdeUICustomization.getInstance().getProjectConceptName()));
+      title = IdeUICustomization.getInstance().projectMessage("title.for.new.projects", title);
     }
     setTitle(name == null ? title : name.replace('\n', ' '));
 
index e37ab6f649e36312a934bf39a28344e35323110d..c72ea27d5e5722f783330b08e06768eca0c6b7fd 100644 (file)
@@ -732,10 +732,9 @@ public class SettingsTreeView extends JComponent implements Accessible, Disposab
   protected void setProjectIcon(JLabel projectIcon, Configurable configurable, @Nullable Project project, boolean selected) {
     if (project != null) {
       projectIcon.setIcon(AllIcons.General.ProjectConfigurable);
-      String projectConceptName = IdeUICustomization.getInstance().getProjectConceptName();
       projectIcon.setToolTipText(project.isDefault()
-                                 ? OptionsBundle.message("configurable.default.project.tooltip", projectConceptName)
-                                 : OptionsBundle.message("configurable.current.project.tooltip", projectConceptName));
+                                 ? IdeUICustomization.getInstance().projectMessage("configurable.default.project.tooltip")
+                                 : IdeUICustomization.getInstance().projectMessage("configurable.current.project.tooltip"));
       projectIcon.setVisible(true);
     }
     else {
index aed247271f0308abf73a8f36004bef3317504ada..79cddd8957bc3c6831e971741b060db5f97e9c8b 100644 (file)
@@ -522,7 +522,7 @@ public class ProjectManagerImpl extends ProjectManagerEx implements Disposable {
     else {
       project = doCreateProject(null, file);
       ConversionResult finalConversionResult = conversionResult;
-      ProgressManager.getInstance().run(new Task.Modal(project, IdeUICustomization.getInstance().projectMessage("project.load.progress"), true) {
+      ProgressManager.getInstance().run(new Task.Modal(project, IdeUICustomization.getInstance().projectMessage("progress.title.loading.project"), true) {
         @Override
         public void run(@NotNull ProgressIndicator indicator) {
           try {
@@ -904,7 +904,7 @@ public class ProjectManagerImpl extends ProjectManagerEx implements Disposable {
         count++;
       }
     }
-    return Messages.showYesNoDialog(project, message.toString(), IdeUICustomization.getInstance().projectMessage("project.unsaved"), Messages.getWarningIcon()) == Messages.YES;
+    return Messages.showYesNoDialog(project, message.toString(), IdeUICustomization.getInstance().projectMessage("dialog.title.unsaved.project"), Messages.getWarningIcon()) == Messages.YES;
   }
 
   public static class UnableToSaveProjectNotification extends Notification {
@@ -917,7 +917,7 @@ public class ProjectManagerImpl extends ProjectManagerEx implements Disposable {
     }
 
     public UnableToSaveProjectNotification(@NotNull Project project, @NotNull List<VirtualFile> readOnlyFiles) {
-      super("Project Settings", IdeUICustomization.getInstance().projectMessage("project.cannot.save"),
+      super("Project Settings", IdeUICustomization.getInstance().projectMessage("notification.title.cannot.save.project"),
             "Unable to save project files. Please ensure project files are writable and you have permissions to modify them." +
             " <a href=\"\">Try to save project again</a>.", NotificationType.ERROR,
             (notification, event) -> {
index ccbdd5bedaa7a5504d6340ecb5991d092fa3aaaf..b7641a7363764c309e8a78137049a9f1d9907e73 100644 (file)
@@ -304,7 +304,7 @@ private fun prepareProject(file: Path, options: OpenProjectTask, baseDir: Path):
   }
   else {
     val indicator = ProgressManager.getInstance().progressIndicator
-    indicator?.text = IdeUICustomization.getInstance().projectMessage("project.checking.configuration")
+    indicator?.text = IdeUICustomization.getInstance().projectMessage("progress.text.project.checking.configuration")
     project = convertAndLoadProject(baseDir, options)
     indicator?.text = ""
   }
index d03f64023236eb15676ea3fe0280c285e659da6a..4fd33eb84079508c3cb913c4a49fe0588f26aa57 100644 (file)
@@ -64,7 +64,7 @@ internal class ProjectUiFrameAllocator(private var options: OpenProjectTask, pri
 
   override fun run(task: () -> Unit): Boolean {
     var completed = false
-    val progressTitle = IdeUICustomization.getInstance().projectMessage("project.loading.name", options.projectName ?: projectFile.fileName)
+    val progressTitle = IdeUICustomization.getInstance().projectMessage("progress.title.project.loading.name", options.projectName ?: projectFile.fileName)
     ApplicationManager.getApplication().invokeAndWait {
       val frame = createFrameIfNeeded()
       val progressTask = createModalTask(progressTitle) {
index 4c56b288678fa78c2f4cb8cdc413a77708ea4723..9f2bf39cf19205843fffb12458b0c7bbddb455ad 100644 (file)
@@ -336,10 +336,6 @@ action.CloseProject.text=Close Pro_ject
 action.CloseProject.description=Close current project
 action.ShowProjectStructureSettings.text=Project Structure...
 action.ShowProjectStructureSettings.description=Configure project structure
-action.TemplateProjectProperties.text.template={0} for New {1}s...
-action.TemplateProjectProperties.description.template=Configure default settings for all new {0}s
-action.TemplateProjectStructure.text.template=Structure for New {0}s...
-action.TemplateProjectStructure.description.template=Configure default structure for all new {0}s
 action.SaveAll.text=_Save All
 action.SaveAll.description=Save all files and settings
 action.ExportSettings.text=_Export Settings...