Skip to content

Commit 2086e73

Browse files
authored
Merge pull request #443 from LogExperts/224-multi-language-translation
With this MR the Logexpert supports Multi-Language Translation for the User Interface. Currently following languages are supported: - en-US (englisch) - de-DE (german) New language can be added, by creating a Resources.XX.resx (Resources.de.resx = German), after that the easiest way to edit the keys is to use ResXResourceManager (https://github.com/dotnet/ResXResourceManager). In the Settings Dialog the language can be selected, and needs to be added if a new language has been approved via MR.
2 parents 5d08378 + 7534a30 commit 2086e73

File tree

107 files changed

+15093
-2601
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+15093
-2601
lines changed

TODOs.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

build/Build.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ partial class Build : NukeBuild
3434
/// - JetBrains Rider https://nuke.build/rider
3535
/// - Microsoft VisualStudio https://nuke.build/visualstudio
3636
/// - Microsoft VSCode https://nuke.build/vscode
37-
public static int Main() => Execute<Build>(x => x.Test);
37+
public static int Main () => Execute<Build>(x => x.Test);
3838

3939
[Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")]
4040
readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release;
@@ -78,7 +78,7 @@ Version Version
7878
patch = AppVeyor.Instance.BuildNumber;
7979
}
8080

81-
return new Version(1, 12, 0, patch);
81+
return new Version(1, 20, 0, patch);
8282
}
8383
}
8484

@@ -119,7 +119,7 @@ Version Version
119119
ChocolateyDirectory / $"logexpert.{VersionString}.nupkg"
120120
];
121121

122-
protected override void OnBuildInitialized()
122+
protected override void OnBuildInitialized ()
123123
{
124124
SetVariable("DOTNET_CLI_TELEMETRY_OPTOUT", "1");
125125

@@ -479,7 +479,7 @@ protected override void OnBuildInitialized()
479479
logExpertDocuments.DeleteDirectory();
480480
});
481481

482-
private void ExecuteInnoSetup(AbsolutePath innoPath)
482+
private void ExecuteInnoSetup (AbsolutePath innoPath)
483483
{
484484
Process proc = new();
485485

@@ -501,12 +501,12 @@ private void ExecuteInnoSetup(AbsolutePath innoPath)
501501
}
502502
}
503503

504-
private string ReplaceVersionMatch(Match match, string replacement)
504+
private string ReplaceVersionMatch (Match match, string replacement)
505505
{
506506
return $"{match.Groups[1]}{replacement}{match.Groups[3]}";
507507
}
508508

509-
private void TransformTemplateFile(AbsolutePath path, bool deleteTemplate)
509+
private void TransformTemplateFile (AbsolutePath path, bool deleteTemplate)
510510
{
511511
string text = path.ReadAllText();
512512
text = text.Replace("##version##", VersionString);
@@ -520,17 +520,17 @@ private void TransformTemplateFile(AbsolutePath path, bool deleteTemplate)
520520
}
521521

522522
[GeneratedRegex(@"(\[assembly: AssemblyInformationalVersion\("")([^""]*)(""\)\])")]
523-
private static partial Regex AssemblyInformationalVersion();
523+
private static partial Regex AssemblyInformationalVersion ();
524524

525525
[GeneratedRegex(@"(\[assembly: AssemblyVersion\("")([^""]*)(""\)\])")]
526-
private static partial Regex AssemblyVersion();
526+
private static partial Regex AssemblyVersion ();
527527

528528
[GeneratedRegex(@"(\[assembly: AssemblyConfiguration\()(""[^""]*"")(\)\])")]
529-
private static partial Regex AssemblyConfiguration();
529+
private static partial Regex AssemblyConfiguration ();
530530

531531
[GeneratedRegex(@"(\[assembly: AssemblyFileVersion\("")([^""]*)(""\)\])")]
532-
private static partial Regex AssemblyFileVersion();
532+
private static partial Regex AssemblyFileVersion ();
533533

534534
[GeneratedRegex(@"\w\w{2}[_]p?[tso]?[erzliasx]+[_rhe]{5}", RegexOptions.IgnoreCase, "en-GB")]
535-
private static partial Regex SFTPPlugin();
535+
private static partial Regex SFTPPlugin ();
536536
}

