Git: Avoid translation of git commands

Fixes: QTCREATORBUG-24390
Change-Id: I9bb041045d6adf0ae91f6d22723846f058662275
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
This commit is contained in:
Orgad Shaneh
2020-07-31 17:18:41 +03:00
committed by Orgad Shaneh
parent e04b9a5348
commit be16ac2371

View File

@@ -678,15 +678,18 @@ GitPluginPrivate::GitPluginPrivate()
currentFileMenu->menu()->setTitle(tr("Current &File")); currentFileMenu->menu()->setTitle(tr("Current &File"));
gitContainer->addMenu(currentFileMenu); gitContainer->addMenu(currentFileMenu);
createFileAction(currentFileMenu, tr("Diff Current File"), tr("Diff of \"%1\""), createFileAction(currentFileMenu, tr("Diff Current File", "Avoid translating \"Diff\""),
tr("Diff of \"%1\"", "Avoid translating \"Diff\""),
"Git.Diff", context, true, std::bind(&GitPluginPrivate::diffCurrentFile, this), "Git.Diff", context, true, std::bind(&GitPluginPrivate::diffCurrentFile, this),
QKeySequence(useMacShortcuts ? tr("Meta+G,Meta+D") : tr("Alt+G,Alt+D"))); QKeySequence(useMacShortcuts ? tr("Meta+G,Meta+D") : tr("Alt+G,Alt+D")));
createFileAction(currentFileMenu, tr("Log Current File"), tr("Log of \"%1\""), createFileAction(currentFileMenu, tr("Log Current File", "Avoid translating \"Log\""),
tr("Log of \"%1\"", "Avoid translating \"Log\""),
"Git.Log", context, true, std::bind(&GitPluginPrivate::logFile, this), "Git.Log", context, true, std::bind(&GitPluginPrivate::logFile, this),
QKeySequence(useMacShortcuts ? tr("Meta+G,Meta+L") : tr("Alt+G,Alt+L"))); QKeySequence(useMacShortcuts ? tr("Meta+G,Meta+L") : tr("Alt+G,Alt+L")));
createFileAction(currentFileMenu, tr("Blame Current File"), tr("Blame for \"%1\""), createFileAction(currentFileMenu, tr("Blame Current File", "Avoid translating \"Blame\""),
tr("Blame for \"%1\"", "Avoid translating \"Blame\""),
"Git.Blame", context, true, std::bind(&GitPluginPrivate::blameFile, this), "Git.Blame", context, true, std::bind(&GitPluginPrivate::blameFile, this),
QKeySequence(useMacShortcuts ? tr("Meta+G,Meta+B") : tr("Alt+G,Alt+B"))); QKeySequence(useMacShortcuts ? tr("Meta+G,Meta+B") : tr("Alt+G,Alt+B")));
@@ -714,15 +717,18 @@ GitPluginPrivate::GitPluginPrivate()
currentProjectMenu->menu()->setTitle(tr("Current &Project")); currentProjectMenu->menu()->setTitle(tr("Current &Project"));
gitContainer->addMenu(currentProjectMenu); gitContainer->addMenu(currentProjectMenu);
createProjectAction(currentProjectMenu, tr("Diff Current Project"), tr("Diff Project \"%1\""), createProjectAction(currentProjectMenu, tr("Diff Current Project", "Avoid translating \"Diff\""),
tr("Diff Project \"%1\"", "Avoid translating \"Diff\""),
"Git.DiffProject", context, true, &GitPluginPrivate::diffCurrentProject, "Git.DiffProject", context, true, &GitPluginPrivate::diffCurrentProject,
QKeySequence(useMacShortcuts ? tr("Meta+G,Meta+Shift+D") : tr("Alt+G,Alt+Shift+D"))); QKeySequence(useMacShortcuts ? tr("Meta+G,Meta+Shift+D") : tr("Alt+G,Alt+Shift+D")));
createProjectAction(currentProjectMenu, tr("Log Project"), tr("Log Project \"%1\""), createProjectAction(currentProjectMenu, tr("Log Project", "Avoid translating \"Log\""),
tr("Log Project \"%1\"", "Avoid translating \"Log\""),
"Git.LogProject", context, true, &GitPluginPrivate::logProject, "Git.LogProject", context, true, &GitPluginPrivate::logProject,
QKeySequence(useMacShortcuts ? tr("Meta+G,Meta+K") : tr("Alt+G,Alt+K"))); QKeySequence(useMacShortcuts ? tr("Meta+G,Meta+K") : tr("Alt+G,Alt+K")));
createProjectAction(currentProjectMenu, tr("Clean Project..."), tr("Clean Project \"%1\"..."), createProjectAction(currentProjectMenu, tr("Clean Project...", "Avoid translating \"Clean\""),
tr("Clean Project \"%1\"...", "Avoid translating \"Clean\""),
"Git.CleanProject", context, true, &GitPluginPrivate::cleanProject); "Git.CleanProject", context, true, &GitPluginPrivate::cleanProject);
@@ -731,40 +737,43 @@ GitPluginPrivate::GitPluginPrivate()
localRepositoryMenu->menu()->setTitle(tr("&Local Repository")); localRepositoryMenu->menu()->setTitle(tr("&Local Repository"));
gitContainer->addMenu(localRepositoryMenu); gitContainer->addMenu(localRepositoryMenu);
createRepositoryAction(localRepositoryMenu, tr("Diff"), "Git.DiffRepository", createRepositoryAction(localRepositoryMenu, "Diff", "Git.DiffRepository",
context, true, &GitClient::diffRepository); context, true, &GitClient::diffRepository);
createRepositoryAction(localRepositoryMenu, tr("Log"), "Git.LogRepository", createRepositoryAction(localRepositoryMenu, "Log", "Git.LogRepository",
context, true, std::bind(&GitPluginPrivate::logRepository, this)); context, true, std::bind(&GitPluginPrivate::logRepository, this));
createRepositoryAction(localRepositoryMenu, tr("Reflog"), "Git.ReflogRepository", createRepositoryAction(localRepositoryMenu, "Reflog", "Git.ReflogRepository",
context, true, std::bind(&GitPluginPrivate::reflogRepository, this)); context, true, std::bind(&GitPluginPrivate::reflogRepository, this));
createRepositoryAction(localRepositoryMenu, tr("Clean..."), "Git.CleanRepository", createRepositoryAction(localRepositoryMenu, "Clean...", "Git.CleanRepository",
context, true, [this] { cleanRepository(); }); context, true, [this] { cleanRepository(); });
createRepositoryAction(localRepositoryMenu, tr("Status"), "Git.StatusRepository", createRepositoryAction(localRepositoryMenu, "Status", "Git.StatusRepository",
context, true, &GitClient::status); context, true, &GitClient::status);
// -------------- // --------------
localRepositoryMenu->addSeparator(context); localRepositoryMenu->addSeparator(context);
createRepositoryAction(localRepositoryMenu, tr("Commit..."), "Git.Commit", createRepositoryAction(localRepositoryMenu, "Commit...", "Git.Commit",
context, true, std::bind(&GitPluginPrivate::startCommit, this, SimpleCommit), context, true, std::bind(&GitPluginPrivate::startCommit, this, SimpleCommit),
QKeySequence(useMacShortcuts ? tr("Meta+G,Meta+C") : tr("Alt+G,Alt+C"))); QKeySequence(useMacShortcuts ? tr("Meta+G,Meta+C") : tr("Alt+G,Alt+C")));
createRepositoryAction(localRepositoryMenu, tr("Amend Last Commit..."), "Git.AmendCommit", createRepositoryAction(localRepositoryMenu,
tr("Amend Last Commit...", "Avoid translating \"Commit\""),
"Git.AmendCommit",
context, true, std::bind(&GitPluginPrivate::startCommit, this, AmendCommit)); context, true, std::bind(&GitPluginPrivate::startCommit, this, AmendCommit));
m_fixupCommitAction m_fixupCommitAction
= createRepositoryAction(localRepositoryMenu, = createRepositoryAction(localRepositoryMenu,
tr("Fixup Previous Commit..."), "Git.FixupCommit", context, true, tr("Fixup Previous Commit...", "Avoid translating \"Commit\""),
"Git.FixupCommit", context, true,
std::bind(&GitPluginPrivate::startCommit, this, FixupCommit)); std::bind(&GitPluginPrivate::startCommit, this, FixupCommit));
// -------------- // --------------
localRepositoryMenu->addSeparator(context); localRepositoryMenu->addSeparator(context);
createRepositoryAction(localRepositoryMenu, tr("Reset..."), "Git.Reset", createRepositoryAction(localRepositoryMenu, "Reset...", "Git.Reset",
context, true, std::bind(&GitPluginPrivate::resetRepository, this)); context, true, std::bind(&GitPluginPrivate::resetRepository, this));
createRepositoryAction(localRepositoryMenu, tr("Recover Deleted Files"), "Git.RecoverDeleted", createRepositoryAction(localRepositoryMenu, tr("Recover Deleted Files"), "Git.RecoverDeleted",
@@ -772,7 +781,8 @@ GitPluginPrivate::GitPluginPrivate()
m_interactiveRebaseAction m_interactiveRebaseAction
= createRepositoryAction(localRepositoryMenu, = createRepositoryAction(localRepositoryMenu,
tr("Interactive Rebase..."), "Git.InteractiveRebase", tr("Interactive Rebase...", "Avoid translating \"Rebase\""),
"Git.InteractiveRebase",
context, true, std::bind(&GitPluginPrivate::startRebase, this)); context, true, std::bind(&GitPluginPrivate::startRebase, this));
m_submoduleUpdateAction m_submoduleUpdateAction
@@ -781,25 +791,26 @@ GitPluginPrivate::GitPluginPrivate()
context, true, std::bind(&GitPluginPrivate::updateSubmodules, this)); context, true, std::bind(&GitPluginPrivate::updateSubmodules, this));
m_abortMergeAction m_abortMergeAction
= createRepositoryAction(localRepositoryMenu, = createRepositoryAction(localRepositoryMenu,
tr("Abort Merge"), "Git.MergeAbort", tr("Abort Merge", "Avoid translating \"Merge\""),
context, true, "Git.MergeAbort", context, true,
std::bind(&GitPluginPrivate::continueOrAbortCommand, this)); std::bind(&GitPluginPrivate::continueOrAbortCommand, this));
m_abortRebaseAction m_abortRebaseAction
= createRepositoryAction(localRepositoryMenu, = createRepositoryAction(localRepositoryMenu,
tr("Abort Rebase"), "Git.RebaseAbort", tr("Abort Rebase", "Avoid translating \"Rebase\""),
context, true, "Git.RebaseAbort", context, true,
std::bind(&GitPluginPrivate::continueOrAbortCommand, this)); std::bind(&GitPluginPrivate::continueOrAbortCommand, this));
m_abortCherryPickAction m_abortCherryPickAction
= createRepositoryAction(localRepositoryMenu, = createRepositoryAction(localRepositoryMenu,
tr("Abort Cherry Pick"), "Git.CherryPickAbort", tr("Abort Cherry Pick", "Avoid translating \"Cherry Pick\""),
"Git.CherryPickAbort",
context, true, context, true,
std::bind(&GitPluginPrivate::continueOrAbortCommand, this)); std::bind(&GitPluginPrivate::continueOrAbortCommand, this));
m_abortRevertAction m_abortRevertAction
= createRepositoryAction(localRepositoryMenu, = createRepositoryAction(localRepositoryMenu,
tr("Abort Revert"), "Git.RevertAbort", tr("Abort Revert", "Avoid translating \"Revert\""), "Git.RevertAbort",
context, true, context, true,
std::bind(&GitPluginPrivate::continueOrAbortCommand, this)); std::bind(&GitPluginPrivate::continueOrAbortCommand, this));
@@ -855,16 +866,17 @@ GitPluginPrivate::GitPluginPrivate()
stashMenu->menu()->setTitle(tr("&Stash")); stashMenu->menu()->setTitle(tr("&Stash"));
localRepositoryMenu->addMenu(stashMenu); localRepositoryMenu->addMenu(stashMenu);
createRepositoryAction(stashMenu, tr("Stashes..."), "Git.StashList", createRepositoryAction(stashMenu, "Stashes...", "Git.StashList",
context, false, std::bind(&GitPluginPrivate::stashList, this)); context, false, std::bind(&GitPluginPrivate::stashList, this));
stashMenu->addSeparator(context); stashMenu->addSeparator(context);
QAction *action = createRepositoryAction(stashMenu, tr("Stash"), "Git.Stash", QAction *action = createRepositoryAction(stashMenu, "Stash", "Git.Stash",
context, true, std::bind(&GitPluginPrivate::stash, this, false)); context, true, std::bind(&GitPluginPrivate::stash, this, false));
action->setToolTip(tr("Saves the current state of your work and resets the repository.")); action->setToolTip(tr("Saves the current state of your work and resets the repository."));
action = createRepositoryAction(stashMenu, tr("Stash Unstaged Files"), "Git.StashUnstaged", action = createRepositoryAction(stashMenu, tr("Stash Unstaged Files", "Avoid translating \"Stash\""),
"Git.StashUnstaged",
context, true, std::bind(&GitPluginPrivate::stashUnstaged, this)); context, true, std::bind(&GitPluginPrivate::stashUnstaged, this));
action->setToolTip(tr("Saves the current state of your unstaged files and resets the repository " action->setToolTip(tr("Saves the current state of your unstaged files and resets the repository "
"to its staged state.")); "to its staged state."));
@@ -875,7 +887,8 @@ GitPluginPrivate::GitPluginPrivate()
stashMenu->addSeparator(context); stashMenu->addSeparator(context);
action = createRepositoryAction(stashMenu, tr("Stash Pop"), "Git.StashPop", action = createRepositoryAction(stashMenu, tr("Stash Pop", "Avoid translating \"Stash\""),
"Git.StashPop",
context, true, std::bind(&GitPluginPrivate::stashPop, this)); context, true, std::bind(&GitPluginPrivate::stashPop, this));
action->setToolTip(tr("Restores changes saved to the stash list using \"Stash\".")); action->setToolTip(tr("Restores changes saved to the stash list using \"Stash\"."));
@@ -889,13 +902,13 @@ GitPluginPrivate::GitPluginPrivate()
remoteRepositoryMenu->menu()->setTitle(tr("&Remote Repository")); remoteRepositoryMenu->menu()->setTitle(tr("&Remote Repository"));
gitContainer->addMenu(remoteRepositoryMenu); gitContainer->addMenu(remoteRepositoryMenu);
createRepositoryAction(remoteRepositoryMenu, tr("Fetch"), "Git.Fetch", createRepositoryAction(remoteRepositoryMenu, "Fetch", "Git.Fetch",
context, true, std::bind(&GitPluginPrivate::fetch, this)); context, true, std::bind(&GitPluginPrivate::fetch, this));
createRepositoryAction(remoteRepositoryMenu, tr("Pull"), "Git.Pull", createRepositoryAction(remoteRepositoryMenu, "Pull", "Git.Pull",
context, true, std::bind(&GitPluginPrivate::pull, this)); context, true, std::bind(&GitPluginPrivate::pull, this));
createRepositoryAction(remoteRepositoryMenu, tr("Push"), "Git.Push", createRepositoryAction(remoteRepositoryMenu, "Push", "Git.Push",
context, true, std::bind(&GitPluginPrivate::push, this)); context, true, std::bind(&GitPluginPrivate::push, this));
// -------------- // --------------
@@ -906,10 +919,10 @@ GitPluginPrivate::GitPluginPrivate()
subversionMenu->menu()->setTitle(tr("&Subversion")); subversionMenu->menu()->setTitle(tr("&Subversion"));
remoteRepositoryMenu->addMenu(subversionMenu); remoteRepositoryMenu->addMenu(subversionMenu);
createRepositoryAction(subversionMenu, tr("Log"), "Git.Subversion.Log", createRepositoryAction(subversionMenu, "Log", "Git.Subversion.Log",
context, false, &GitClient::subversionLog); context, false, &GitClient::subversionLog);
createRepositoryAction(subversionMenu, tr("Fetch"), "Git.Subversion.Fetch", createRepositoryAction(subversionMenu, "Fetch", "Git.Subversion.Fetch",
context, false, &GitClient::synchronousSubversionFetch); context, false, &GitClient::synchronousSubversionFetch);
createRepositoryAction(subversionMenu, tr("DCommit"), "Git.Subversion.DCommit", createRepositoryAction(subversionMenu, tr("DCommit"), "Git.Subversion.DCommit",
@@ -926,15 +939,15 @@ GitPluginPrivate::GitPluginPrivate()
// -------------- // --------------
/* Actions only in locator */ /* Actions only in locator */
createChangeRelatedRepositoryAction(tr("Show..."), "Git.Show", context); createChangeRelatedRepositoryAction("Show...", "Git.Show", context);
createChangeRelatedRepositoryAction(tr("Revert..."), "Git.Revert", context); createChangeRelatedRepositoryAction("Revert...", "Git.Revert", context);
createChangeRelatedRepositoryAction(tr("Cherry Pick..."), "Git.CherryPick", context); createChangeRelatedRepositoryAction("Cherry Pick...", "Git.CherryPick", context);
createChangeRelatedRepositoryAction(tr("Checkout..."), "Git.Checkout", context); createChangeRelatedRepositoryAction("Checkout...", "Git.Checkout", context);
createChangeRelatedRepositoryAction(tr("Archive..."), "Git.Archive", context); createChangeRelatedRepositoryAction(tr("Archive..."), "Git.Archive", context);
createRepositoryAction(nullptr, tr("Rebase..."), "Git.Rebase", context, true, createRepositoryAction(nullptr, "Rebase...", "Git.Rebase", context, true,
std::bind(&GitPluginPrivate::branchList, this)); std::bind(&GitPluginPrivate::branchList, this));
createRepositoryAction(nullptr, tr("Merge..."), "Git.Merge", context, true, createRepositoryAction(nullptr, "Merge...", "Git.Merge", context, true,
std::bind(&GitPluginPrivate::branchList, this)); std::bind(&GitPluginPrivate::branchList, this));
/* \Actions only in locator */ /* \Actions only in locator */