From 3bb8ec2c9946cc08361c413a6da112dda1cb2cdf Mon Sep 17 00:00:00 2001 From: Tagir Valeev Date: Fri, 7 Aug 2020 12:35:09 +0700 Subject: [PATCH] ProjectLayout i18n GitOrigin-RevId: 38088c8bf0d0d4d99728703ff633612846ce175d --- .../resources/messages/JavaUiBundle.properties | 16 +++++++++++++++- .../util/importProject/LibrariesLayoutPanel.java | 13 +++++++------ .../ide/util/importProject/ModuleDescriptor.java | 3 ++- .../ide/util/importProject/ModuleInsight.java | 9 +++++---- .../util/importProject/ModulesLayoutPanel.java | 13 ++++++------- .../util/importProject/ProjectLayoutPanel.java | 11 ++++++----- 6 files changed, 41 insertions(+), 24 deletions(-) diff --git a/java/idea-ui/resources/messages/JavaUiBundle.properties b/java/idea-ui/resources/messages/JavaUiBundle.properties index 61a4382789d6..7b40f284a0bb 100644 --- a/java/idea-ui/resources/messages/JavaUiBundle.properties +++ b/java/idea-ui/resources/messages/JavaUiBundle.properties @@ -486,4 +486,18 @@ jar.repository.manager.version.resolve.progress.text=Loading {0} versions repository.library.properties.include.transitive.dependencies=Include &transitive dependencies library.options.panel.existing.library.combobox.label.unnamed= attach.source.provider.download.sources.action.name=Download Sources -attach.source.provider.download.sources.action.busy.text=Download sources... \ No newline at end of file +attach.source.provider.download.sources.action.busy.text=Download sources... +progress.details.building.library.dependencies.for.module=Building library dependencies for module {0} +progress.details.building.module.dependencies.for.module=Building module dependencies for module {0} +progress.text.scanning.for.libraries=Scanning for libraries {0} +progress.text.building.initial.libraries.layout=Building initial libraries layout... +error.library.with.name.already.exists=Library with name {0} already exists +error.module.with.name.already.exists=Module with name {0} already exists +libraries.layout.step.description=Please review libraries found. At this stage you can set library names that will be used in the project,\nexclude particular libraries from the project, or move individual files between the libraries. +module.structure.step.description=Please review suggested module structure for the project. At this stage you can set module names,\nexclude particular modules from the project, merge or split individual modules.\nAll dependencies between the modules as well as dependencies on the libraries will be automatically updated. +label.select.jars.to.extract.to.new.library=&Select jars to extract to the new library: +label.select.content.roots.to.extract.to.new.module=&Select content roots to extract to the new module: +title.module.dependencies=Module dependencies +title.modules=Modules +title.library.contents=Library contents +title.libraries=Libraries \ No newline at end of file diff --git a/java/idea-ui/src/com/intellij/ide/util/importProject/LibrariesLayoutPanel.java b/java/idea-ui/src/com/intellij/ide/util/importProject/LibrariesLayoutPanel.java index bd94010b7697..e96f463040e8 100644 --- a/java/idea-ui/src/com/intellij/ide/util/importProject/LibrariesLayoutPanel.java +++ b/java/idea-ui/src/com/intellij/ide/util/importProject/LibrariesLayoutPanel.java @@ -1,6 +1,8 @@ // 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.util.importProject; +import com.intellij.ide.JavaUiBundle; + import java.io.File; import java.util.Collection; import java.util.Collections; @@ -64,12 +66,12 @@ public class LibrariesLayoutPanel extends ProjectLayoutPanel{ @Override protected String getEntriesChooserTitle() { - return "Libraries"; + return JavaUiBundle.message("title.libraries"); } @Override protected String getDependenciesTitle() { - return "Library contents"; + return JavaUiBundle.message("title.library.contents"); } @Override @@ -79,17 +81,16 @@ public class LibrariesLayoutPanel extends ProjectLayoutPanel{ @Override protected String getSplitDialogChooseFilesPrompt() { - return "&Select jars to extract to the new library:"; + return JavaUiBundle.message("label.select.jars.to.extract.to.new.library"); } @Override protected String getNameAlreadyUsedMessage(final String name) { - return "library with name " + name + " already exists"; + return JavaUiBundle.message("error.library.with.name.already.exists", name); } @Override protected String getStepDescriptionText() { - return "Please review libraries found. At this stage you can set library names that will be used in the project,\n" + - "exclude particular libraries from the project, or move individual files between the libraries."; + return JavaUiBundle.message("libraries.layout.step.description"); } } diff --git a/java/idea-ui/src/com/intellij/ide/util/importProject/ModuleDescriptor.java b/java/idea-ui/src/com/intellij/ide/util/importProject/ModuleDescriptor.java index 6cdac9ae415d..9ffdff698898 100644 --- a/java/idea-ui/src/com/intellij/ide/util/importProject/ModuleDescriptor.java +++ b/java/idea-ui/src/com/intellij/ide/util/importProject/ModuleDescriptor.java @@ -23,6 +23,7 @@ import com.intellij.openapi.module.Module; import com.intellij.openapi.module.ModuleType; import com.intellij.openapi.roots.ModifiableRootModel; import com.intellij.openapi.util.InvalidDataException; +import com.intellij.openapi.util.NlsSafe; import com.intellij.util.SmartList; import com.intellij.util.containers.MultiMap; import com.intellij.util.text.CaseInsensitiveStringHashingStrategy; @@ -94,7 +95,7 @@ public class ModuleDescriptor { return contentRoot.getName(); } - public String getName() { + public @NlsSafe String getName() { return myName; } diff --git a/java/idea-ui/src/com/intellij/ide/util/importProject/ModuleInsight.java b/java/idea-ui/src/com/intellij/ide/util/importProject/ModuleInsight.java index 5a63fbb531ec..0b8e5717e2ea 100644 --- a/java/idea-ui/src/com/intellij/ide/util/importProject/ModuleInsight.java +++ b/java/idea-ui/src/com/intellij/ide/util/importProject/ModuleInsight.java @@ -1,6 +1,7 @@ // 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.ide.util.importProject; +import com.intellij.ide.JavaUiBundle; import com.intellij.ide.util.projectWizard.importSources.DetectedProjectRoot; import com.intellij.ide.util.projectWizard.importSources.DetectedSourceRoot; import com.intellij.ide.util.projectWizard.importSources.impl.ProjectFromSourcesBuilderImpl; @@ -210,10 +211,10 @@ public abstract class ModuleInsight { for (File contentRoot : moduleContentRoots) { final ModuleDescriptor checkedModule = contentRootToModules.get(contentRoot); - myProgress.setText2("Building library dependencies for module " + checkedModule.getName()); + myProgress.setText2(JavaUiBundle.message("progress.details.building.library.dependencies.for.module", checkedModule.getName())); buildJarDependencies(checkedModule); - myProgress.setText2("Building module dependencies for module " + checkedModule.getName()); + myProgress.setText2(JavaUiBundle.message("progress.details.building.module.dependencies.for.module", checkedModule.getName())); for (File aContentRoot : moduleContentRoots) { final ModuleDescriptor aModule = contentRootToModules.get(aContentRoot); if (checkedModule.equals(aModule)) { @@ -252,13 +253,13 @@ public abstract class ModuleInsight { try { try { for (File root : myEntryPointRoots) { - myProgress.setText("Scanning for libraries " + root.getPath()); + myProgress.setText(JavaUiBundle.message("progress.text.scanning.for.libraries", root.getPath())); scanRootForLibraries(root); } } catch (ProcessCanceledException ignored) { } - myProgress.setText("Building initial libraries layout..."); + myProgress.setText(JavaUiBundle.message("progress.text.building.initial.libraries.layout")); final List libraries = buildInitialLibrariesLayout(myJarToPackagesMap.keySet()); // correct library names so that there are no duplicates final Set libNames = new HashSet<>(myExistingProjectLibraryNames); diff --git a/java/idea-ui/src/com/intellij/ide/util/importProject/ModulesLayoutPanel.java b/java/idea-ui/src/com/intellij/ide/util/importProject/ModulesLayoutPanel.java index de46dcc828cf..e5fbf845bd3a 100644 --- a/java/idea-ui/src/com/intellij/ide/util/importProject/ModulesLayoutPanel.java +++ b/java/idea-ui/src/com/intellij/ide/util/importProject/ModulesLayoutPanel.java @@ -1,6 +1,7 @@ // 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.util.importProject; +import com.intellij.ide.JavaUiBundle; import org.jetbrains.annotations.Nullable; import java.io.File; @@ -79,12 +80,12 @@ public class ModulesLayoutPanel extends ProjectLayoutPanel{ @Override protected String getEntriesChooserTitle() { - return "Modules"; + return JavaUiBundle.message("title.modules"); } @Override protected String getDependenciesTitle() { - return "Module dependencies"; + return JavaUiBundle.message("title.module.dependencies"); } @Override @@ -94,18 +95,16 @@ public class ModulesLayoutPanel extends ProjectLayoutPanel{ @Override protected String getSplitDialogChooseFilesPrompt() { - return "&Select content roots to extract to the new module:"; + return JavaUiBundle.message("label.select.content.roots.to.extract.to.new.module"); } @Override protected String getNameAlreadyUsedMessage(final String name) { - return "Module with name " + name + " already exists"; + return JavaUiBundle.message("error.module.with.name.already.exists", name); } @Override protected String getStepDescriptionText() { - return "Please review suggested module structure for the project. At this stage you can set module names,\n" + - "exclude particular modules from the project, merge or split individual modules.\n" + - "All dependencies between the modules as well as dependencies on the libraries will be automatically updated."; + return JavaUiBundle.message("module.structure.step.description"); } } diff --git a/java/idea-ui/src/com/intellij/ide/util/importProject/ProjectLayoutPanel.java b/java/idea-ui/src/com/intellij/ide/util/importProject/ProjectLayoutPanel.java index 570d4aa4ba6a..563f684639ff 100644 --- a/java/idea-ui/src/com/intellij/ide/util/importProject/ProjectLayoutPanel.java +++ b/java/idea-ui/src/com/intellij/ide/util/importProject/ProjectLayoutPanel.java @@ -12,6 +12,7 @@ import com.intellij.openapi.ui.InputValidator; import com.intellij.openapi.ui.Messages; import com.intellij.openapi.ui.Splitter; import com.intellij.openapi.ui.ex.MultiLineLabel; +import com.intellij.openapi.util.NlsContexts; import com.intellij.openapi.util.text.StringUtil; import com.intellij.ui.DocumentAdapter; import com.intellij.ui.IdeBorderFactory; @@ -271,15 +272,15 @@ abstract class ProjectLayoutPanel extends JPanel { protected abstract void setElementName(T entry, String name); - protected abstract String getSplitDialogChooseFilesPrompt(); + protected abstract @NlsContexts.Label String getSplitDialogChooseFilesPrompt(); - protected abstract String getNameAlreadyUsedMessage(final String name); + protected abstract @NlsContexts.DialogMessage String getNameAlreadyUsedMessage(final String name); - protected abstract String getStepDescriptionText(); + protected abstract @NlsContexts.DialogMessage String getStepDescriptionText(); - protected abstract String getEntriesChooserTitle(); + protected abstract @NlsContexts.TabTitle String getEntriesChooserTitle(); - protected abstract String getDependenciesTitle(); + protected abstract @NlsContexts.TabTitle String getDependenciesTitle(); protected abstract String getElementTypeName();