From a15efddfc21162ea0bb37b199ca7aae5944e0a35 Mon Sep 17 00:00:00 2001 From: Julia Beliaeva Date: Wed, 4 Mar 2020 23:15:28 +0300 Subject: [PATCH] [vcs] i18n for file history GitOrigin-RevId: c3ec86f611b66887c60ca07e5c7f5d007913f34d --- .../vcs-api-core/resources/messages/VcsBundle.properties | 8 ++++++++ .../com/intellij/openapi/vcs/history/DetailsPanel.java | 3 ++- .../openapi/vcs/history/FileHistoryPanelImpl.java | 8 +++++--- .../intellij/openapi/vcs/history/LimitHistoryCheck.java | 6 +++--- .../intellij/openapi/vcs/history/VcsCachingHistory.java | 2 +- .../src/com/intellij/openapi/vcs/history/VcsDiffUtil.java | 2 +- .../com/intellij/openapi/vcs/history/VcsHistoryUtil.java | 2 +- 7 files changed, 21 insertions(+), 10 deletions(-) diff --git a/platform/vcs-api/vcs-api-core/resources/messages/VcsBundle.properties b/platform/vcs-api/vcs-api-core/resources/messages/VcsBundle.properties index 9959a91ddb75..df8ad6cfe3f9 100644 --- a/platform/vcs-api/vcs-api-core/resources/messages/VcsBundle.properties +++ b/platform/vcs-api/vcs-api-core/resources/messages/VcsBundle.properties @@ -906,6 +906,14 @@ local.changes.tab=Local Changes error.cant.perform.operation.now=Can not {0} now local.changes.freeze.message=Local changes are not available until {0} is finished +file.history.checking.last.revision.process=Checking last revision +file.history.diff.with.local.process=Collecting changes... +file.history.diff.revisions.process=Comparing revisions... +file.history.exceeded.limit.message=File History: only {0} revisions were loaded for {1}\nTo change the history limit, go to Settings | Version Control. +file.history.details.empty.status=Commit message +file.history.details.on.date.at.time=on {0} at {1} +file.history.details.committer.info=committed by {0} +file.history.details.committer.tooltip.info=via {0} file.history.diff.handler.paths.diff.title=Difference between {0} and {1} in {2} file.history.diff.handler.paths.diff.with.local.title=Difference between {0} and local version in {1} file.history.diff.handler.affected.changes.title=Initial commit {0} in {1} diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/DetailsPanel.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/DetailsPanel.java index 30eadf0eaa13..959ee96fc4e3 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/DetailsPanel.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/DetailsPanel.java @@ -22,6 +22,7 @@ import com.intellij.openapi.actionSystem.PlatformDataKeys; import com.intellij.openapi.ide.CopyPasteManager; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.text.StringUtil; +import com.intellij.openapi.vcs.VcsBundle; import com.intellij.ui.ColorUtil; import com.intellij.ui.JBColor; import com.intellij.util.ui.HtmlPanel; @@ -52,7 +53,7 @@ class DetailsPanel extends HtmlPanel implements DataProvider, CopyProvider { return mySelection == null || mySelection.isEmpty(); } }; - myStatusText.setText("Commit message"); + myStatusText.setText(VcsBundle.message("file.history.details.empty.status")); myStatusText.attachTo(this); setPreferredSize(new JBDimension(150, 100)); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java index 89b6a8124d4d..c78817272cc7 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java @@ -198,10 +198,12 @@ public class FileHistoryPanelImpl extends JPanel implements DataProvider, Dispos sb.append(VcsUtil.getShortRevisionString(revision.getRevisionNumber())).append(" "); sb.append(revision.getAuthor()); long time = revision.getRevisionDate().getTime(); - sb.append(" on ").append(DateFormatUtil.formatDate(time)).append(" at ").append(DateFormatUtil.formatTime(time)); + sb.append(" ").append(VcsBundle.message("file.history.details.on.date.at.time", DateFormatUtil.formatDate(time), + DateFormatUtil.formatTime(time))); if (revision instanceof VcsFileRevisionEx) { if (!Comparing.equal(revision.getAuthor(), ((VcsFileRevisionEx)revision).getCommitterName())) { - sb.append(" (committed by ").append(((VcsFileRevisionEx)revision).getCommitterName()).append(")"); + sb.append(" (").append(VcsBundle.message("file.history.details.committer.info", + ((VcsFileRevisionEx)revision).getCommitterName())).append(")"); } } if (withMessage) { @@ -750,7 +752,7 @@ public class FileHistoryPanelImpl extends JPanel implements DataProvider, Dispos StringBuilder sb = new StringBuilder(StringUtil.notNullize(ex.getAuthor())); if (ex.getAuthorEmail() != null) sb.append(" <").append(ex.getAuthorEmail()).append(">"); if (ex.getCommitterName() != null && !Comparing.equal(ex.getAuthor(), ex.getCommitterName())) { - sb.append(", via ").append(ex.getCommitterName()); + sb.append(", ").append(VcsBundle.message("file.history.details.committer.tooltip.info", ex.getCommitterName())); if (ex.getCommitterEmail() != null) sb.append(" <").append(ex.getCommitterEmail()).append(">"); } ((AuthorCellRenderer)renderer).setTooltipText(sb.toString()); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/LimitHistoryCheck.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/LimitHistoryCheck.java index e63cd1da2b2b..d8b6ae133706 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/LimitHistoryCheck.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/LimitHistoryCheck.java @@ -17,6 +17,7 @@ package com.intellij.openapi.vcs.history; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.MessageType; +import com.intellij.openapi.vcs.VcsBundle; import com.intellij.openapi.vcs.VcsConfiguration; import com.intellij.openapi.vcs.ui.VcsBalloonProblemNotifier; import org.jetbrains.annotations.NotNull; @@ -46,9 +47,8 @@ public class LimitHistoryCheck { ++myCount; if (isOver()) { if (!myWarningShown) { - VcsBalloonProblemNotifier - .showOverChangesView(myProject, "File History: only " + myLimit + " revisions were loaded for " + myFilePath + - "\nTo change the history limit, go to Settings | Version Control.", MessageType.WARNING); + String message = VcsBundle.message("file.history.exceeded.limit.message", myLimit, myFilePath); + VcsBalloonProblemNotifier.showOverChangesView(myProject, message, MessageType.WARNING); myWarningShown = true; } throw new VcsFileHistoryLimitReachedException(); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/VcsCachingHistory.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/VcsCachingHistory.java index 80c6784e94dc..243b0a4052a3 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/VcsCachingHistory.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/VcsCachingHistory.java @@ -140,7 +140,7 @@ public class VcsCachingHistory { @NotNull VcsCacheableHistorySessionFactory cacheableFactory) { ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator(); if (indicator != null) { - indicator.setText2("Checking last revision"); + indicator.setText2(VcsBundle.message("file.history.checking.last.revision.process")); } VcsAbstractHistorySession cached = myVcsHistoryCache.getFull(filePath, vcsKey, cacheableFactory); if (cached == null || cached.getRevisionList().isEmpty()) return null; diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/VcsDiffUtil.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/VcsDiffUtil.java index 285a65abab3d..276483322955 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/VcsDiffUtil.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/VcsDiffUtil.java @@ -104,7 +104,7 @@ public class VcsDiffUtil { BackgroundableActionLock lock = BackgroundableActionLock.getLock(project, VcsBackgroundableActions.COMPARE_WITH, file); - final Task.Backgroundable task = new Task.Backgroundable(project, "Collecting Changes...", true) { + final Task.Backgroundable task = new Task.Backgroundable(project, VcsBundle.message("file.history.diff.with.local.process"), true) { private Collection changes; private VcsRevisionNumber currentRevNumber; diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/VcsHistoryUtil.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/VcsHistoryUtil.java index 0ee7dfa1600d..c4a5c4b946f7 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/VcsHistoryUtil.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/VcsHistoryUtil.java @@ -184,7 +184,7 @@ public class VcsHistoryUtil { @NotNull final FilePath filePath, @NotNull final VcsFileRevision older, @NotNull final VcsFileRevision newer) { - new Task.Backgroundable(project, "Comparing Revisions...") { + new Task.Backgroundable(project, VcsBundle.message("file.history.diff.revisions.process")) { @Override public void run(@NotNull ProgressIndicator indicator) { try {