src/ColumnizerLib/ColumnizerLib.nuspec

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,18 @@
66
<title>LogExpert ColumnizerLib</title>
77
<authors>Zarunbal, Hagen Raab, Hirogen, RandallFlagg and others</authors>
88
<owners>Zarunbal, Hirogen</owners>
9-
<license>MIT</license>
10-
<projectUrl>https://github.com/LogExperts/LogExpert</projectUrl>
9+
<license type="MIT"></license>
10+
<projectUrl url="https://github.com/LogExperts/LogExpert">https://github.com/LogExperts/LogExpert</projectUrl>
11+
<repository type="git" url="https://github.com/LogExperts/LogExpert"></repository>
1112
<requireLicenseAcceptance>false</requireLicenseAcceptance>
1213
<bugTrackerUrl>https://github.com/LogExperts/LogExpert/issues</bugTrackerUrl>
13-
<releaseNotes>https://github.com/LogExperts/LogExpert/releases/tag/v$version$</releaseNotes>
14+
<releaseNotes>https://github.com/LogExperts/LogExpert/releases/tag/v.$version$</releaseNotes>
1415
<description>Columnizer Lib for Logexpert plugins</description>
16+
<readme>docs\README.md</readme>
1517
<copyright>Copyright 2025</copyright>
1618
<tags>LogExpert Columnizer</tags>
1719
</metadata>
20+
<files>
21+
<file src="..\..\README.md" target="docs\"></file>
22+
</files>
1823
</package>

src/ColumnizerLib/IContextMenuEntry.cs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
using System.Collections.Generic;
2-
3-
41
namespace LogExpert;
52

63
/// <summary>
@@ -21,7 +18,7 @@ public interface IContextMenuEntry
2118
/// Your implementation can control whether LogExpert will show a menu entry by returning
2219
/// an appropriate value.<br></br>
2320
/// </summary>
24-
/// <param name="lines">A list containing all selected line numbers.</param>
21+
/// <param name="loglines">A list containing all selected line numbers.</param>
2522
/// <param name="columnizer">The currently selected Columnizer. You can use it to split log lines,
2623
/// if necessary.</param>
2724
/// <param name="callback">The callback interface implemented by LogExpert. You can use the functions
@@ -35,23 +32,23 @@ public interface IContextMenuEntry
3532
/// <li>null: No menu entry is displayed.</li>
3633
/// </ul>
3734
/// </returns>
38-
string GetMenuText(IList<int> lines, ILogLineColumnizer columnizer, ILogExpertCallback callback);
35+
string GetMenuText (IList<int> loglines, ILogLineColumnizer columnizer, ILogExpertCallback callback);
3936

40-
string GetMenuText(int linesCount, ILogLineColumnizer columnizer, ILogLine line);
37+
string GetMenuText (int linesCount, ILogLineColumnizer columnizer, ILogLine logline);
4138

4239

4340
/// <summary>
4441
/// This function is called from LogExpert if the menu entry is choosen by the user. <br></br>
4542
/// Note that this function is called from the GUI thread. So try to avoid time consuming operations.
4643
/// </summary>
47-
/// <param name="lines">A list containing all selected line numbers.</param>
44+
/// <param name="loglines">A list containing all selected line numbers.</param>
4845
/// <param name="columnizer">The currently selected Columnizer. You can use it to split log lines,
4946
/// if necessary.</param>
5047
/// <param name="callback">The callback interface implemented by LogExpert. You can use the functions
5148
/// for retrieving log lines or pass it along to functions of the Columnizer if needed.</param>
52-
void MenuSelected(IList<int> lines, ILogLineColumnizer columnizer, ILogExpertCallback callback);
49+
void MenuSelected (IList<int> loglines, ILogLineColumnizer columnizer, ILogExpertCallback callback);
5350

54-
void MenuSelected(int linesCount, ILogLineColumnizer columnizer, ILogLine line);
51+
void MenuSelected (int linesCount, ILogLineColumnizer columnizer, ILogLine logline);
5552

5653
#endregion
5754
}

src/CsvColumnizer/CsvColumnizer.csproj

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,24 @@
1919
<PackageReference Include="Newtonsoft.Json" />
2020
</ItemGroup>
2121

