Skip to content

Commit

Permalink
Support translating GitPluginBase
Browse files Browse the repository at this point in the history
  • Loading branch information
KindDragon committed Mar 28, 2015
1 parent cb6b860 commit 8f8393c
Show file tree
Hide file tree
Showing 29 changed files with 419 additions and 169 deletions.
182 changes: 176 additions & 6 deletions GitUI/Translation/English.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,60 @@ This action will be performed without warning while checking out branch.</source
</trans-unit>
</body>
</file>
<file datatype="plaintext" original="AutoCompileSubModulesPlugin" source-language="en">
<body>
<trans-unit id="Description.Text">
<source>Auto compile SubModules</source>
<target />
</trans-unit>
<trans-unit id="MsBuildArguments.Caption">
<source>msbuild.exe arguments</source>
<target />
</trans-unit>
<trans-unit id="MsBuildEnabled.Caption">
<source>Enabled</source>
<target />
</trans-unit>
<trans-unit id="MsBuildPath.Caption">
<source>Path to msbuild.exe</source>
<target />
</trans-unit>
<trans-unit id="_doYouWantBuild.Text">
<source>Do you want to build {0}?

{1}</source>
<target />
</trans-unit>
<trans-unit id="_enterCorrectMsBuildPath.Text">
<source>Please enter correct MSBuild path in the plugin settings dialog and try again.</source>
<target />
</trans-unit>
</body>
</file>
<file datatype="plaintext" original="BackgroundFetchPlugin" source-language="en">
<body>
<trans-unit id="AutoRefresh.Caption">
<source>Refresh view after fetch</source>
<target />
</trans-unit>
<trans-unit id="Description.Text">
<source>Periodic background fetch</source>
<target />
</trans-unit>
<trans-unit id="FetchAllSubmodules.Caption">
<source>Fetch all submodules</source>
<target />
</trans-unit>
<trans-unit id="FetchInterval.Caption">
<source>Fetch every (seconds) - set to 0 to disable</source>
<target />
</trans-unit>
<trans-unit id="GitCommand.Caption">
<source>Arguments of git command to run</source>
<target />
</trans-unit>
</body>
</file>
<file datatype="plaintext" original="BlameControl" source-language="en">
<body>
<trans-unit id="blamePreviousRevisionToolStripMenuItem.Text">
Expand Down Expand Up @@ -797,6 +851,14 @@ Please make sure git (msysgit or cygwin) is installed or set the correct command
</trans-unit>
</body>
</file>
<file datatype="plaintext" original="CreateLocalBranchesPlugin" source-language="en">
<body>
<trans-unit id="Description.Text">
<source>Create local tracking branches</source>
<target />
</trans-unit>
</body>
</file>
<file datatype="plaintext" original="CreatePullRequestForm" source-language="en">
<body>
<trans-unit id="$this.Text">
Expand Down Expand Up @@ -1101,6 +1163,22 @@ Do you want to open it?</source>
</trans-unit>
</body>
</file>
<file datatype="plaintext" original="DeleteUnusedBranchesPlugin" source-language="en">
<body>
<trans-unit id="DaysOlderThan.Caption">
<source>Delete obsolete branches older than (days)</source>
<target />
</trans-unit>
<trans-unit id="Description.Text">
<source>Delete obsolete branches</source>
<target />
</trans-unit>
<trans-unit id="MergedInBranch.Caption">
<source>Branch where all branches should be merged in</source>
<target />
</trans-unit>
</body>
</file>
<file datatype="plaintext" original="EditNetSpell" source-language="en">
<body>
<trans-unit id="addToDictionaryText.Text">
Expand Down Expand Up @@ -1389,6 +1467,18 @@ Do you want to open it?</source>
</trans-unit>
</body>
</file>
<file datatype="plaintext" original="FindLargeFilesPlugin" source-language="en">
<body>
<trans-unit id="Description.Text">
<source>Find large files</source>
<target />
</trans-unit>
<trans-unit id="SizeLargeFile.Caption">
<source>Find large files bigger than (Mb)</source>
<target />
</trans-unit>
</body>
</file>
<file datatype="plaintext" original="FolderBrowserButton" source-language="en">
<body>
<trans-unit id="buttonBrowse.Text">
Expand Down Expand Up @@ -6743,6 +6833,10 @@ Context menu for additional operations</source>
</file>
<file datatype="plaintext" original="GerritPlugin" source-language="en">
<body>
<trans-unit id="Description.Text">
<source>Gerrit Code Review</source>
<target />
</trans-unit>
<trans-unit id="_downloadGerritChange.Text">
<source>Download Gerrit Change</source>
<target />
Expand All @@ -6767,10 +6861,6 @@ Context menu for additional operations</source>
<source>Install commit-msg hook</source>
<target />
</trans-unit>
<trans-unit id="_pluginDescription.Text">
<source>Gerrit Code Review</source>
<target />
</trans-unit>
<trans-unit id="_publishGerritChange.Text">
<source>Publish Gerrit Change</source>
<target />
Expand Down Expand Up @@ -7108,6 +7198,30 @@ global settings.
</trans-unit>
</body>
</file>
<file datatype="plaintext" original="GitFlowPlugin" source-language="en">
<body>
<trans-unit id="Description.Text">
<source>GitFlow</source>
<target />
</trans-unit>
</body>
</file>
<file datatype="plaintext" original="Github3Plugin" source-language="en">
<body>
<trans-unit id="Description.Text">
<source>Github</source>
<target />
</trans-unit>
</body>
</file>
<file datatype="plaintext" original="GitImpactPlugin" source-language="en">
<body>
<trans-unit id="Description.Text">
<source>Impact Graph</source>
<target />
</trans-unit>
</body>
</file>
<file datatype="plaintext" original="GitSettingsPage" source-language="en">
<body>
<trans-unit id="$this.Text">
Expand Down Expand Up @@ -7165,6 +7279,26 @@ to %HOMEDRIVE%%HOMEPATH% if empty. Change the default behaviour only if you expe
</trans-unit>
</body>
</file>
<file datatype="plaintext" original="GitStatisticsPlugin" source-language="en">
<body>
<trans-unit id="CodeFiles.Caption">
<source>Code files</source>
<target />
</trans-unit>
<trans-unit id="Description.Text">
<source>Statistics</source>
<target />
</trans-unit>
<trans-unit id="IgnoreDirectories.Caption">
<source>Directories to ignore (EndsWith)</source>
<target />
</trans-unit>
<trans-unit id="IgnoreSubmodules.Caption">
<source>Ignore submodules</source>
<target />
</trans-unit>
</body>
</file>
<file datatype="plaintext" original="GotoUserManualControl" source-language="en">
<body>
<trans-unit id="_gotoUserManualControlTooltip.Text">
Expand All @@ -7177,6 +7311,22 @@ to %HOMEDRIVE%%HOMEPATH% if empty. Change the default behaviour only if you expe
</trans-unit>
</body>
</file>
<file datatype="plaintext" original="GourcePlugin" source-language="en">
<body>
<trans-unit id="Description.Text">
<source>Gource</source>
<target />
</trans-unit>
<trans-unit id="GourceArguments.Caption">
<source>Arguments</source>
<target />
</trans-unit>
<trans-unit id="GourcePath.Caption">
<source>Path to "gource"</source>
<target />
</trans-unit>
</body>
</file>
<file datatype="plaintext" original="GourceStart" source-language="en">
<body>
<trans-unit id="$this.Text">
Expand Down Expand Up @@ -7533,6 +7683,14 @@ This will just checkout on the submodule the commit determined by the superproje
</trans-unit>
</body>
</file>
<file datatype="plaintext" original="ProxySwitcherPlugin" source-language="en">
<body>
<trans-unit id="Description.Text">
<source>Proxy Switcher</source>
<target />
</trans-unit>
</body>
</file>
<file datatype="plaintext" original="ReleaseNotesGeneratorForm" source-language="en">
<body>
<trans-unit id="$this.Text">
Expand Down Expand Up @@ -7618,8 +7776,12 @@ branch names, tag names)</source>
<source>n/a</source>
<target />
</trans-unit>
<trans-unit id="textBoxGitLogArguments.Text">
<source>--pretty="format:%h@%s%b" --abbrev-commit {0}..{1}</source>
</body>
</file>
<file datatype="plaintext" original="ReleaseNotesGeneratorPlugin" source-language="en">
<body>
<trans-unit id="Description.Text">
<source>Release Notes Generator</source>
<target />
</trans-unit>
</body>
Expand Down Expand Up @@ -8246,6 +8408,14 @@ When OpenSSH is used, command line dialogs are shown!
</trans-unit>
</body>
</file>
<file datatype="plaintext" original="StashPlugin" source-language="en">
<body>
<trans-unit id="Description.Text">
<source>Create Stash Pull Request</source>
<target />
</trans-unit>
</body>
</file>
<file datatype="plaintext" original="StashPullRequestForm" source-language="en">
<body>
<trans-unit id="$this.Text">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,27 @@
using System.Text;
using System.Windows.Forms;
using GitUIPluginInterfaces;
using ResourceManager;

