[git] Localize GitStashChangesSaver

GitOrigin-RevId: 8ed28e77113dc36008bbca67816e8617b12b33b8
This commit is contained in:
Nikolay Rykunov
2020-04-07 13:36:51 +00:00
committed by intellij-monorepo-bot
parent 8f0bdd4e89
commit 8522fe2c4b
3 changed files with 34 additions and 30 deletions
@@ -266,9 +266,13 @@ preserving.process.local.changes.not.restored.error.title=Local changes were not
restore.notification.failed.shelf.message=Before update your uncommitted changes were saved to <a href='saver'>shelf</a>.<br/>Update is not complete, you have unresolved merges in your working tree<br/>Resolve conflicts, complete update and restore changes manually.
restore.notification.failed.stash.message=Before update your uncommitted changes were saved to <a href='saver'>stash</a>.<br/>Update is not complete, you have unresolved merges in your working tree<br/>Resolve conflicts, complete update and restore changes manually.
restore.notification.failed.title=Local changes were not restored
save.load.conflict.dialog.diff.left.title=Your uncommitted changes
save.load.conflict.dialog.diff.right.title=Changes from remote
save.notification.failed.shelf.text=Tried to save uncommitted changes in shelf before {0}, but failed with an error.<br/>{1}
save.notification.failed.stash.text=Tried to save uncommitted changes in stash before {0}, but failed with an error.<br/>{1}
save.notification.failed.title=Couldn't save uncommitted changes
smart.operation.dialog.north.panel.label.shelf.text=<html>Your local changes to the following files would be overwritten by {0}.<br/> {1} can shelve the changes, {0} and unshelve them after that.</html>
smart.operation.dialog.north.panel.label.stash.text=<html>Your local changes to the following files would be overwritten by {0}.<br/> {1} can stash the changes, {0} and unstash them after that.</html>
smart.operation.dialog.ok.action.shelf.description=Shelve local changes, {0}, unshelve
@@ -287,15 +291,21 @@ ssh.keyboard.interactive.username=Username:
ssh.new.host.key=<html>Connecting to a new host {0}:{1,number,#} that has the key {2} (type {3}).\nDo you want to add this host to known hosts database?</html>
ssh.password.message=Password for user {0}:
ssh.password.title=SSH Password Login
stash.action.name=Stash
stash.button=Create Stash
stash.error.can.not.stash.changes.now=Can not stash changes now
stash.keep.index.tooltip=If this checkbox is selected, indexed changes are kept in the index.
stash.keep.index=Keep &index
stash.message.tooltip=Enter stash message here.
stash.message=&Message:
stash.progress.indicator.title=Stashing changes from ''{0}''...
stash.title=Stash
stash.unstash.conflict.dialog.description.label.text=Uncommitted changes that were stashed before update have conflicts with updated files.
stash.unstash.progress.indicator.title=Popping changes to ''{0}''...
stash.unstash.unresolved.conflict.warning.notification.message=Your uncommitted changes were saved to <a href='saver'>stash</a>.<br/>Unstash is not complete, you have unresolved merges in your working tree<br/><a href='resolve'>Resolve</a> conflicts and drop the stash.
stash.unstash.unresolved.conflict.warning.notification.title=Local changes were restored with conflicts
stashing.title=Stashing Changes...
stash.error.can.not.stash.changes.now=Can not stash changes now
tag.action.name=Tag
tag.button=Create Tag
@@ -125,7 +125,7 @@ public abstract class GitChangesSaver {
*/
@NotNull
protected static String getConflictRightPanelTitle() {
return "Changes from remote";
return GitBundle.getString("save.load.conflict.dialog.diff.right.title");
}
/**
@@ -133,7 +133,7 @@ public abstract class GitChangesSaver {
*/
@NotNull
protected static String getConflictLeftPanelTitle() {
return "Your uncommitted changes";
return GitBundle.getString("save.load.conflict.dialog.diff.left.title");
}
protected class ShowSavedChangesNotificationListener implements NotificationListener {
@@ -1,4 +1,4 @@
// Copyright 2000-2019 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.
// 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 git4idea.stash;
import com.intellij.notification.Notification;
@@ -51,7 +51,7 @@ public class GitStashChangesSaver extends GitChangesSaver {
LOG.info("saving " + rootsToSave);
for (VirtualFile root : rootsToSave) {
final String message = "Stashing changes from '" + root.getName() + "'...";
String message = GitBundle.message("stash.progress.indicator.title", root.getName());
LOG.info(message);
final String oldProgressTitle = myProgressIndicator.getText();
myProgressIndicator.setText(message);
@@ -86,7 +86,7 @@ public class GitStashChangesSaver extends GitChangesSaver {
public void load() {
final String oldProgressTitle = myProgressIndicator.getText();
GitStashUtils.unstash(myProject, myStashedRoots, (root) -> {
final String message = "Popping changes to '" + root.getName() + "'...";
String message = GitBundle.message("stash.unstash.progress.indicator.title", root.getName());
myProgressIndicator.setText(message);
GitLineHandler handler = new GitLineHandler(myProject, root, GitCommand.STASH);
handler.addParameters("pop");
@@ -134,29 +134,23 @@ public class GitStashChangesSaver extends GitChangesSaver {
@Override
protected void notifyUnresolvedRemain() {
VcsNotifier.getInstance(myProject).notifyImportantWarning("Local changes were restored with conflicts",
"Your uncommitted changes were saved to <a href='saver'>stash</a>.<br/>" +
"Unstash is not complete, you have unresolved merges in your working tree<br/>" +
"<a href='resolve'>Resolve</a> conflicts and drop the stash.",
new NotificationListener() {
@Override
public void hyperlinkUpdate(@NotNull Notification notification,
@NotNull HyperlinkEvent event) {
if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
if (event.getDescription().equals("saver")) {
// we don't use #showSavedChanges to specify unmerged root first
GitUnstashDialog.showUnstashDialog(myProject,
new ArrayList<>(
myStashedRoots),
myStashedRoots.iterator().next()
);
}
else if (event.getDescription().equals("resolve")) {
mergeNoProceed();
}
}
}
}
VcsNotifier.getInstance(myProject).notifyImportantWarning(
GitBundle.getString("stash.unstash.unresolved.conflict.warning.notification.title"),
GitBundle.getString("stash.unstash.unresolved.conflict.warning.notification.message"),
new NotificationListener() {
@Override
public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
if (event.getDescription().equals("saver")) {
// we don't use #showSavedChanges to specify unmerged root first
GitUnstashDialog.showUnstashDialog(myProject, new ArrayList<>(myStashedRoots), myStashedRoots.iterator().next());
}
else if (event.getDescription().equals("resolve")) {
mergeNoProceed();
}
}
}
}
);
}
@@ -167,7 +161,7 @@ public class GitStashChangesSaver extends GitChangesSaver {
@NotNull
@Override
public String getMultipleFileMergeDescription(@NotNull Collection<VirtualFile> files) {
return "Uncommitted changes that were stashed before update have conflicts with updated files.";
return GitBundle.getString("stash.unstash.conflict.dialog.description.label.text");
}
@NotNull