Git: Convert to Tr::tr

Change-Id: I7fb1753109a9263c70c01713f5f4895db6b73662
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Alessandro Portale
2022-10-06 14:05:43 +02:00
committed by hjk
parent b8efc2f14d
commit 928a7d2087
62 changed files with 776 additions and 4045 deletions

View File

@@ -3,6 +3,8 @@
#include "gitsettings.h"
#include "gittr.h"
#include <utils/environment.h>
#include <utils/layoutbuilder.h>
@@ -13,22 +15,21 @@
using namespace Utils;
using namespace VcsBase;
namespace Git {
namespace Internal {
namespace Git::Internal {
GitSettings::GitSettings()
{
setSettingsGroup("Git");
path.setDisplayStyle(StringAspect::LineEditDisplay);
path.setLabelText(tr("Prepend to PATH:"));
path.setLabelText(Tr::tr("Prepend to PATH:"));
registerAspect(&binaryPath);
binaryPath.setDefaultValue("git");
registerAspect(&pullRebase);
pullRebase.setSettingsKey("PullRebase");
pullRebase.setLabelText(tr("Pull with rebase"));
pullRebase.setLabelText(Tr::tr("Pull with rebase"));
registerAspect(&showTags);
showTags.setSettingsKey("ShowTags");
@@ -55,16 +56,16 @@ GitSettings::GitSettings()
registerAspect(&winSetHomeEnvironment);
winSetHomeEnvironment.setSettingsKey("WinSetHomeEnvironment");
winSetHomeEnvironment.setDefaultValue(true);
winSetHomeEnvironment.setLabelText(tr("Set \"HOME\" environment variable"));
winSetHomeEnvironment.setLabelText(Tr::tr("Set \"HOME\" environment variable"));
if (HostOsInfo::isWindowsHost()) {
const QString currentHome = qtcEnvironmentVariable("HOME");
const QString toolTip
= tr("Set the environment variable HOME to \"%1\"\n(%2).\n"
= Tr::tr("Set the environment variable HOME to \"%1\"\n(%2).\n"
"This causes Git to look for the SSH-keys in that location\n"
"instead of its installation directory when run outside git bash.")
.arg(QDir::homePath(),
currentHome.isEmpty() ? tr("not currently set")
: tr("currently set to \"%1\"").arg(currentHome));
currentHome.isEmpty() ? Tr::tr("not currently set")
: Tr::tr("currently set to \"%1\"").arg(currentHome));
winSetHomeEnvironment.setToolTip(toolTip);
} else {
winSetHomeEnvironment.setVisible(false);
@@ -73,19 +74,19 @@ GitSettings::GitSettings()
registerAspect(&gitkOptions);
gitkOptions.setDisplayStyle(StringAspect::LineEditDisplay);
gitkOptions.setSettingsKey("GitKOptions");
gitkOptions.setLabelText(tr("Arguments:"));
gitkOptions.setLabelText(Tr::tr("Arguments:"));
registerAspect(&logDiff);
logDiff.setSettingsKey("LogDiff");
logDiff.setToolTip(tr("Note that huge amount of commits might take some time."));
logDiff.setToolTip(Tr::tr("Note that huge amount of commits might take some time."));
registerAspect(&repositoryBrowserCmd);
repositoryBrowserCmd.setDisplayStyle(StringAspect::PathChooserDisplay);
repositoryBrowserCmd.setSettingsKey("RepositoryBrowserCmd");
repositoryBrowserCmd.setExpectedKind(PathChooser::ExistingCommand);
repositoryBrowserCmd.setHistoryCompleter("Git.RepoCommand.History");
repositoryBrowserCmd.setDisplayName(tr("Git Repository Browser Command"));
repositoryBrowserCmd.setLabelText(tr("Command:"));
repositoryBrowserCmd.setDisplayName(Tr::tr("Git Repository Browser Command"));
repositoryBrowserCmd.setLabelText(Tr::tr("Command:"));
registerAspect(&graphLog);
graphLog.setSettingsKey("GraphLog");
@@ -126,7 +127,7 @@ FilePath GitSettings::gitExecutable(bool *ok, QString *errorMessage) const
if (ok)
*ok = false;
if (errorMessage)
*errorMessage = tr("The binary \"%1\" could not be located in the path \"%2\"")
*errorMessage = Tr::tr("The binary \"%1\" could not be located in the path \"%2\"")
.arg(binaryPath.value(), path.value());
}
return binPath;
@@ -137,7 +138,7 @@ FilePath GitSettings::gitExecutable(bool *ok, QString *errorMessage) const
GitSettingsPage::GitSettingsPage(GitSettings *settings)
{
setId(VcsBase::Constants::VCS_ID_GIT);
setDisplayName(GitSettings::tr("Git"));
setDisplayName(Tr::tr("Git"));
setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY);
setSettings(settings);
@@ -147,7 +148,7 @@ GitSettingsPage::GitSettingsPage(GitSettings *settings)
Column {
Group {
title(GitSettings::tr("Configuration")),
title(Tr::tr("Configuration")),
Column {
Row { s.path },
s.winSetHomeEnvironment,
@@ -155,7 +156,7 @@ GitSettingsPage::GitSettingsPage(GitSettings *settings)
},
Group {
title(GitSettings::tr("Miscellaneous")),
title(Tr::tr("Miscellaneous")),
Column {
Row { s.logCount, s.timeout, st },
s.pullRebase
@@ -163,12 +164,12 @@ GitSettingsPage::GitSettingsPage(GitSettings *settings)
},
Group {
title(GitSettings::tr("Gitk")),
title(Tr::tr("Gitk")),
Row { s.gitkOptions }
},
Group {
title(GitSettings::tr("Repository Browser")),
title(Tr::tr("Repository Browser")),
Row { s.repositoryBrowserCmd }
},
@@ -177,5 +178,4 @@ GitSettingsPage::GitSettingsPage(GitSettings *settings)
});
}
} // namespace Internal
} // namespace Git
} // Git::Internal