namespace AutoCompileSubmodules
{
public class AutoCompileSubModules : GitPluginBase, IGitPluginForRepository
public class AutoCompileSubModulesPlugin : GitPluginBase, IGitPluginForRepository
{
private readonly TranslationString _doYouWantBuild =
new TranslationString("Do you want to build {0}?\n\n{1}");
private readonly TranslationString _enterCorrectMsBuildPath =
new TranslationString("Please enter correct MSBuild path in the plugin settings dialog and try again.");

public AutoCompileSubModulesPlugin()
{
Description = "Auto compile SubModules";
Translate();
}

private BoolSetting MsBuildEnabled = new BoolSetting("Enabled", false);
private StringSetting MsBuildPath = new StringSetting("Path to msbuild.exe", FindMsBuild());
private StringSetting MsBuildArguments = new StringSetting("msbuild.exe arguments", "/p:Configuration=Debug");

private const string DefaultMsBuildPath = @"C:\Windows\Microsoft.NET\Framework\v3.5\msbuild.exe";
private static string FindMsBuild()
{
Expand All @@ -21,15 +33,6 @@ private static string FindMsBuild()

#region IGitPlugin Members

/// <summary>
/// Gets the plugin description.
/// </summary>
/// <value>The description.</value>
public override string Description
{
get { return "Auto compile SubModules"; }
}

public override IEnumerable<ISetting> GetSettings()
{
yield return MsBuildEnabled;
Expand Down Expand Up @@ -66,10 +69,10 @@ public override bool Execute(GitUIBaseEventArgs e)

var result =
MessageBox.Show(e.OwnerForm,
string.Format("Do you want to build {0}?\n\n{1}",
solutionFile.Name,
string.Format(_doYouWantBuild.Text,
solutionFile.Name,
SolutionFilesToString(solutionFiles)),
"Build",
"Build",
MessageBoxButtons.YesNoCancel);

if (result == DialogResult.Cancel)
Expand All @@ -79,7 +82,7 @@ public override bool Execute(GitUIBaseEventArgs e)
continue;

if (string.IsNullOrEmpty(msbuildpath) || !File.Exists(msbuildpath))
MessageBox.Show(e.OwnerForm, "Please enter correct MSBuild path in the plugin settings dialog and try again.");
MessageBox.Show(e.OwnerForm, _enterCorrectMsBuildPath.Text);
else
e.GitUICommands.StartCommandLineProcessDialog(e.OwnerForm, msbuildpath, solutionFile.FullName + " " + MsBuildArguments[Settings]);
}
Expand All @@ -89,7 +92,7 @@ public override bool Execute(GitUIBaseEventArgs e)
#endregion

/// <summary>
/// Automaticly compile all solution files found in any submodule
/// Automatically compile all solution files found in any submodule
/// </summary>
private void GitUiCommandsPostUpdateSubmodules(object sender, GitUIPostActionEventArgs e)
{
Expand Down
2 changes: 1 addition & 1 deletion Plugins/AutoCompileSubmodules/AutoCompileSubmodules.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<Compile Include="..\..\CommonAssemblyInfo.cs">
<Link>Properties\CommonAssemblyInfo.cs</Link>
</Compile>
<Compile Include="AutoCompileSubModules.cs" />
<Compile Include="AutoCompileSubModulesPlugin.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions Plugins/BackgroundFetch/BackgroundFetch.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@
<Name>GitCommands</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\ResourceManager\ResourceManager.csproj">
<Project>{D3440FD7-AFC5-4351-8741-6CDBF15CE944}</Project>
<Name>ResourceManager</Name>
</ProjectReference>
<ProjectReference Include="..\GitUIPluginInterfaces\GitUIPluginInterfaces.csproj">
<Project>{27559302-F35E-4B62-A6EC-11FF21A5FA6F}</Project>
<Name>GitUIPluginInterfaces</Name>
Expand Down
15 changes: 8 additions & 7 deletions Plugins/BackgroundFetch/BackgroundFetchPlugin.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
using System;
using System.Collections.Generic;
using System.Reactive.Concurrency;
using System.Reactive.Linq;
using GitCommands;
using GitUIPluginInterfaces;
using System.Collections.Generic;
using ResourceManager;

namespace BackgroundFetch
{
public class BackgroundFetchPlugin : GitPluginBase, IGitPluginForRepository
{
public BackgroundFetchPlugin()
{
Description = "Periodic background fetch";
Translate();
}

private IDisposable cancellationToken;
private IGitUICommands currentGitUiCommands;

Expand All @@ -26,11 +32,6 @@ public override IEnumerable<ISetting> GetSettings()
yield return FetchAllSubmodules;
}

public override string Description
{
get { return "Periodic background fetch"; }
}

public override void Register(IGitUICommands gitUiCommands)
{
base.Register(gitUiCommands);
Expand Down
Loading

0 comments on commit 8f8393c

Please sign in to comment.