Move lines to resx

This commit is contained in:
L1Q 2021-12-14 17:51:54 +02:00
parent 11996a8bfc
commit a742a66742
13 changed files with 109 additions and 15 deletions

View file

@ -379,7 +379,7 @@ private string OutputStats(HistoryItem[] historyItems)
sb.AppendLine(string.Join(Environment.NewLine, hosts));
sb.AppendLine();
sb.AppendLine("Process names:"); // TODO: Translate
sb.AppendLine(Resources.ProcessNames);
IEnumerable<string> processNames = historyItems.
GroupBy(x => string.IsNullOrWhiteSpace(x.TagsProcessName) ? empty : x.TagsProcessName).
@ -464,8 +464,7 @@ private void tsbToggleMoreInfo_Click(object sender, EventArgs e)
private void tsbShowStats_Click(object sender, EventArgs e)
{
string stats = OutputStats(allHistoryItems);
// TODO: Translate
OutputBox.Show(stats, "History stats");
OutputBox.Show(stats, Resources.HistoryStats);
}
private void tsbSettings_Click(object sender, EventArgs e)

View file

@ -397,6 +397,15 @@ internal class Resources {
}
}
/// <summary>
/// Looks up a localized string similar to History stats.
/// </summary>
internal static string HistoryStats {
get {
return ResourceManager.GetString("HistoryStats", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to File extensions:.
/// </summary>
@ -483,6 +492,15 @@ internal class Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Process names:.
/// </summary>
internal static string ProcessNames {
get {
return ResourceManager.GetString("ProcessNames", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Total.
/// </summary>

View file

@ -259,4 +259,10 @@
<data name="chart" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\chart.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ProcessNames" xml:space="preserve">
<value>Process names:</value>
</data>
<data name="HistoryStats" xml:space="preserve">
<value>History stats</value>
</data>
</root>

View file

@ -100,6 +100,15 @@ internal class Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Auto copy image to clipboard.
/// </summary>
internal static string AutoCopyImageToClipboard {
get {
return ResourceManager.GetString("AutoCopyImageToClipboard", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@ -119,6 +128,15 @@ internal class Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Blur.
/// </summary>
internal static string Blur {
get {
return ResourceManager.GetString("Blur", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@ -651,6 +669,15 @@ internal class Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Highlight.
/// </summary>
internal static string Highlight {
get {
return ResourceManager.GetString("Highlight", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@ -1199,6 +1226,15 @@ internal class Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Pixelate.
/// </summary>
internal static string Pixelate {
get {
return ResourceManager.GetString("Pixelate", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@ -1209,6 +1245,15 @@ internal class Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Processing....
/// </summary>
internal static string Processing {
get {
return ResourceManager.GetString("Processing", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Rectangle capture light.
/// </summary>

View file

@ -777,4 +777,19 @@ X: {4} Y: {5}</value>
<data name="ShapeManager_CreateToolbar_ToolOptions" xml:space="preserve">
<value>Tool options</value>
</data>
<data name="Processing" xml:space="preserve">
<value>Processing...</value>
</data>
<data name="Blur" xml:space="preserve">
<value>Blur</value>
</data>
<data name="Highlight" xml:space="preserve">
<value>Highlight</value>
</data>
<data name="Pixelate" xml:space="preserve">
<value>Pixelate</value>
</data>
<data name="AutoCopyImageToClipboard" xml:space="preserve">
<value>Auto copy image to clipboard</value>
</data>
</root>

View file

@ -24,6 +24,7 @@
#endregion License Information (GPL v3)
using ShareX.HelpersLib;
using ShareX.ScreenCaptureLib.Properties;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Threading.Tasks;
@ -64,8 +65,7 @@ public virtual void OnDraw(Graphics g)
{
if (drawCache && isEffectCaching)
{
// TODO: Translate
OnDrawOverlay(g, "Processing...");
OnDrawOverlay(g, Resources.Processing);
}
else if (drawCache && cachedEffect != null)
{

View file

@ -24,6 +24,7 @@
#endregion License Information (GPL v3)
using ShareX.HelpersLib;
using ShareX.ScreenCaptureLib.Properties;
using System.Drawing;
namespace ShareX.ScreenCaptureLib
@ -32,8 +33,7 @@ public class BlurEffectShape : BaseEffectShape
{
public override ShapeType ShapeType { get; } = ShapeType.EffectBlur;
// TODO: Translate
public override string OverlayText => "Blur" + $" [{BlurRadius}]";
public override string OverlayText => Resources.Blur + $" [{BlurRadius}]";
public int BlurRadius { get; set; }

View file

@ -24,6 +24,7 @@
#endregion License Information (GPL v3)
using ShareX.HelpersLib;
using ShareX.ScreenCaptureLib.Properties;
using System.Drawing;
namespace ShareX.ScreenCaptureLib
@ -32,8 +33,7 @@ public class HighlightEffectShape : BaseEffectShape
{
public override ShapeType ShapeType { get; } = ShapeType.EffectHighlight;
// TODO: Translate
public override string OverlayText => "Highlight";
public override string OverlayText => Resources.Highlight;
public Color HighlightColor { get; set; }

View file

@ -24,6 +24,7 @@
#endregion License Information (GPL v3)
using ShareX.HelpersLib;
using ShareX.ScreenCaptureLib.Properties;
using System.Drawing;
namespace ShareX.ScreenCaptureLib
@ -32,8 +33,7 @@ public class PixelateEffectShape : BaseEffectShape
{
public override ShapeType ShapeType { get; } = ShapeType.EffectPixelate;
// TODO: Translate
public override string OverlayText => "Pixelate" + $" [{PixelSize}]";
public override string OverlayText => Resources.Pixelate + $" [{PixelSize}]";
public int PixelSize { get; set; }

View file

@ -885,8 +885,7 @@ internal void CreateToolbar()
(sender, e) => Options.ImageEditorStartMode = (ImageEditorStartMode)tscbImageEditorStartMode.Content.SelectedIndex;
tsddbOptions.DropDownItems.Add(tscbImageEditorStartMode);
// TODO: Translate
ToolStripMenuItem tsmiEditorAutoCopyImage = new ToolStripMenuItem("Auto copy image to clipboard");
ToolStripMenuItem tsmiEditorAutoCopyImage = new ToolStripMenuItem(Resources.AutoCopyImageToClipboard);
tsmiEditorAutoCopyImage.Checked = Options.EditorAutoCopyImage;
tsmiEditorAutoCopyImage.CheckOnClick = true;
tsmiEditorAutoCopyImage.Click += (sender, e) => Options.EditorAutoCopyImage = tsmiEditorAutoCopyImage.Checked;

View file

@ -24,6 +24,7 @@
#endregion License Information (GPL v3)
using ShareX.HelpersLib;
using ShareX.Properties;
using System;
using System.Diagnostics;
using System.Drawing;
@ -42,8 +43,7 @@ public static bool MakeWindowBorderless(string windowTitle, bool useWorkingArea
if (hWnd == IntPtr.Zero)
{
// TODO: Translate
MessageBox.Show("Unable to find a window with specified window title.", "ShareX", MessageBoxButtons.OK, MessageBoxIcon.Information);
MessageBox.Show(Resources.UnableToFindAWindowWithSpecifiedWindowTitle, "ShareX", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{

View file

@ -2744,6 +2744,15 @@ public class Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Unable to find a window with specified window title..
/// </summary>
public static string UnableToFindAWindowWithSpecifiedWindowTitle {
get {
return ResourceManager.GetString("UnableToFindAWindowWithSpecifiedWindowTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>

View file

@ -1076,4 +1076,7 @@ Please run ShareX as administrator to change personal folder path.</value>
<data name="GitHub" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\github.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="UnableToFindAWindowWithSpecifiedWindowTitle" xml:space="preserve">
<value>Unable to find a window with specified window title.</value>
</data>
</root>