diff --git a/src/Privatezilla/MainWindow.cs b/src/Privatezilla/MainWindow.cs index 350d12a..3b9264d 100644 --- a/src/Privatezilla/MainWindow.cs +++ b/src/Privatezilla/MainWindow.cs @@ -17,27 +17,6 @@ namespace Privatezilla { public partial class MainWindow : Form { - private readonly string _successApply = Properties.Resources.statusSuccessApply; - private readonly string _failedApply = Properties.Resources.statusFailedApply; - private readonly string _successConfigure = Properties.Resources.statusSuccessConfigure; - private readonly string _failedConfigure = Properties.Resources.statusFailedConfigure; - private readonly string _finishApply = Properties.Resources.statusFinishApply; - private readonly string _finishUndo = Properties.Resources.statusFinishUndo; - private readonly string _finishAnalyze = Properties.Resources.statusFinishAnalyze; - private readonly string _doWait = Properties.Resources.statusDoWait; - private readonly string _undoSettings = Properties.Resources.statusUndoSettings; - - private readonly string _helpApp = Properties.Resources.helpApp.Replace("\\r\\n", "\r\n"); - - // Script strings (optional) - private readonly string _psSelect = Properties.Resources.msgPSSelect; - - private readonly string _psInfo = Properties.Resources.PSInfo.Replace("\\r\\n", "\r\n"); - private readonly string _psSuccess = Properties.Resources.msgPSSuccess; - private readonly string _psSave = Properties.Resources.msgPSSave; - - private readonly string _infoApp = "Privatezilla" + "\nVersion " + Program.GetCurrentVersionTostring() + " (Phoenix)\r\n" + - Properties.Resources.infoApp.Replace("\\t", "\t"); // Setting progress private int _progress = 0; @@ -47,9 +26,6 @@ namespace Privatezilla // Update private readonly string _releaseURL = "https://raw.githubusercontent.com/builtbybel/privatezilla/master/latest.txt"; - private readonly string _releaseUpToDate = Properties.Resources.releaseUpToDate; - private readonly string _releaseUnofficial = Properties.Resources.releaseUnofficial; - public Version CurrentVersion = new Version(Application.ProductVersion); public Version LatestVersion; @@ -79,11 +55,11 @@ namespace Privatezilla if (equals == 0) { - MessageBox.Show(_releaseUpToDate, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); // Up-to-date + MessageBox.Show(Properties.Resources.releaseUpToDate, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); // Up-to-date } else if (equals < 0) { - MessageBox.Show(_releaseUnofficial, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); // Unofficial + MessageBox.Show(Properties.Resources.releaseUnofficial, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); // Unofficial } else // New release available! { @@ -119,6 +95,7 @@ namespace Privatezilla public MainWindow() { + InitializeComponent(); // Initilize settings @@ -132,6 +109,8 @@ namespace Privatezilla // GUI localization Globalization(); + + } public void InitializeSettings() @@ -357,7 +336,7 @@ namespace Privatezilla private async void BtnSettingsAnalyze_Click(object sender, EventArgs e) { Reset(); - LblStatus.Text = _doWait; + LblStatus.Text = Properties.Resources.statusDoWait; BtnSettingsAnalyze.Enabled = false; LvwStatus.BeginUpdate(); @@ -374,12 +353,12 @@ namespace Privatezilla if (shouldPerform) { - state.SubItems.Add(_failedConfigure); + state.SubItems.Add(Properties.Resources.statusFailedConfigure); state.BackColor = Color.LavenderBlush; } else { - state.SubItems.Add(_successConfigure); + state.SubItems.Add(Properties.Resources.statusSuccessConfigure); state.BackColor = Color.Honeydew; } @@ -391,7 +370,7 @@ namespace Privatezilla DoProgress(100); // Summary - LblStatus.Text = _finishAnalyze; + LblStatus.Text = Properties.Resources.statusFinishAnalyze; BtnSettingsAnalyze.Enabled = true; LvwStatus.EndUpdate(); @@ -410,7 +389,7 @@ namespace Privatezilla foreach (SettingNode node in treeNodes) { // Add status info - LblStatus.Text = _doWait + " (" + node.Text + ")"; + LblStatus.Text = Properties.Resources.statusDoWait + " (" + node.Text + ")"; var setting = node.Setting; ConfiguredTaskAwaitable performTask = Task.Factory.StartNew(() => setting.DoSetting()).ConfigureAwait(true); @@ -420,12 +399,12 @@ namespace Privatezilla var listItem = new ListViewItem(setting.ID()); if (result) { - listItem.SubItems.Add(_successApply); + listItem.SubItems.Add(Properties.Resources.statusSuccessApply); listItem.BackColor = Color.Honeydew; } else { - listItem.SubItems.Add(_failedApply); + listItem.SubItems.Add(Properties.Resources.statusFailedApply); listItem.BackColor = Color.LavenderBlush; } @@ -435,7 +414,7 @@ namespace Privatezilla DoProgress(100); - LblStatus.Text = _finishApply; + LblStatus.Text = Properties.Resources.statusFinishApply; BtnSettingsDo.Enabled = true; LvwStatus.EndUpdate(); @@ -447,7 +426,7 @@ namespace Privatezilla /// private async void UndoSettings(List treeNodes) { - LblStatus.Text = _doWait; + LblStatus.Text = Properties.Resources.statusDoWait; BtnSettingsUndo.Enabled = false; LvwStatus.BeginUpdate(); @@ -461,12 +440,12 @@ namespace Privatezilla var listItem = new ListViewItem(setting.ID()); if (result) { - listItem.SubItems.Add(_successApply); + listItem.SubItems.Add(Properties.Resources.statusSuccessApply); listItem.BackColor = Color.Honeydew; } else { - listItem.SubItems.Add(_failedApply); + listItem.SubItems.Add(Properties.Resources.statusFailedApply); listItem.BackColor = Color.LavenderBlush; } @@ -476,7 +455,7 @@ namespace Privatezilla DoProgress(100); - LblStatus.Text = _finishUndo; + LblStatus.Text = Properties.Resources.statusFinishUndo; BtnSettingsUndo.Enabled = true; LvwStatus.EndUpdate(); @@ -493,7 +472,7 @@ namespace Privatezilla private void BtnSettingsUndo_Click(object sender, EventArgs e) { - if (MessageBox.Show(_undoSettings, this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2) == DialogResult.Yes) + if (MessageBox.Show(Properties.Resources.statusUndoSettings, this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { Reset(); @@ -504,7 +483,8 @@ namespace Privatezilla private void Info_Click(object sender, EventArgs e) { - MessageBox.Show(_infoApp, "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); + MessageBox.Show("Privatezilla" + "\nVersion " + Program.GetCurrentVersionTostring() + " (Phoenix)\r\n" + + Properties.Resources.infoApp.Replace("\\t", "\t"), "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); } private void LblMainMenu_Click(object sender, EventArgs e) @@ -514,7 +494,7 @@ namespace Privatezilla private void Help_Click(object sender, EventArgs e) { - MessageBox.Show(_helpApp, Help.Text, MessageBoxButtons.OK, MessageBoxIcon.Question); + MessageBox.Show(Properties.Resources.helpApp.Replace("\\r\\n", "\r\n"), Help.Text, MessageBoxButtons.OK, MessageBoxIcon.Question); } /// @@ -596,7 +576,7 @@ namespace Privatezilla TxtConsolePS.Text = content.ToString(); // View Info - TxtPSInfo.Text = _psInfo + string.Join(Environment.NewLine, System.IO.File.ReadAllLines(psdir).Where(s => s.StartsWith("###")).Select(s => s.Substring(3).Replace("###", "\r\n\n"))); + TxtPSInfo.Text = Properties.Resources.PSInfo.Replace("\\r\\n", "\r\n") + string.Join(Environment.NewLine, System.IO.File.ReadAllLines(psdir).Where(s => s.StartsWith("###")).Select(s => s.Substring(3).Replace("###", "\r\n\n"))); } } catch { } @@ -609,7 +589,7 @@ namespace Privatezilla { if (LstPS.CheckedItems.Count == 0) { - MessageBox.Show(_psSelect, BtnDoPS.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); + MessageBox.Show(Properties.Resources.msgPSSelect, BtnDoPS.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); } for (int i = 0; i < LstPS.Items.Count; i++) @@ -637,7 +617,7 @@ namespace Privatezilla } // Done! - MessageBox.Show("Script " + "\"" + LstPS.Text + "\" " + _psSuccess, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); + MessageBox.Show("Script " + "\"" + LstPS.Text + "\" " + Properties.Resources.msgPSSuccess, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); } } } @@ -702,7 +682,7 @@ namespace Privatezilla { if (ChkCodePS.Checked == false) { - MessageBox.Show(_psSave, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); + MessageBox.Show(Properties.Resources.msgPSSave, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); } else { diff --git a/src/Privatezilla/Privatezilla.csproj b/src/Privatezilla/Privatezilla.csproj index a638349..195e194 100644 --- a/src/Privatezilla/Privatezilla.csproj +++ b/src/Privatezilla/Privatezilla.csproj @@ -162,6 +162,7 @@ Resources.resx True + SettingsSingleFileGenerator diff --git a/src/Privatezilla/Properties/AssemblyInfo.cs b/src/Privatezilla/Properties/AssemblyInfo.cs index e8d4da5..316516f 100644 --- a/src/Privatezilla/Properties/AssemblyInfo.cs +++ b/src/Privatezilla/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, // indem Sie "*" wie unten gezeigt eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.40.0")] -[assembly: AssemblyFileVersion("0.40.0")] +[assembly: AssemblyVersion("0.40.1")] +[assembly: AssemblyFileVersion("0.40.1")] diff --git a/src/Privatezilla/Properties/Resources.Designer.cs b/src/Privatezilla/Properties/Resources.Designer.cs index e26ddb8..c87d960 100644 --- a/src/Privatezilla/Properties/Resources.Designer.cs +++ b/src/Privatezilla/Properties/Resources.Designer.cs @@ -1471,7 +1471,7 @@ namespace Privatezilla.Properties { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Do you really want to revert all selected settings to Windows 10 default state?" ähnelt. + /// Sucht eine lokalisierte Zeichenfolge, die Do you really want to revert all selected settings to Windows 10 default state? ähnelt. /// internal static string statusUndoSettings { get { diff --git a/src/Privatezilla/Properties/Resources.resx b/src/Privatezilla/Properties/Resources.resx index bf1c1ae..b1a3da1 100644 --- a/src/Privatezilla/Properties/Resources.resx +++ b/src/Privatezilla/Properties/Resources.resx @@ -718,7 +718,7 @@ You can also follow me on Configured - Do you really want to revert all selected settings to Windows 10 default state?" + Do you really want to revert all selected settings to Windows 10 default state? Welcome to the Modern Policy Editor, which allows you to apply group policies and custom settings in the form of PowerShell scripts and templates (bundled scripts). diff --git a/src/Privatezilla/Properties/Resources.zh-CN.resx b/src/Privatezilla/Properties/Resources.zh-CN.resx index 77a6d08..7a1d622 100644 --- a/src/Privatezilla/Properties/Resources.zh-CN.resx +++ b/src/Privatezilla/Properties/Resources.zh-CN.resx @@ -59,46 +59,46 @@ : using a System.ComponentModel.TypeConverter : and then encoded with base64 encoding. --> - - + + - + - - - - + + + + - - + + - - + + - - - - + + + + - + - + @@ -591,9 +591,6 @@ 处理中 - - 您真的想要将所有选定的设置还原到 Windows 10 默认状态吗? - 请稍候... @@ -618,6 +615,9 @@ 已配置 + + 您真的想要将所有选定的设置还原到 Windows 10 默认状态吗? + 欢迎使用现代政策编辑器,它将允许您以 PowerShell 脚本和模板(捆绑脚本)的形式应用组策略和自定义设置