From ca2d024d7c5874adf0ae148e47ffddc132ba440a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omelette=20=E8=9B=8B=E5=8D=B7?= Date: Thu, 28 Dec 2023 16:19:43 -0500 Subject: [PATCH 1/7] cn-2.0.9.1 --- DCS-SR-Client/App.xaml.cs | 2 +- DCS-SR-Client/Properties/Resources.zh-CN.resx | 6 ++++++ DCS-SR-Common/Network/UpdaterChecker.cs | 2 +- Installer/App.xaml.cs | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/DCS-SR-Client/App.xaml.cs b/DCS-SR-Client/App.xaml.cs index 3c0c70662..c37a71bc9 100644 --- a/DCS-SR-Client/App.xaml.cs +++ b/DCS-SR-Client/App.xaml.cs @@ -30,7 +30,7 @@ public partial class App : Application public App() { - //Thread.CurrentThread.CurrentUICulture = new CultureInfo("zh-CN"); + Thread.CurrentThread.CurrentUICulture = new CultureInfo("zh-CN"); SentrySdk.Init("https://1b22a96cbcc34ee4b9db85c7fa3fe4e3@o414743.ingest.sentry.io/5304752"); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(UnhandledExceptionHandler); diff --git a/DCS-SR-Client/Properties/Resources.zh-CN.resx b/DCS-SR-Client/Properties/Resources.zh-CN.resx index 4d47f9c2b..35e98932f 100644 --- a/DCS-SR-Client/Properties/Resources.zh-CN.resx +++ b/DCS-SR-Client/Properties/Resources.zh-CN.resx @@ -138,6 +138,12 @@ 始终允许浮窗应答机控制 + + 启用座舱环境音效 + + + 座舱环境音效音量 + 音频 diff --git a/DCS-SR-Common/Network/UpdaterChecker.cs b/DCS-SR-Common/Network/UpdaterChecker.cs index cb694f4ed..462850be0 100644 --- a/DCS-SR-Common/Network/UpdaterChecker.cs +++ b/DCS-SR-Common/Network/UpdaterChecker.cs @@ -100,7 +100,7 @@ public static async void CheckForUpdate(bool checkForBetaUpdates) public static void ShowUpdateAvailableDialog(string branch, Version version, string url, bool beta) { - //Thread.CurrentThread.CurrentUICulture = new CultureInfo("zh-CN"); + Thread.CurrentThread.CurrentUICulture = new CultureInfo("zh-CN"); _logger.Warn($"New {branch} version available on GitHub: {version}"); var result = MessageBox.Show($"{Properties.Resources.MsgBoxUpdate1} {branch} {Properties.Resources.MsgBoxUpdate2} {version} {Properties.Resources.MsgBoxUpdate3}\n\n{Properties.Resources.MsgBoxUpdate4}", diff --git a/Installer/App.xaml.cs b/Installer/App.xaml.cs index 6bc5d6e84..0f7545a77 100644 --- a/Installer/App.xaml.cs +++ b/Installer/App.xaml.cs @@ -16,7 +16,7 @@ public partial class App : Application public string[] Arguments = new string[0]; private void ApplicationStartup(object sender, StartupEventArgs e) { - //Thread.CurrentThread.CurrentUICulture = new CultureInfo("zh-CN"); + Thread.CurrentThread.CurrentUICulture = new CultureInfo("zh-CN"); if (e.Args.Length > 0) { Arguments = e.Args; From e3d338bef16d592b845cf91de684af64b6bae0e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omelette=20=E8=9B=8B=E5=8D=B7?= Date: Thu, 28 Dec 2023 18:27:24 -0500 Subject: [PATCH 2/7] cn-2.1.0.1: Server localization --- .../DCS-SimpleRadio Server.csproj | 11 +- .../Properties/Resources.Designer.cs | 343 +++++++++++++++++- .../Properties/Resources.resx | 111 ++++++ .../Properties/Resources.zh-CN.Designer.cs | 0 .../Properties/Resources.zh-CN.resx | 235 ++++++++++++ .../UI/ClientAdmin/ClientAdminViewModel.cs | 5 +- .../UI/ClientAdmin/ClientView.xaml | 7 +- .../UI/ClientAdmin/ClientViewModel.cs | 3 + .../UI/MainWindow/MainView.xaml | 53 +-- .../UI/MainWindow/MainViewModel.cs | 81 +++-- Installer/Installer.csproj | 1 + 11 files changed, 775 insertions(+), 75 deletions(-) create mode 100644 DCS-SimpleRadio Server/Properties/Resources.zh-CN.Designer.cs create mode 100644 DCS-SimpleRadio Server/Properties/Resources.zh-CN.resx diff --git a/DCS-SimpleRadio Server/DCS-SimpleRadio Server.csproj b/DCS-SimpleRadio Server/DCS-SimpleRadio Server.csproj index 26f0c8738..4657a5e54 100644 --- a/DCS-SimpleRadio Server/DCS-SimpleRadio Server.csproj +++ b/DCS-SimpleRadio Server/DCS-SimpleRadio Server.csproj @@ -369,6 +369,11 @@ + + Resources.zh-CN.resx + True + True + @@ -403,8 +408,12 @@ Settings.settings True + + PublicResXFileCodeGenerator + Resources.zh-CN.Designer.cs + - ResXFileCodeGenerator + PublicResXFileCodeGenerator Resources.Designer.cs diff --git a/DCS-SimpleRadio Server/Properties/Resources.Designer.cs b/DCS-SimpleRadio Server/Properties/Resources.Designer.cs index 5f296b2f7..b1a8f86d3 100644 --- a/DCS-SimpleRadio Server/Properties/Resources.Designer.cs +++ b/DCS-SimpleRadio Server/Properties/Resources.Designer.cs @@ -19,10 +19,10 @@ namespace Ciribob.DCS.SimpleRadio.Standalone.Server.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { + public class Resources { private static global::System.Resources.ResourceManager resourceMan; @@ -36,7 +36,7 @@ internal Resources() { /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { + public static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Ciribob.DCS.SimpleRadio.Standalone.Server.Properties.Resources", typeof(Resources).Assembly); @@ -51,7 +51,7 @@ internal Resources() { /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { + public static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } @@ -60,14 +60,347 @@ internal Resources() { } } + /// + /// Looks up a localized string similar to Ban!. + /// + public static string BtnBan { + get { + return ResourceManager.GetString("BtnBan", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Client Admin. + /// + public static string BtnClientAdmin { + get { + return ResourceManager.GetString("BtnClientAdmin", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to DISABLED. + /// + public static string BtnDisabled { + get { + return ResourceManager.GetString("BtnDisabled", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ENABLED. + /// + public static string BtnEnabled { + get { + return ResourceManager.GetString("BtnEnabled", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Kick. + /// + public static string BtnKick { + get { + return ResourceManager.GetString("BtnKick", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mute. + /// + public static string BtnMute { + get { + return ResourceManager.GetString("BtnMute", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to OFF. + /// + public static string BtnOff { + get { + return ResourceManager.GetString("BtnOff", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ON. + /// + public static string BtnOn { + get { + return ResourceManager.GetString("BtnOn", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Start Server. + /// + public static string BtnStartServer { + get { + return ResourceManager.GetString("BtnStartServer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stop Server. + /// + public static string BtnStopServer { + get { + return ResourceManager.GetString("BtnStopServer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Transmission Archive Time. + /// + public static string LabelArchiveTime { + get { + return ResourceManager.GetString("LabelArchiveTime", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Check for beta updates. + /// + public static string LabelCheckBetaUpdates { + get { + return ResourceManager.GetString("LabelCheckBetaUpdates", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Clients:. + /// + public static string LabelClients { + get { + return ResourceManager.GetString("LabelClients", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Distance Limit. + /// + public static string LabelDistanceLimit { + get { + return ResourceManager.GetString("LabelDistanceLimit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Auto Export List. + /// + public static string LabelExportList { + get { + return ResourceManager.GetString("LabelExportList", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to External AWACS Mode (EAM). + /// + public static string LabelExternalAWACS { + get { + return ResourceManager.GetString("LabelExternalAWACS", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to EAM blue coal. password. + /// + public static string LabelExternalAWACSBluePass { + get { + return ResourceManager.GetString("LabelExternalAWACSBluePass", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to EAM red coal. password. + /// + public static string LabelExternalAWACSRedPass { + get { + return ResourceManager.GetString("LabelExternalAWACSRedPass", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Global Lobby Freq. AM (MHz). + /// + public static string LabelGlobalLobbyFreq { + get { + return ResourceManager.GetString("LabelGlobalLobbyFreq", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Line of Sight. + /// + public static string LabelLOS { + get { + return ResourceManager.GetString("LabelLOS", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to LotATC Transponder Export. + /// + public static string LabelLotATCExport { + get { + return ResourceManager.GetString("LabelLotATCExport", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ignore Radio Effect on Global Freq. + /// + public static string LabelOverrideEffectsOnGlobal { + get { + return ResourceManager.GetString("LabelOverrideEffectsOnGlobal", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Port:. + /// + public static string LabelPort { + get { + return ResourceManager.GetString("LabelPort", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Allow Radio Encryption. + /// + public static string LabelRadioEncryption { + get { + return ResourceManager.GetString("LabelRadioEncryption", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Radio Expansion. + /// + public static string LabelRadioExpansion { + get { + return ResourceManager.GetString("LabelRadioExpansion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to IRL Radio Rx Behaviour. + /// + public static string LabelRealRx { + get { + return ResourceManager.GetString("LabelRealRx", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to IRL Radio Tx Behaviour. + /// + public static string LabelRealTx { + get { + return ResourceManager.GetString("LabelRealTx", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Retransmit Hop/Node Count. + /// + public static string LabelRetransmitNodeLimit { + get { + return ResourceManager.GetString("LabelRetransmitNodeLimit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Secure Coalition Radios. + /// + public static string LabelSecurity { + get { + return ResourceManager.GetString("LabelSecurity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show Transmitter Name. + /// + public static string LabelShowTransmitterName { + get { + return ResourceManager.GetString("LabelShowTransmitterName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Spectator Audio. + /// + public static string LabelSpectator { + get { + return ResourceManager.GetString("LabelSpectator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Strict Radio Encryption. + /// + public static string LabelStrictEncryption { + get { + return ResourceManager.GetString("LabelStrictEncryption", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test Frequencies AM (MHz). + /// + public static string LabelTestFreq { + get { + return ResourceManager.GetString("LabelTestFreq", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Log Received Transmissions. + /// + public static string LabelTransmissionLog { + get { + return ResourceManager.GetString("LabelTransmissionLog", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show Tuned/Client Count. + /// + public static string LabelTunedCount { + get { + return ResourceManager.GetString("LabelTunedCount", resourceCulture); + } + } + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// - internal static System.Drawing.Icon server_10 { + public static System.Drawing.Icon server_10 { get { object obj = ResourceManager.GetObject("server_10", resourceCulture); return ((System.Drawing.Icon)(obj)); } } + + /// + /// Looks up a localized string similar to SR Client List. + /// + public static string TitleClientList { + get { + return ResourceManager.GetString("TitleClientList", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to DCS-SRS Server. + /// + public static string TitleServer { + get { + return ResourceManager.GetString("TitleServer", resourceCulture); + } + } } } diff --git a/DCS-SimpleRadio Server/Properties/Resources.resx b/DCS-SimpleRadio Server/Properties/Resources.resx index 36b99bd13..e161b3aee 100644 --- a/DCS-SimpleRadio Server/Properties/Resources.resx +++ b/DCS-SimpleRadio Server/Properties/Resources.resx @@ -117,8 +117,119 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Ban! + + + Client Admin + + + DISABLED + + + ENABLED + + + Kick + + + Mute + + + OFF + + + ON + + + Start Server + + + Stop Server + + + Transmission Archive Time + + + Check for beta updates + + + Clients: + + + Distance Limit + + + Auto Export List + + + External AWACS Mode (EAM) + + + EAM blue coal. password + + + EAM red coal. password + + + Global Lobby Freq. AM (MHz) + + + Line of Sight + + + LotATC Transponder Export + + + Ignore Radio Effect on Global Freq + + + Port: + + + Allow Radio Encryption + + + Radio Expansion + + + IRL Radio Rx Behaviour + + + IRL Radio Tx Behaviour + + + Retransmit Hop/Node Count + + + Secure Coalition Radios + + + Show Transmitter Name + + + Spectator Audio + + + Strict Radio Encryption + + + Test Frequencies AM (MHz) + + + Log Received Transmissions + + + Show Tuned/Client Count + ..\server-10.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + SR Client List + + + DCS-SRS Server + \ No newline at end of file diff --git a/DCS-SimpleRadio Server/Properties/Resources.zh-CN.Designer.cs b/DCS-SimpleRadio Server/Properties/Resources.zh-CN.Designer.cs new file mode 100644 index 000000000..e69de29bb diff --git a/DCS-SimpleRadio Server/Properties/Resources.zh-CN.resx b/DCS-SimpleRadio Server/Properties/Resources.zh-CN.resx new file mode 100644 index 000000000..da78939fc --- /dev/null +++ b/DCS-SimpleRadio Server/Properties/Resources.zh-CN.resx @@ -0,0 +1,235 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 封禁 + + + 客户端管理 + + + + + + + + + 踢出 + + + 静音 + + + + + + + + + 开始服务器 + + + 停止服务器 + + + 传输存档时间 + + + 检查Beta版更新 + + + 客户端: + + + 传输距离限制 + + + 自动导出列表 + + + 外部预警机模式 (EAM) + + + EAM蓝方密码 + + + EAM红方密码 + + + 全局大厅频率 AM (MHz) + + + 地形遮挡检测 + + + LotATC应答机导出 + + + 大厅无视无线电效果 + + + 端口: + + + 允许无线电加密 + + + 扩展无线电 + + + 真实无线电接收 + + + 真实无线电发送 + + + 转发节点数限制 + + + 保护阵营无线电 + + + 显示发送者名字 + + + 观众席语音 + + + 严格无线电加密 + + + 自我测试频率 AM (MHz) + + + 记录收到的传输 + + + 显示同频人数 + + + + ..\server-10.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + SRS 客户端列表 + + + DCS-SRS 服务器 + + \ No newline at end of file diff --git a/DCS-SimpleRadio Server/UI/ClientAdmin/ClientAdminViewModel.cs b/DCS-SimpleRadio Server/UI/ClientAdmin/ClientAdminViewModel.cs index ce849cbfb..0ce2f7502 100644 --- a/DCS-SimpleRadio Server/UI/ClientAdmin/ClientAdminViewModel.cs +++ b/DCS-SimpleRadio Server/UI/ClientAdmin/ClientAdminViewModel.cs @@ -1,5 +1,7 @@ using System; using System.Collections.ObjectModel; +using System.Globalization; +using System.Threading; using System.Windows.Threading; using Caliburn.Micro; using Ciribob.DCS.SimpleRadio.Standalone.Server.Network; @@ -18,10 +20,11 @@ public sealed class ClientAdminViewModel : Screen, IHandle public ClientAdminViewModel(IEventAggregator eventAggregator) { + Thread.CurrentThread.CurrentUICulture = new CultureInfo("zh-CN"); _eventAggregator = eventAggregator; _eventAggregator.Subscribe(this); - DisplayName = "SR Client List"; + DisplayName = $"{Properties.Resources.TitleClientList}"; _updateTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(200) }; _updateTimer.Tick += _updateTimer_Tick; diff --git a/DCS-SimpleRadio Server/UI/ClientAdmin/ClientView.xaml b/DCS-SimpleRadio Server/UI/ClientAdmin/ClientView.xaml index 43af13420..485013d14 100644 --- a/DCS-SimpleRadio Server/UI/ClientAdmin/ClientView.xaml +++ b/DCS-SimpleRadio Server/UI/ClientAdmin/ClientView.xaml @@ -3,6 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:p="clr-namespace:Ciribob.DCS.SimpleRadio.Standalone.Server.Properties" Width="400" mc:Ignorable="d"> @@ -27,16 +28,16 @@ Width="28" Margin="2,0,4,0" VerticalAlignment="Center" - Content="Kick" /> + Content="{x:Static p:Resources.BtnKick}" />