diff --git a/MetaforceInstaller.UI/App.axaml.cs b/MetaforceInstaller.UI/App.axaml.cs index fc9da21..38eec17 100644 --- a/MetaforceInstaller.UI/App.axaml.cs +++ b/MetaforceInstaller.UI/App.axaml.cs @@ -14,6 +14,7 @@ public partial class App : Application public override void OnFrameworkInitializationCompleted() { + Lang.Resources.Culture = System.Globalization.CultureInfo.CurrentCulture; if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) { desktop.MainWindow = new MainWindow(); diff --git a/MetaforceInstaller.UI/Lang/Resources.Designer.cs b/MetaforceInstaller.UI/Lang/Resources.Designer.cs new file mode 100644 index 0000000..a61e233 --- /dev/null +++ b/MetaforceInstaller.UI/Lang/Resources.Designer.cs @@ -0,0 +1,251 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace MetaforceInstaller.UI.Lang { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // 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", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MetaforceInstaller.UI.Lang.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Add new installation. + /// + public static string AddInstallation { + get { + return ResourceManager.GetString("AddInstallation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cancel. + /// + public static string CancelButton { + get { + return ResourceManager.GetString("CancelButton", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Choose .zip. + /// + public static string ChooseZip { + get { + return ResourceManager.GetString("ChooseZip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Connected to. + /// + public static string ConnectedTo { + get { + return ResourceManager.GetString("ConnectedTo", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Delete. + /// + public static string Delete { + get { + return ResourceManager.GetString("Delete", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Install admin. + /// + public static string InstallAdminCheckbox { + get { + return ResourceManager.GetString("InstallAdminCheckbox", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Install Android admin. + /// + public static string InstallAndroidAdmin { + get { + return ResourceManager.GetString("InstallAndroidAdmin", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Install. + /// + public static string InstallButton { + get { + return ResourceManager.GetString("InstallButton", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Install server. + /// + public static string InstallServerCheckbox { + get { + return ResourceManager.GetString("InstallServerCheckbox", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Install VR client. + /// + public static string InstallVRClient { + get { + return ResourceManager.GetString("InstallVRClient", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Launch PC admin. + /// + public static string LaunchPCAdmin { + get { + return ResourceManager.GetString("LaunchPCAdmin", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Launch server. + /// + public static string LaunchServer { + get { + return ResourceManager.GetString("LaunchServer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Name of new installation. + /// + public static string NameOfNewInstallation { + get { + return ResourceManager.GetString("NameOfNewInstallation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Couldn't find Android content. + /// + public static string NoAndroidContentError { + get { + return ResourceManager.GetString("NoAndroidContentError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Couldn't find directory with PC admin. + /// + public static string NoPCAdminError { + get { + return ResourceManager.GetString("NoPCAdminError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Couldn't find directory with server. + /// + public static string NoServerError { + get { + return ResourceManager.GetString("NoServerError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Not connected. + /// + public static string NotConnected { + get { + return ResourceManager.GetString("NotConnected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Couldn't find any VR clients. + /// + public static string NoVRClientsError { + get { + return ResourceManager.GetString("NoVRClientsError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Couldn't find Windows content. + /// + public static string NoWindowsContentError { + get { + return ResourceManager.GetString("NoWindowsContentError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Save Android admin. + /// + public static string SaveAndroidAdminCheckbox { + get { + return ResourceManager.GetString("SaveAndroidAdminCheckbox", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Save VR client. + /// + public static string SaveVRClientCheckbox { + get { + return ResourceManager.GetString("SaveVRClientCheckbox", resourceCulture); + } + } + } +} diff --git a/MetaforceInstaller.UI/Lang/Resources.resx b/MetaforceInstaller.UI/Lang/Resources.resx new file mode 100644 index 0000000..c641fa3 --- /dev/null +++ b/MetaforceInstaller.UI/Lang/Resources.resx @@ -0,0 +1,84 @@ + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Launch server + + + Launch PC admin + + + Install VR client + + + Install Android admin + + + Delete + + + Add new installation + + + Not connected + + + Connected to + + + Name of new installation + + + Choose .zip + + + Install server + + + Install admin + + + Save Android admin + + + Save VR client + + + Install + + + Cancel + + + Couldn't find directory with server + + + Couldn't find directory with PC admin + + + Couldn't find Windows content + + + Couldn't find Android content + + + Couldn't find any VR clients + + \ No newline at end of file diff --git a/MetaforceInstaller.UI/Lang/Resources.ru.resx b/MetaforceInstaller.UI/Lang/Resources.ru.resx new file mode 100644 index 0000000..891e8d9 --- /dev/null +++ b/MetaforceInstaller.UI/Lang/Resources.ru.resx @@ -0,0 +1,77 @@ + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Запустить сервер + + + Запустить админку + + + Удалить + + + Установить андроид-админку + + + Установить на шлем + + + Добавить версию + + + Подключено: + + + Не подключено + + + Выбрать .zip + + + Отмена + + + Установить админку + + + Установить + + + Установить сервер + + + Название версии + + + Сохранить андроид-админку + + + Сохранить VR-клиенты + + + Не удалось обнаружить Андроид контент + + + Не удалось обнаружить ПК-админку + + + Не удалось обнаружить сервер + + + Не удалось обнаружить VR-клиенты + + + Не удалось обнаружить Windows контент + + \ No newline at end of file diff --git a/MetaforceInstaller.UI/MetaforceInstaller.UI.csproj b/MetaforceInstaller.UI/MetaforceInstaller.UI.csproj index ad61469..3a83cb5 100644 --- a/MetaforceInstaller.UI/MetaforceInstaller.UI.csproj +++ b/MetaforceInstaller.UI/MetaforceInstaller.UI.csproj @@ -34,4 +34,19 @@ + + + PublicResXFileCodeGenerator + Resources.Designer.cs + + + + + + True + True + Resources.resx + + + diff --git a/MetaforceInstaller.UI/TextDefaults.cs b/MetaforceInstaller.UI/TextDefaults.cs deleted file mode 100644 index 176e1f6..0000000 --- a/MetaforceInstaller.UI/TextDefaults.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace MetaforceInstaller.UI; - -public static class TextDefaults -{ - public static readonly string InstallServer = "Install Server"; - public static readonly string InstallAdmin = "Install Admin"; - public static readonly string SaveAndroidAdmin = "Save Android admin"; - public static readonly string SaveVRClient = "Save VR client"; -} \ No newline at end of file diff --git a/MetaforceInstaller.UI/ViewModels/MainWindowViewModel.cs b/MetaforceInstaller.UI/ViewModels/MainWindowViewModel.cs index 6fbef5c..22c0005 100644 --- a/MetaforceInstaller.UI/ViewModels/MainWindowViewModel.cs +++ b/MetaforceInstaller.UI/ViewModels/MainWindowViewModel.cs @@ -47,7 +47,7 @@ public class MainWindowViewModel : INotifyPropertyChanged } public IBrush StatusColor => IsDeviceConnected ? Brushes.Green : Brushes.Red; - public string StatusText => IsDeviceConnected ? $"Connected to {_deviceSerial}" : "Not connected"; + public string StatusText => IsDeviceConnected ? $"{Lang.Resources.ConnectedTo} {_deviceSerial}" : Lang.Resources.NotConnected; public void LoadInstallations(IEnumerable data) { diff --git a/MetaforceInstaller.UI/Windows/MainWindow.axaml b/MetaforceInstaller.UI/Windows/MainWindow.axaml index 9e4547b..e7d4655 100644 --- a/MetaforceInstaller.UI/Windows/MainWindow.axaml +++ b/MetaforceInstaller.UI/Windows/MainWindow.axaml @@ -3,6 +3,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="using:MetaforceInstaller.UI.ViewModels" + xmlns:lang="using:MetaforceInstaller.UI.Lang" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:CompileBindings="True" x:DataType="vm:MainWindowViewModel" @@ -43,7 +44,12 @@ @@ -51,23 +57,22 @@ - - - - - - - + diff --git a/MetaforceInstaller.UI/Windows/NewInstallationDialog.axaml b/MetaforceInstaller.UI/Windows/NewInstallationDialog.axaml index 603e651..d9a410a 100644 --- a/MetaforceInstaller.UI/Windows/NewInstallationDialog.axaml +++ b/MetaforceInstaller.UI/Windows/NewInstallationDialog.axaml @@ -2,6 +2,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:lang="clr-namespace:MetaforceInstaller.UI.Lang" mc:Ignorable="d" d:DesignWidth="200" d:DesignHeight="400" x:Class="MetaforceInstaller.UI.Windows.NewInstallationDialog" Title="MetaforceInstaller - Add new installation" @@ -9,19 +10,19 @@ CanResize="False"> - - - - Install server - Install admin - Save android admin - Save VR client +