22+
<ItemGroup>
23+
<EmbeddedResource Update="Resources.resx">
24+
<Generator>PublicResXFileCodeGenerator</Generator>
25+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
26+
<CustomToolNamespace>CsvColumnizer</CustomToolNamespace>
27+
</EmbeddedResource>
28+
29+
<EmbeddedResource Update="Resources.de.resx">
30+
<DependentUpon>Resources.resx</DependentUpon>
31+
</EmbeddedResource>
32+
</ItemGroup>
33+
34+
<ItemGroup>
35+
<Compile Update="Resources.Designer.cs">
36+
<DesignTime>True</DesignTime>
37+
<AutoGen>True</AutoGen>
38+
<DependentUpon>Resources.resx</DependentUpon>
39+
</Compile>
40+
</ItemGroup>
41+
2242
</Project>

src/CsvColumnizer/CsvColumnizerConfigDlg.cs

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
using System;
2-
using System.Drawing;
3-
using System.Windows.Forms;
4-
51
namespace CsvColumnizer;
62

73
public partial class CsvColumnizerConfigDlg : Form
@@ -14,23 +10,41 @@ public partial class CsvColumnizerConfigDlg : Form
1410

1511
#region cTor
1612

17-
public CsvColumnizerConfigDlg(CsvColumnizerConfig config)
13+
public CsvColumnizerConfigDlg (CsvColumnizerConfig config)
1814
{
1915
SuspendLayout();
2016
AutoScaleDimensions = new SizeF(96F, 96F);
2117
AutoScaleMode = AutoScaleMode.Dpi;
2218

2319
_config = config;
2420
InitializeComponent();
21+
22+
ApplyResources();
23+
2524
FillValues();
2625
ResumeLayout();
2726
}
2827

28+
private void ApplyResources ()
29+
{
30+
Text = Resources.CsvColumnizerConfigDlg_UI_Title;
31+
label1.Text = Resources.CsvColumnizerConfigDlg_UI_Label_DelimiterChar;
32+
labelQuoteChar.Text = Resources.CsvColumnizerConfigDlg_UI_Label_QuoteChar;
33+
labelEscapeChar.Text = Resources.CsvColumnizerConfigDlg_UI_Label_EscapeChar;
34+
checkBoxEscape.Text = Resources.CsvColumnizerConfigDlg_UI_CheckBox_UseEscapeChars;
35+
labelCommentChar.Text = Resources.CsvColumnizerConfigDlg_UI_Label_CommentChar;
36+
labelMinColumns.Text = Resources.CsvColumnizerConfigDlg_UI_Label_MinColumns;
37+
labelMinColumnsNoCheck.Text = Resources.CsvColumnizerConfigDlg_UI_Label_MinColumnsInfo;
38+
checkBoxFieldNames.Text = Resources.CsvColumnizerConfigDlg_UI_CheckBox_FirstLineFieldNames;
39+
okButton.Text = Resources.CsvColumnizerConfigDlg_UI_Button_OK;
40+
cancelButton.Text = Resources.CsvColumnizerConfigDlg_UI_Button_Cancel;
41+
}
42+
2943
#endregion
3044

3145
#region Private Methods
3246

33-
private void FillValues()
47+
private void FillValues ()
3448
{
3549
delimiterTextBox.Text = _config.DelimiterChar;
3650
textBoxQuoteChar.Text = _config.QuoteChar.ToString();
@@ -42,7 +56,7 @@ private void FillValues()
4256
numericUpDownMinColumns.Value = _config.MinColumns;
4357
}
4458

45-
private void RetrieveValues()
59+
private void RetrieveValues ()
4660
{
4761
_config.DelimiterChar = delimiterTextBox.Text;
4862
_config.QuoteChar = textBoxQuoteChar.Text[0];
@@ -56,12 +70,12 @@ private void RetrieveValues()
5670

5771
#region Events handler
5872

59-
private void OnOkButtonClick(object sender, EventArgs e)
73+
private void OnOkButtonClick (object sender, EventArgs e)
6074
{
6175
RetrieveValues();
6276
}
6377

64-
private void OnEscapeCheckBoxCheckedChanged(object sender, EventArgs e)
78+
private void OnEscapeCheckBoxCheckedChanged (object sender, EventArgs e)
6579
{
6680
textboxEscapeChar.Enabled = checkBoxEscape.Checked;
6781
}

0 commit comments

Comments
 (0)