From c752f420259ae734ea51c8db289490227b809b50 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Wed, 29 Jan 2020 18:56:57 +0300 Subject: [PATCH] Localize UI texts from SetupJavaProjectFromSourcesActivity Relates to IDEA-222368 GitOrigin-RevId: 61f7084c9dc8b43035c241d8805f1b670f870535 --- java/idea-ui/intellij.java.ui.iml | 1 + .../messages/JavaUiBundle.properties | 7 +++++++ .../src/com/intellij/ide/JavaUiBundle.java | 19 +++++++++++++++++ .../SetupJavaProjectFromSourcesActivity.kt | 21 ++++++++++++------- 4 files changed, 40 insertions(+), 8 deletions(-) create mode 100644 java/idea-ui/resources/messages/JavaUiBundle.properties create mode 100644 java/idea-ui/src/com/intellij/ide/JavaUiBundle.java diff --git a/java/idea-ui/intellij.java.ui.iml b/java/idea-ui/intellij.java.ui.iml index 2d72e4b20cca..9303df53bf7e 100644 --- a/java/idea-ui/intellij.java.ui.iml +++ b/java/idea-ui/intellij.java.ui.iml @@ -4,6 +4,7 @@ + diff --git a/java/idea-ui/resources/messages/JavaUiBundle.properties b/java/idea-ui/resources/messages/JavaUiBundle.properties new file mode 100644 index 000000000000..c9400bbb7a43 --- /dev/null +++ b/java/idea-ui/resources/messages/JavaUiBundle.properties @@ -0,0 +1,7 @@ +build.script.found.notification={0} build {1,choice,1#script|1") { (provider, files) -> provider.name + ": " + filesToLinks(files, projectDirectory) } @@ -121,7 +120,12 @@ class SetupJavaProjectFromSourcesActivity : StartupActivity { val notification = NOTIFICATION_GROUP.createNotification(title, content, NotificationType.INFORMATION, showFileInProjectViewListener) if (providersAndFiles.keySet().all { it.canImportProjectAfterwards() }) { - val actionName = if (providersAndFiles.keySet().size > 1) "Import All" else "Import" + val actionName = if (providersAndFiles.keySet().size > 1) { + JavaUiBundle.message("build.script.found.notification.import.all") + } + else { + JavaUiBundle.message("build.script.found.notification.import") + } notification.addAction(NotificationAction.createSimpleExpiring(actionName) { for ((provider, files) in providersAndFiles.asMap()) { for (file in files) { @@ -169,9 +173,10 @@ class SetupJavaProjectFromSourcesActivity : StartupActivity { } private fun notifyAboutAutomaticProjectStructure(project: Project) { - val message = "Project structure has been automatically detected" + val message = "${JavaUiBundle.message("project.structure.automatically.detected.notification")}" val notification = NOTIFICATION_GROUP.createNotification("", message, NotificationType.INFORMATION, null) - notification.addAction(NotificationAction.createSimpleExpiring("Configure...") { + notification.addAction(NotificationAction.createSimpleExpiring( + JavaUiBundle.message("project.structure.automatically.detected.notification.configure.action")) { ProjectSettingsService.getInstance(project).openProjectSettings() }) notification.notify(project)